From 138c7090414f7164e7c553b3692803b298b8cd42 Mon Sep 17 00:00:00 2001 From: Robert Underwood Date: Mon, 4 Nov 2019 10:35:16 -0600 Subject: [PATCH] libpressio version 0.19.2 Minor Feature: + Added build option for docker containers for Fedora and Ubuntu. This will ease the use of installing and using the library for users wishing to target using this platform Bug Fix: + Previously, there was an undocumented dependancy on SWIG version 3.0.12 or later which would cause build failures when using the python bindings. This has been corrected by adding appropriate documentation to the README file. --- CMakeLists.txt | 22 +++++++- COPYRIGHT.txt | 2 +- README.md | 3 +- docker/{Dockerfile => Dockerfile-Fedora} | 0 docker/Dockerfile-Ubuntu18.04 | 64 ++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 3 deletions(-) rename docker/{Dockerfile => Dockerfile-Fedora} (100%) create mode 100644 docker/Dockerfile-Ubuntu18.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index ea6ea843..c2e1099c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) -project(libpressio VERSION "0.19.1" LANGUAGES CXX C) +project(libpressio VERSION "0.19.2" LANGUAGES CXX C) #correct was to set a default build type # https://blog.kitware.com/cmake-and-the-default-build-type/ @@ -211,5 +211,25 @@ if(BUILD_DOCS) ${PROJECT_SOURCE_DIR}/include COMMENT "Generate Documenation" ) + +option(BUILD_DOCKER_CONTAINERS "build docker containers for testing" OFF) +if(BUILD_DOCKER_CONTAINERS) + + foreach(CONTAINER Fedora Ubuntu18.04) + set(BuildSentinel ${CMAKE_BINARY_DIR}/${CONTAINER}-built) + set(Dockerfile docker/Dockerfile-${CONTAINER}) + string(TOLOWER "libpressio-${CONTAINER}" CONTAINER_TAG) + add_custom_command(OUTPUT ${BuildSentinel} + COMMAND docker build -t ${CONTAINER_TAG} -f ${Dockerfile} . + COMMAND touch ${BuildSentinel} + MAIN_DEPENDENCY ${Dockerfile} + DEPENDS SZ + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMENT "DOCKER ${Dockerfile}" + ) + list(APPEND DOCKER_CONTAINERS ${BuildSentinel}) + endforeach() + add_custom_target(docker DEPENDS ${DOCKER_CONTAINERS} COMMENT "building docker containers") +endif() endif() diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 16222098..5d4e1722 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -1,6 +1,6 @@ Copyright © 2019 , UChicago Argonne, LLC All Rights Reserved -[libpressio, Version 0.19.1] +[libpressio, Version 0.19.2] Robert Underwood Argonne National Laboratory diff --git a/README.md b/README.md index 92dde41f..1d41fee9 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ Libpressio additionally optionally requires: + `numpy` version `1.14.5` or later and its dependencies to provide the python bindings + `Doxygen` version 1.8.15 or later to generate documentation + `HDF5` version 1.10.0 or later for HDF5 data support ++ `swig` version 3.0.12 or later for python support -You can also use the provided `Dockerfile` in `./docker` to get a working libpressio install. Doing so requires installing `docker` version 17.05 or higher or other build tool that supports this version of Dockerfile syntax or later. +You can also use the provided `Dockerfile`s in `./docker` to get a working libpressio install. Doing so requires installing `docker` version 17.05 or higher or other build tool that supports this version of Dockerfile syntax or later. ## Configuring LibPressio diff --git a/docker/Dockerfile b/docker/Dockerfile-Fedora similarity index 100% rename from docker/Dockerfile rename to docker/Dockerfile-Fedora diff --git a/docker/Dockerfile-Ubuntu18.04 b/docker/Dockerfile-Ubuntu18.04 new file mode 100644 index 00000000..7beaf333 --- /dev/null +++ b/docker/Dockerfile-Ubuntu18.04 @@ -0,0 +1,64 @@ +FROM ubuntu:18.04 as builder +#contrary to the Filesystem Hierarchy Standard, +#warning ubuntu does not allow libraries to be installed in /usr/lib, use /usr/local instead +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y doxygen graphviz libhdf5-dev g++ git swig ninja-build libzstd-dev pkg-config \ + libfftw3-dev python3-dev python3-numpy wget zlib1g-dev && \ + wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v3.14.6/cmake-3.14.6-Linux-x86_64.sh && \ + sh cmake.sh --skip-licence --exclude-subdir --prefix=/usr/local && \ + apt clean -y +RUN git clone https://github.com/LLNL/zfp /src/zfp && \ + git clone https://github.com/disheng222/sz /src/sz && \ + git clone https://github.com/CODARcode/MGARD /src/mgard && \ + git clone https://github.com/CODARcode/libpressio /src/libpressio && \ + mkdir -p /src/autotuning && \ + cd /src/sz && \ + mkdir build && \ + cd build && \ + cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja && \ + cmake --build . && \ + ninja install && \ + cd /src/zfp && \ + mkdir build && \ + cd build && \ + cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -G Ninja && \ + cmake --build . && \ + ninja install && \ + cd /src/mgard && \ + mkdir build && \ + cd build && \ + cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -G Ninja && \ + cmake --build . && \ + ninja install +RUN cd /src/libpressio && \ + mkdir build && \ + cd build && \ + cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTS=ON -DLIBPRESSIO_HAS_MGARD=ON -DBUILD_PYTHON_WRAPPER=ON -G Ninja && \ + cmake --build . && \ + CTEST_OUTPUT_ON_FAILURE=1 ctest . && \ + ninja install &&\ + echo done + + + +FROM ubuntu:18.04 +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y zlib1g libfftw3-dev libhdf5-dev libzstd-dev python3-numpy libstdc++-7-dev libpython3.6 &&\ + apt-get clean -y +COPY --from=builder /usr/local/lib/libSZ.so* \ + /usr/local/lib/liblibpressio.so* \ + /usr/local/lib/libzfp.so* \ + /usr/local/lib/libmgard.so* \ + /usr/local/lib/ +COPY --from=builder /usr/local/include/libpressio \ + /usr/local/include/sz \ + /usr/local/include/zfp* \ + /usr/local/include/mgard* \ + /usr/local/include/ +COPY --from=builder /usr/local/bin/sz /usr/bin/ +COPY --from=builder /usr/lib/python3/dist-packages/*pressio* /usr/lib/python3/dist-packages/ +RUN ldconfig + +