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

Build latest #16

Open
wants to merge 13 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
10 changes: 7 additions & 3 deletions opensim-core/opensim-cpp/dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM stanfordnmbl/opensim-deps
FROM stanfordnmbl/opensim-deps:latest

LABEL maintainer="Ayman Habib"

# Build cpp only libraries and cli for opensim-core no bindings
RUN mkdir opensim_build \
&& cd opensim_build \
&& cmake ../opensim-core \
&& cmake ../opensim-core -LAH \
-DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=OFF \
-DOPENSIM_C3D_PARSER=ezc3d -DOPENSIM_WITH_TROPTER=OFF -DOPENSIM_WITH_CASADI=OFF -DBUILD_TESTING=OFF \
&& make -j8 \
&& make install \
&& rm -rf ../opensim_build

# Set LD_LIBRARY_PATH so pyhton can load the shard libraries
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSIM_DEPENDENCIES_HOME/simbody/lib:$OPENSIM_INSTALL/lib"
ENV PATH=$PATH:"$OPENSIM_INSTALL/bin"

# image stored at stanfordnmbl/opensim-cpp
19 changes: 19 additions & 0 deletions opensim-core/opensim-cpp/moco-dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM stanfordnmbl/opensim-deps:latest-with-moco

LABEL maintainer="Ayman Habib"

# Build cpp only libraries and cli for opensim-core no bindings
RUN mkdir opensim_build \
&& cd opensim_build \
&& cmake ../opensim-core -LAH \
-DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=OFF \
&& make -j8 \
&& make install \
&& rm -rf ../opensim_build

# Set LD_LIBRARY_PATH so pyhton can load the shard libraries
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSIM_DEPENDENCIES_HOME/simbody/lib:$OPENSIM_INSTALL/lib"
ENV PATH=$PATH:"$OPENSIM_INSTALL/bin"

# image stored at stanfordnmbl/opensim-cpp
14 changes: 9 additions & 5 deletions opensim-core/opensim-java/dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM stanfordnmbl/opensim-deps
FROM stanfordnmbl/opensim-deps:latest

LABEL maintainer="Ayman Habib"

# The following sets timezone to avoid prompt for timezone when installing packages
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive && apt-get --yes install \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
&& apt-get --yes install \
libpcre3 libpcre3-dev flex bison

# install openjdk8
Expand Down Expand Up @@ -42,12 +43,15 @@ RUN mkdir opensim_build \
&& cd opensim_build \
&& cmake ../opensim-core \
-DSWIG_DIR=~/swig/share/swig -DSWIG_EXECUTABLE=~/swig/bin/swig -DBUILD_JAVA_WRAPPING=ON -DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_WITH_TROPTER=OFF -DOPENSIM_WITH_CASADI=OFF -DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_C3D_PARSER=ezc3d -DSWIG_DOXYGEN=OFF \
&& make -j8 \
&& make install \
&& rm -rf ../opensim_build \
&& rm -rf ~/opensim_dependencies_install \
&& rm -rf $HOME/swig
&& rm -rf $HOME/swig

# Set LD_LIBRARY_PATH so pyhton can load the shard libraries
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSIM_DEPENDENCIES_HOME/simbody/lib:$OPENSIM_INSTALL/lib"
ENV PATH=$PATH:"$OPENSIM_INSTALL/bin"

# image stored at stanfordnmbl/opensim-java
6 changes: 3 additions & 3 deletions opensim-core/opensim-python/dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stanfordnmbl/opensim-deps
FROM stanfordnmbl/opensim-deps:latest

LABEL maintainer="Ayman Habib"

Expand Down Expand Up @@ -34,15 +34,15 @@ RUN mkdir opensim_build \
-DSWIG_DIR=~/swig/share/swig -DSWIG_EXECUTABLE=~/swig/bin/swig -DBUILD_PYTHON_WRAPPING=ON \
-DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=OFF -DSWIG_DOXYGEN=OFF \
-DOPENSIM_WITH_TROPTER=OFF -DOPENSIM_WITH_CASADI=OFF \
-DPYTHON_EXECUTABLE=/usr/bin/python3.8 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.8/dist-packages/numpy/core/include \
&& make -j8 \
&& make install \
&& rm -rf ../opensim_build \
&& rm -rf $HOME/swig \
&& cp "$OPENSIM_DEPENDENCIES_HOME/adol-c/lib64/*.so*" "$OPENSIM_DEPENDENCIES_HOME/lib"
&& rm -rf $HOME/swig

# Set LD_LIBRARY_PATH so pyhton can load the shard libraries
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSIM_DEPENDENCIES_HOME/simbody/lib:$OPENSIM_INSTALL/lib"
Expand Down
55 changes: 55 additions & 0 deletions opensim-core/opensim-python/moco-dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM stanfordnmbl/opensim-deps:latest-with-moco

LABEL maintainer="Ayman Habib"

# The following sets timezone to avoid prompt for timezone when installing packages later
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get --yes install \
software-properties-common \
python3.8 python3.8-dev python3.8-distutils python3.8-venv \
libpcre3 libpcre3-dev flex bison
RUN wget https://bootstrap.pypa.io/get-pip.py \
&& python3.8 get-pip.py \
&& pip3.8 install numpy

