diff --git a/.travis.yml b/.travis.yml index 01bb595..86a5653 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ + + language: cpp dist: trusty sudo: required @@ -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 @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..14acb57 --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/ThirdParty/gtest/CMakeLists.txt b/ThirdParty/gtest/CMakeLists.txt index cc35c67..4a97a89 100644 --- a/ThirdParty/gtest/CMakeLists.txt +++ b/ThirdParty/gtest/CMakeLists.txt @@ -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})