-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #483 from rdkit/fix/debug-build
Fix/debug build
- Loading branch information
Showing
4 changed files
with
85 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
FROM debian:buster as build-stage | ||
# Example usage of this Dockerfile: | ||
# (the build-arg arguments are all optional) | ||
# | ||
# 1. cd to Code/MinimalLib/docker | ||
# cd Code/MinimalLib/docker | ||
# | ||
# 2. build the JS and WASM libraries | ||
# (the build-arg arguments are all optional) | ||
# docker build -t rdkit-minimallib --network=host \ | ||
# --build-arg "RDKIT_GIT_URL=https://github.com/myfork/rdkit.git" \ | ||
# --build-arg "RDKIT_BRANCH=mybranch" . | ||
# | ||
# 3. create a temporary container and copy built libraries | ||
# from the container to your local filesystem, then destroy | ||
# the temporary container | ||
# docker create --name=rdkit-minimallib-container rdkit-minimallib:latest --entrypoint / | ||
# docker cp rdkit-minimallib-container:/RDKit_minimal.js ../demo | ||
# docker cp rdkit-minimallib-container:/RDKit_minimal.wasm ../demo | ||
# docker rm rdkit-minimallib-container | ||
|
||
|
||
ARG RDKIT_GIT_URL="https://github.com/rdkit/rdkit.git" | ||
ARG RDKIT_BRANCH="master" | ||
ARG EMSDK_VERSION="latest" | ||
ARG BOOST_MAJOR_VERSION="1" | ||
ARG BOOST_MINOR_VERSION="84" | ||
ARG BOOST_PATCH_VERSION="0" | ||
|
||
FROM debian:bookworm as build-stage | ||
ARG RDKIT_GIT_URL | ||
ARG RDKIT_BRANCH | ||
ARG EMSDK_VERSION | ||
ARG BOOST_MAJOR_VERSION | ||
ARG BOOST_MINOR_VERSION | ||
ARG BOOST_PATCH_VERSION | ||
|
||
LABEL maintainer="Greg Landrum <[email protected]>" | ||
|
||
RUN apt-get update && apt-get upgrade -y && apt install -y \ | ||
|
@@ -9,15 +44,17 @@ RUN apt-get update && apt-get upgrade -y && apt install -y \ | |
g++ \ | ||
libeigen3-dev \ | ||
git \ | ||
nodejs \ | ||
libfreetype6-dev | ||
xz-utils \ | ||
nodejs | ||
|
||
ENV LANG C | ||
|
||
WORKDIR /opt | ||
RUN wget -q https://boostorg.jfrog.io/artifactory/main/release/1.67.0/source/boost_1_67_0.tar.gz && \ | ||
tar xzf boost_1_67_0.tar.gz | ||
WORKDIR /opt/boost_1_67_0 | ||
ARG BOOST_DOT_VERSION="${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION}" | ||
ARG BOOST_UNDERSCORE_VERSION="${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION}" | ||
RUN wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_DOT_VERSION}/source/boost_${BOOST_UNDERSCORE_VERSION}.tar.gz && \ | ||
tar xzf boost_${BOOST_UNDERSCORE_VERSION}.tar.gz | ||
WORKDIR /opt/boost_${BOOST_UNDERSCORE_VERSION} | ||
RUN ./bootstrap.sh --prefix=/opt/boost --with-libraries=system && \ | ||
./b2 install | ||
|
||
|
@@ -26,21 +63,21 @@ WORKDIR /opt | |
RUN git clone https://github.com/emscripten-core/emsdk.git | ||
|
||
WORKDIR /opt/emsdk | ||
RUN ./emsdk update-tags && \ | ||
./emsdk install latest && \ | ||
./emsdk activate latest | ||
RUN ./emsdk install ${EMSDK_VERSION} && \ | ||
./emsdk activate ${EMSDK_VERSION} | ||
|
||
#RUN source ./emsdk_env.sh | ||
|
||
RUN mkdir /src | ||
WORKDIR /src | ||
ENV RDBASE=/src/rdkit | ||
ARG RDKIT_BRANCH=${RDKIT_BRANCH:-master} | ||
RUN git clone https://github.com/rdkit/rdkit.git | ||
RUN git clone ${RDKIT_GIT_URL} | ||
WORKDIR $RDBASE | ||
RUN git fetch --all --tags && \ | ||
git checkout $RDKIT_BRANCH | ||
git checkout ${RDKIT_BRANCH} | ||
|
||
RUN mkdir build | ||
WORKDIR build | ||
WORKDIR $RDBASE/build | ||
|
||
RUN echo "source /opt/emsdk/emsdk_env.sh > /dev/null 2>&1" >> ~/.bashrc | ||
SHELL ["/bin/bash", "-c", "-l"] | ||
|
@@ -60,6 +97,12 @@ RUN emcmake cmake -DBoost_INCLUDE_DIR=/opt/boost/include -DRDK_BUILD_FREETYPE_SU | |
RUN cp /src/rdkit/External/INCHI-API/src/INCHI_BASE/src/util.c /src/rdkit/External/INCHI-API/src/INCHI_BASE/src/util.c.bak && \ | ||
sed 's/&& defined(__APPLE__)//' /src/rdkit/External/INCHI-API/src/INCHI_BASE/src/util.c.bak > /src/rdkit/External/INCHI-API/src/INCHI_BASE/src/util.c | ||
|
||
# comment out a line which causes a compilation error on some platforms | ||
# (based on the change which has already been applied to the RapidJSON master branch, see | ||
# https://github.com/Tencent/rapidjson/blob/ab1842a2dae061284c0a62dca1cc6d5e7e37e346/include/rapidjson/document.h#L414) | ||
RUN sed -i 's|^\( *\)\(GenericStringRef\& operator=(const GenericStringRef\& rhs) { s = rhs.s; length = rhs.length; } *\)$|\1//\2|' \ | ||
/src/rdkit/External/rapidjson-1.1.0/include/rapidjson/document.h | ||
|
||
# build and "install" | ||
RUN make -j2 RDKit_minimal && \ | ||
cp Code/MinimalLib/RDKit_minimal.* ../Code/MinimalLib/demo/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set -e | ||
|
||
# Set branch to release | ||
RDKIT_BRANCH="$RDKIT_BRANCH" | ||
MINIMALLIB_OUTPUT_PATH="dist" | ||
|
||
# Build distribution files | ||
DOCKER_BUILDKIT=1 docker build --no-cache --platform=linux/amd64 -f Dockerfile --build-arg RDKIT_BRANCH=$RDKIT_BRANCH -o $MINIMALLIB_OUTPUT_PATH . |