Skip to content

Commit

Permalink
Update build process for LillyMol 7.0 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyan-ru authored Oct 23, 2023
1 parent 9f37473 commit 2dc65c0
Show file tree
Hide file tree
Showing 1,766 changed files with 8,851 additions and 5,144 deletions.
56 changes: 17 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,56 +1,34 @@
FROM gcc:10.2
FROM gcc:13.2

ENV LILLYMOL_HOME=/LillyMol \
BUILD_DIR=Linux

# Install Eigen
# (No need to install zlib since zlib1g and zlib1g-dev are alreday in the gcc base image)
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y libeigen3-dev && \
cd /usr/include && \
ln -sf eigen3/Eigen Eigen
apt-get upgrade -y

RUN apt-get install npm -y && \
npm install -g @bazel/bazelisk && \
apt-get install cmake -y

RUN apt-get install python3-pip -y && \
pip3 install pandas && \
apt-get install libblas-dev -y && \
apt-get install liblapack-dev -y && \
pip3 install scipy

COPY . ./LillyMol

WORKDIR /LillyMol
npm install -g @bazel/bazelisk

RUN mkdir bin && \
mkdir bin/Linux && \
cd src && \
./build_third_party.sh

WORKDIR /LillyMol/src
RUN apt-get install libblas-dev -y && \
apt-get install liblapack-dev -y

RUN cp /tmp/WORKSPACE .
RUN apt-get install python3-minimal -y && \
apt-get install python3-pandas python3-scipy python3-absl python3-pybind11 python3-protobuf -y

WORKDIR /LillyMol/src/build_deps
RUN rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python

RUN sed -i 's/\/workspaces\/LillyMolPrivate\/bin\/Linux\//\/LillyMol\/bin\/Linux\//g' install.bzl
COPY . ./LillyMol

WORKDIR /LillyMol
ENV LILLYMOL_HOME=/LillyMol \
BUILD_DIR=Linux

# This step probably not necessary since now, third party
# dependencies are all linked static. Maybe that will change.
ENV LD_LIBRARY_PATH=/LillyMol/third_party/lib

RUN mkdir /node && \
mkdir /node/scratch

WORKDIR /LillyMol/src

ENV BUILD_BDB=1
ENV BUILD_PYTHON=1

RUN ./build_third_party.sh
RUN ./build_from_src.sh

WORKDIR /LillyMol

RUN rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python

# RUN apt-get install python3-pip -Y
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2018 Eli Lilly and Company
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
########################################################################

.PHONY: default
.PHONY: all

# A default target that will probably work in most cases.
# Note it does not build BerkeleyDB dependent tools or Python bindings.
default:
bash -c 'if [[ -z "$$(type -p bazelisk)" && -z "$$(type -p bazel)" ]] ; then echo "No bazel/bazelisk, see README.md" && exit 1 ; fi'
echo "Default build does not build targets 'berkeleydb' and 'python'"
cd src && ./build_third_party.sh
cd src && ./build_from_src.sh

all:
bash -c 'if [[ -z "$$(type -p bazelisk)" && -z "$$(type -p bazel)" ]] ; then echo "No bazel/bazelisk, see README.md" && exit 1 ; fi'
cd src && BUILD_BDB=1 BUILD_PYTHON=1 ./build_third_party.sh
cd src && BUILD_BDB=1 BUILD_PYTHON=1 ./build_from_src.sh

berkeleydb:
bash -c 'if [[ -z "$$(type -p bazelisk)" && -z "$$(type -p bazel)" ]] ; then echo "No bazel/bazelisk, see README.md" && exit 1 ; fi'
cd src && BUILD_BDB=1 ./build_third_party.sh
cd src && BUILD_BDB=1 ./build_from_src.sh

python:
bash -c 'if [[ -z "$$(type -p bazelisk)" && -z "$$(type -p bazel)" ]] ; then echo "No bazel/bazelisk, see README.md" && exit 1 ; fi'
cd src && BUILD_PYTHON=1 ./build_third_party.sh
cd src && BUILD_PYTHON=1 ./build_from_src.sh

build_docker:
docker build -f Dockerfile -t lillymol .

test_lillymol:
docker container exec lilly_mol bash -c "cd test/ && ./run_all_test.sh"
docker container exec lilly_mol bash -c "cd src/ && ./run_python_unit_tests.sh 2>&1"
Loading

0 comments on commit 2dc65c0

Please sign in to comment.