Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install a custom OpenMM #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ build:
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(CONDA_PREFIX) \
-DEXTRA_COMPILE_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
-DOPENMM_DIR=$(CONDA_PREFIX) \
&&\
make -j
Expand All @@ -29,7 +28,7 @@ install: check
make -C $(BUILD_DIR) install

python: install
make -C $(BUILD_DIR) PythonInstall CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
make -C $(BUILD_DIR) PythonInstall

clean:
$(RM) -r $(BUILD_DIR)
Expand Down
25 changes: 22 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ RUN echo $UID $GID &&\
USER $UID:$GID

# Create conda enviroment
ENV OPENMM_VERSION 7.3.1
ENV OPENMM_VERSION 7.4.1.2020.01.06
ENV PYTHON_VERSION 3.7
ENV CONDA_NAME devel
ENV CONDA_CHANNEL_LIST "--channel omnia/label/${PLUGIN_CUDA_LABEL}"
ENV CONDA_CHANNEL_LIST "--channel conda-forge"
RUN conda create $CONDA_CHANNEL_LIST \
--name $CONDA_NAME \
--yes \
Expand All @@ -79,12 +79,31 @@ RUN conda create $CONDA_CHANNEL_LIST \
git \
make \
nomkl \
openmm==$OPENMM_VERSION \
python==$PYTHON_VERSION \
swig &&\
conda clean --all --yes
RUN echo "conda activate $CONDA_NAME" >> ~/.bashrc

# Build a custom OpenMM
# Note: cannot use the OpennMM packages form Omnia channel because they are
# built with the old C++ ABI.
# Note: conda-build needs a writable cache directory
RUN echo -e "pkgs_dirs:\n - ~/.conda/pkgs" > ~/.condarc
COPY --chown=$UID:$GID openmm /tmp/openmm
RUN . /etc/profile.d/conda.sh &&\
conda activate $CONDA_NAME &&\
conda build $CONDA_CHANNEL_LIST \
--python $PYTHON_VERSION \
/tmp/openmm &&\
conda build purge &&\
rm -r /tmp/openmm
ENV CONDA_CHANNEL_LIST "--channel file://home/user/.conda/envs/$CONDA_NAME/conda-bld \
$CONDA_CHANNEL_LIST"
RUN conda install $CONDA_CHANNEL_LIST \
--name $CONDA_NAME \
--yes \
openmm==$OPENMM_VERSION

# Set up environment
RUN cd && ln -s .conda/envs/devel/conda-bld/linux-64 packages
WORKDIR /home/user/openmm-tensorrt.git
Expand Down