From 4a98fa783aaf3a9c96d6477d4a416d1ab0e0597d Mon Sep 17 00:00:00 2001 From: aymanhab Date: Tue, 7 Mar 2023 11:57:22 -0800 Subject: [PATCH] Add docker file to build opensim-java with moco --- .../opensim-java/dockerfile-ubuntu-with-moco | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 opensim-core/opensim-java/dockerfile-ubuntu-with-moco diff --git a/opensim-core/opensim-java/dockerfile-ubuntu-with-moco b/opensim-core/opensim-java/dockerfile-ubuntu-with-moco new file mode 100644 index 0000000..44122b7 --- /dev/null +++ b/opensim-core/opensim-java/dockerfile-ubuntu-with-moco @@ -0,0 +1,53 @@ +FROM stanfordnmbl/opensim-deps:4.4-with-moco + +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 \ + libpcre3 libpcre3-dev flex bison + +# install openjdk8 +RUN apt-get install -y openjdk-8-jdk \ + && apt-get install -y ant \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/cache/oracle-jdk8-installer; + +# Fix certificate issue https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/983302 +RUN apt-get update \ + && apt-get install -y ca-certificates-java \ + && apt-get clean \ + && update-ca-certificates -f \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/cache/oracle-jdk8-installer; + +# Setup JAVA_HOME, this is useful for docker commandline +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ +RUN export JAVA_HOME + +#install SWIG +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 + +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_C3D_PARSER=ezc3d -DSWIG_DOXYGEN=OFF -DOPENSIM_WITH_CASADI=ON -DOPENSIM_WITH_TROPTER=ON \ + && make -j8 \ + && make install \ + && rm -rf ../opensim_build \ + && rm -rf ~/opensim_dependencies_install \ + && rm -rf $HOME/swig + +# image stored at stanfordnmbl/opensim-java