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

Docker container #4

Open
wants to merge 3 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
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


language: cpp
dist: trusty
sudo: required
Expand All @@ -9,11 +11,22 @@ before_install:
- sudo apt-get update -qq
# - sudo apt-get install -qq libinsighttoolkit4-dev # ubuntu trusty has ITK 4.5 as default, while we need ITK >4.9
- sudo apt-get install -qq libvtk6-dev libvtk6
- sudo apt-get install -qq cmake
# - sudo apt-get install -qq cmake
- sudo apt-get install -qq gsl-bin libgsl0-dev
- sudo apt-get install -qq liblapack-dev liblapacke-dev
- sudo apt-get install -qq libopenblas-dev

# build cmake
- version=3.14
- build=3
- cd /tmp
- wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
- tar -xzvf cmake-$version.$build.tar.gz
- cd cmake-$version.$build/
- ./bootstrap
- make -j4
- sudo make install

# needed by vtk in some cases
- sudo apt-get install -qq libpq-dev libpqxx-dev libpq5
- sudo find /usr/lib -name libpq.so
Expand All @@ -35,6 +48,7 @@ install:
- cmake ${ITK_SOURCE_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DModule_ITKReview=OFF
- make --jobs=$NUM_THREADS --keep-going


# build SlicerExecutionModel
- cd $HOME
- git clone https://github.com/Slicer/SlicerExecutionModel.git
Expand Down
58 changes: 58 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM ubuntu:16.04

RUN apt-get update -y && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y tzdata && \
ln -fs /usr/share/zoneinfo/America/Chicago /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata && \
apt-get install -y libvtk6-dev libvtk6.2 gsl-bin libgsl0-dev \
liblapack3 liblapack-dev liblapacke-dev libopenblas-dev libpq-dev \
libpqxx-dev libpq5 git wget libproj-dev && \
find /usr/lib -name libpq.so -exec ln -s {} /usr/lib/libpq.so ';'

RUN export version=3.14 && \
export build=3 && \
cd /tmp && \
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz && \
tar -xzvf cmake-$version.$build.tar.gz && \
cd cmake-$version.$build/ && \
./bootstrap && \
make -j4 && \
make install

RUN export NUM_THREADS=4 && \
export ITK_VERSION=v4.9.0 && \
export ITK_SOURCE_DIR=/opt/itk-${ITK_VERSION} && \
export ITK_BUILD_DIR=${ITK_SOURCE_DIR}-build && \
export ITK_DIR=${ITK_BUILD_DIR} && \
git clone --depth 1 --branch ${ITK_VERSION} \
https://github.com/InsightSoftwareConsortium/ITK.git ${ITK_SOURCE_DIR} && \
mkdir -p ${ITK_BUILD_DIR} && \
cd ${ITK_BUILD_DIR} && \
cmake ${ITK_SOURCE_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \
-DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DModule_ITKReview=OFF && \
make --jobs=$NUM_THREADS --keep-going && \
make install && \
ldconfig -v

RUN cd /opt && \
export ITK_DIR=/opt/itk-v4.9.0-build && \
git clone https://github.com/Slicer/SlicerExecutionModel.git && \
mkdir -p /opt/SlicerExecutionModel-build && \
cd /opt/SlicerExecutionModel-build && \
cmake /opt/SlicerExecutionModel && \
make -j ${NUM_THREADS}

COPY . /opt/dmri-tool
RUN mkdir -p /opt/dmritool-build && \
cd /opt/dmritool-build && \
export OPENBLAS_NUM_THREADS=1 && \
export OMP_NUM_THREADS=1 && \
cmake -DGenerateCLP_DIR=/opt/SlicerExecutionModel-build/GenerateCLP \
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DDMRITOOL_USE_MKL=OFF \
-DDMRITOOL_USE_FASTLAPACK=ON -DDMRITOOL_USE_OPENMP=ON \
-DBUILD_QT_APPLICATIONS=OFF -DDMRITOOL_WRAP_MATLAB=OFF \
/opt/dmri-tool && \
make -j 2 && \
make install && \
echo "export PATH=$PATH:/usr/local/dmritool/bin" >> /root/.bashrc
6 changes: 4 additions & 2 deletions ThirdParty/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include)

# Specify MainTest's link libraries
ExternalProject_Get_Property(googletest binary_dir)
set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE)
set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest)
# set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE)
# set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest)
set(GTEST_LIBS_DIR ${binary_dir}/lib PARENT_SCOPE)
set(GTEST_LIBS_DIR ${binary_dir}/lib)


include_directories(${GTEST_INCLUDE_DIRS})
Expand Down