# install Swig from source then install
RUN mkdir ~/swig-source && cd ~/swig-source \
&& wget https://github.com/swig/swig/archive/refs/tags/rel-4.0.2.tar.gz \
&& tar xzf rel-4.0.2.tar.gz \
&& cd swig-rel-4.0.2 \
&& sh autogen.sh \
&& ./configure --prefix=$HOME/swig --disable-ccache \
&& make \
&& make -j4 install \
&& rm -rf ~/swig-source

# Build and install opensim-core with python bindings
RUN mkdir opensim_build \
&& cd opensim_build \
&& cmake ../opensim-core \
-DSWIG_DIR=~/swig/share/swig -DSWIG_EXECUTABLE=~/swig/bin/swig -DBUILD_PYTHON_WRAPPING=ON \
-DCMAKE_INSTALL_PREFIX=$OPENSIM_INSTALL -DOPENSIM_DEPENDENCIES_DIR=$OPENSIM_DEPENDENCIES_HOME \
-DOPENSIM_C3D_PARSER=ezc3d -DBUILD_TESTING=OFF -DSWIG_DOXYGEN=OFF \
-DPYTHON_EXECUTABLE=/usr/bin/python3.8 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python3.8/dist-packages/numpy/core/include \
&& make -j8 \
&& make install \
&& rm -rf ../opensim_build \
&& rm -rf $HOME/swig

# Set LD_LIBRARY_PATH so pyhton can load the shard libraries
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSIM_DEPENDENCIES_HOME/simbody/lib:$OPENSIM_INSTALL/lib"
ENV PATH=$PATH:"$OPENSIM_INSTALL/bin"

# Ideally we install the module but that doesn't work now, so we set PYTHONPATH instead
ENV PYTHONPATH="$OPENSIM_INSTALL/lib/python3.8/site-packages"
# RUN cd "$OPENSIM_INSTALL/lib/python3.8/site-packages" \
# && python3.8 setup.py install

# image stored at stanfordnmbl/opensim-python
13 changes: 8 additions & 5 deletions opensim-deps/dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ ENV OPENSIM_INSTALL="/opensim_install"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive && apt-get --yes --fix-missing install \
git \
build-essential libtool autoconf \
cmake cmake-curses-gui \
wget \
pkg-config \
gfortran \
freeglut3-dev \
libxi-dev libxmu-dev liblapack-dev libopenblas-dev \
cmake cmake-curses-gui \
coinor-libipopt-dev libcolpack-dev
software-properties-common

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
&& apt-get update \
&& apt install --yes cmake cmake-curses-gui

# This clones latest master, we should use tags for public releases
RUN git clone https://github.com/opensim-org/opensim-core.git \
Expand All @@ -34,8 +37,8 @@ RUN mkdir opensim_dependencies_build \
&& cd opensim_dependencies_build \
&& cmake ../opensim-core/dependencies/ \
-LAH -DCMAKE_INSTALL_PREFIX=$OPENSIM_DEPENDENCIES_HOME -DCMAKE_BUILD_TYPE=Release \
-DSUPERBUILD_ezc3d=ON -DSUPERBUILD_casadi=ON -DSUPERBUILD_adolc=ON -DSUPERBUILD_ipopt=ON \
-DSUPERBUILD_colpack=ON \
-DSUPERBUILD_ezc3d=ON -DOPENSIM_WITH_TROPTER=OFF \
-DOPENSIM_WITH_CASADAI=OFF \
&& make -j8 \
&& rm -rf ../opensim_dependencies_build

Expand Down
43 changes: 43 additions & 0 deletions opensim-deps/moco-dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:18.04

LABEL maintainer="Ayman Habib"

# Prepare environment variables with paths used now and later (using absolute paths )

# Set environment variable with the dependencies install directory
ENV OPENSIM_DEPENDENCIES_HOME="/opensim_dependencies_install"

# Set environment variable with the OpenSim install directory (will be used by child images)
ENV OPENSIM_INSTALL="/opensim_install"

# Set DEBIAN_FRONTEND to avoid interactive timezone prompt when installing
# packages.
RUN apt-get update && DEBIAN_FRONTEND=noninteractive && apt-get --yes --fix-missing install \
git \
build-essential libtool autoconf \
wget \
pkg-config \
gfortran \
freeglut3-dev \
libxi-dev libxmu-dev liblapack-dev libopenblas-dev \
software-properties-common

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \
&& apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \
&& apt-get update \
&& apt install --yes cmake cmake-curses-gui

# This clones latest master, we should use tags for public releases
RUN git clone https://github.com/opensim-org/opensim-core.git \
&& cd /opensim-core \
&& git checkout master \
&& rm -rf .git

RUN mkdir opensim_dependencies_build \
&& cd opensim_dependencies_build \
&& cmake ../opensim-core/dependencies/ \
-LAH -DCMAKE_INSTALL_PREFIX=$OPENSIM_DEPENDENCIES_HOME -DCMAKE_BUILD_TYPE=Release \
-DOPENSIM_WITH_TROPTER=ON -DOPENSIM_WITH_CASADI=ON -DSUPERBUILD_ezc3d=ON \
&& make -j8

# images are stored in stanfordnmbl/opensim-deps