Skip to content

Commit

Permalink
CMake 3.24+: ZLIB_USE_STATIC_LIBS (#1410)
Browse files Browse the repository at this point in the history
Recent CMake versions add a control variable to ensure only
a static zlib is picked up.
  • Loading branch information
ax3l authored Mar 30, 2023
1 parent a6f5131 commit 022035a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN curl -sLo c-blosc-1.15.0.tar.gz https://github.com/Blosc/c-blosc/arch
&& PY_TARGET=${PY_VERSIONS%% *} \
&& PY_BIN=/opt/python/cp${PY_TARGET:0:2}-cp${PY_TARGET}/bin/python \
&& CMAKE_BIN="$(${PY_BIN} -m pip show cmake 2>/dev/null | grep Location | cut -d' ' -f2)/cmake/data/bin/" \
&& PATH=${CMAKE_BIN}:${PATH} cmake -DDEACTIVATE_SNAPPY=ON -DBUILD_SHARED=OFF -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DCMAKE_INSTALL_PREFIX=/usr ../c-blosc-* \
&& PATH=${CMAKE_BIN}:${PATH} cmake -DDEACTIVATE_SNAPPY=ON -DBUILD_SHARED=OFF -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DPREFER_EXTERNAL_ZLIB=ON -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr ../c-blosc-* \
&& make \
&& make install

Expand All @@ -74,7 +74,7 @@ RUN curl -sLo adios2-2.7.1.tar.gz https://github.com/ornladios/ADIOS2/arc
&& PY_TARGET=${PY_VERSIONS%% *} \
&& PY_BIN=/opt/python/cp${PY_TARGET:0:2}-cp${PY_TARGET}/bin/python \
&& CMAKE_BIN="$(${PY_BIN} -m pip show cmake 2>/dev/null | grep Location | cut -d' ' -f2)/cmake/data/bin/" \
&& PATH=${CMAKE_BIN}:${PATH} cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DADIOS2_BUILD_EXAMPLES=OFF -DADIOS2_BUILD_TESTING=OFF -DCMAKE_DISABLE_FIND_PACKAGE_LibFFI=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BISON=TRUE -DCMAKE_INSTALL_PREFIX=/usr ../ADIOS2-* \
&& PATH=${CMAKE_BIN}:${PATH} cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DADIOS2_BUILD_EXAMPLES=OFF -DADIOS2_BUILD_TESTING=OFF -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_DISABLE_FIND_PACKAGE_LibFFI=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BISON=TRUE -DCMAKE_INSTALL_PREFIX=/usr ../ADIOS2-* \
&& make \
&& make install

Expand All @@ -83,6 +83,7 @@ ADD . /opt/src
RUN ls /opt/python/

ENV HDF5_USE_STATIC_LIBRARIES=ON \
ZLIB_USE_STATIC_LIBS=ON \
ADIOS_USE_STATIC_LIBS=ON \
openPMD_BUILD_TESTING=OFF \
openPMD_BUILD_EXAMPLES=OFF
Expand All @@ -103,6 +104,7 @@ RUN cd /opt/src; \
# && /opt/cmake/bin/cmake \
# -DPython_ROOT_DIR=$(which /opt/python/cp${PY_TARGET}-cp${PY_TARGET}m) \
# -DHDF5_USE_STATIC_LIBRARIES=ON \
# -DZLIB_USE_STATIC_LIBS=ON \
# -DBUILD_SHARED_LIBS=OFF \
# -DopenPMD_BUILD_TESTING=OFF \
# -DopenPMD_BUILD_EXAMPLES=OFF \
Expand Down

0 comments on commit 022035a

Please sign in to comment.