diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a31aedb8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +build.* diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b3a8cbd..d9e0a937 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,8 @@ if(TAGS) ) endif() +option(BUILD_SHARED_LIBS "build shared libraries over static libraries" ON) + #find dependencies include(GNUInstallDirs) find_package(PkgConfig) @@ -102,7 +104,7 @@ option(BUILD_RANDOMACCESS "build the random access code" OFF) option(BUILD_DOCKER_CONTAINERS "build docker containers for testing" OFF) if(BUILD_DOCKER_CONTAINERS) - foreach(CONTAINER Centos Fedora Ubuntu Travis) + foreach(CONTAINER Centos Fedora Ubuntu Travis CentosPackaged) set(BuildSentinel ${CMAKE_BINARY_DIR}/${CONTAINER}-built) set(Dockerfile docker/Dockerfile-${CONTAINER}) string(TOLOWER "sz${CONTAINER}" CONTAINER_TAG) diff --git a/README.md b/README.md index 0328f49e..ef6c9a60 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,8 @@ cmake --build . sudo cmake --install . ``` +Please note, building static libraries is incompatiable with building the python wrappers, and is building the python wrappers is disabled if `-DBUILD_SHARED_LIBS=OFF` + An example usage file can be found in `example/test.py` Additional documentation can be found using the `help` function in python. diff --git a/docker/Dockerfile-CentosPackaged b/docker/Dockerfile-CentosPackaged new file mode 100644 index 00000000..d2a7fee9 --- /dev/null +++ b/docker/Dockerfile-CentosPackaged @@ -0,0 +1,23 @@ +FROM centos:7 +RUN yum update -y && \ + yum install -y epel-release && \ + yum install -y \ + cmake3 \ + CUnit-devel \ + ctags \ + gcc \ + gcc-c++ \ + fftw-devel \ + netcdf-devel \ + make \ + swig3 \ + python-devel \ + numpy && \ + yum clean all +COPY . /build/ +WORKDIR /build/ +RUN rm -rf build && \ + mkdir -p build && \ + cd build && \ + cmake3 .. && \ + make -j diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 1649233a..aa1b6c3b 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -34,7 +34,7 @@ official policies, either expressed or implied, of Robert Underwood. cmake_minimum_required(VERSION 3.14) find_package(SWIG) -if(SWIG_FOUND) +if(SWIG_FOUND AND BUILD_SHARED_LIBS) include(UseSWIG) find_package(Python COMPONENTS Interpreter Development NumPy) diff --git a/sz/CMakeLists.txt b/sz/CMakeLists.txt index 51bb1375..248cfdf8 100644 --- a/sz/CMakeLists.txt +++ b/sz/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library (SZ SHARED +add_library (SZ src/ArithmeticCoding.c src/ByteToolkit.c src/CacheTable.c