|
| 1 | +FROM ubuntu:22.04 |
| 2 | +SHELL ["/bin/bash", "-c"] |
| 3 | +RUN apt-get update && apt-get install -y wget cmake git g++ |
| 4 | + |
| 5 | +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ |
| 6 | + bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda && \ |
| 7 | + /opt/miniconda/bin/conda init bash && \ |
| 8 | + rm -rf Miniconda3-latest-Linux-x86_64.sh |
| 9 | + |
| 10 | +RUN eval "$(/opt/miniconda/bin/conda shell.bash hook)" && \ |
| 11 | + export CONDA_OVERRIDE_CUDA="12.0" && \ |
| 12 | + conda create -y -n dmff_omm -c conda-forge python=3.11 openmm libtensorflow_cc tensorflow-gpu swig numpy && \ |
| 13 | + conda activate dmff_omm && \ |
| 14 | + TF_VERSION=$(python -c 'import tensorflow as tf; print(tf.__version__)') && \ |
| 15 | + wget https://github.com/tensorflow/tensorflow/archive/refs/tags/v$TF_VERSION.tar.gz && \ |
| 16 | + tar -xf v$TF_VERSION.tar.gz && \ |
| 17 | + mkdir -p ${CONDA_PREFIX}/include/tensorflow/c && \ |
| 18 | + cp -r tensorflow-$TF_VERSION/tensorflow/c ${CONDA_PREFIX}/include/tensorflow && \ |
| 19 | + rm -r tensorflow-$TF_VERSION v$TF_VERSION.tar.gz |
| 20 | + |
| 21 | +# install TF C API for cppflow: https://www.tensorflow.org/install/lang_c |
| 22 | +# wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-$TF_VERSION.tar.gz |
| 23 | +# tar -xf libtensorflow-gpu-linux-x86_64-$TF_VERSION.tar.gz -C /usr/local |
| 24 | + |
| 25 | +RUN eval "$(/opt/miniconda/bin/conda shell.bash hook)" && \ |
| 26 | + conda activate dmff_omm && \ |
| 27 | + git clone https://github.com/caic99/DMFF.git && \ |
| 28 | + git clone https://github.com/serizba/cppflow.git && \ |
| 29 | + cd cppflow && \ |
| 30 | + git apply ../DMFF/backend/openmm_dmff_plugin/tests/cppflow_empty_constructor.patch && \ |
| 31 | + cp -r include/cppflow ${CONDA_PREFIX}/include && \ |
| 32 | + cd .. && \ |
| 33 | + rm -r cppflow && \ |
| 34 | + export OPENMM_INSTALLED_DIR=$CONDA_PREFIX && \ |
| 35 | + export CPPFLOW_INSTALLED_DIR=$CONDA_PREFIX && \ |
| 36 | + export LIBTENSORFLOW_INSTALLED_DIR=$CONDA_PREFIX && \ |
| 37 | + cd DMFF/backend/openmm_dmff_plugin/ && \ |
| 38 | + mkdir build && cd build && \ |
| 39 | + cmake .. -DOPENMM_DIR=${OPENMM_INSTALLED_DIR} \ |
| 40 | + -DCPPFLOW_DIR=${CPPFLOW_INSTALLED_DIR} \ |
| 41 | + -DTENSORFLOW_DIR=${LIBTENSORFLOW_INSTALLED_DIR} && \ |
| 42 | + make -j && make install && \ |
| 43 | + make -j PythonInstall && \ |
| 44 | + cd / && rm -r DMFF |
| 45 | + # python -m OpenMMDMFFPlugin.tests.test_dmff_plugin_nve -n 100 && \ |
0 commit comments