Skip to content

Commit 376c3ea

Browse files
Bump Windows CI against ZLIB1.3.2
Integrate Minizip iowin32 files into code base as they are not installed by official minizip 1.3.2 cmake installer
1 parent 095c779 commit 376c3ea

8 files changed

Lines changed: 587 additions & 39 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
shell: pwsh
1313
run: |
1414
# Download and extract
15-
curl -L "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz" -o "${{ runner.temp }}\zlib.tar.gz"
15+
curl -L "https://github.com/madler/zlib/releases/download/v1.3.2/zlib-1.3.2.tar.gz" -o "${{ runner.temp }}\zlib.tar.gz"
1616
cd ${{ runner.temp }}
1717
tar -xzf zlib.tar.gz
1818
# Detect extracted folder (handles zlib-1.3.1 or future versions)
@@ -22,16 +22,7 @@ jobs:
2222
mkdir zlib-build
2323
cd zlib-build
2424
# Configure and install
25-
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/zlib-install $zlibSrc.FullName
26-
cmake --build . --config Release -j2
27-
cmake --build . --config Release --target INSTALL
28-
- name: Minizip static lib install
29-
run: |
30-
git clone https://github.com/F2I-Consulting/Minizip.git ${{ runner.temp }}/Minizip
31-
cd ${{ runner.temp }}
32-
mkdir minizip-build
33-
cd minizip-build
34-
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBUILD_SHARED_LIBS=FALSE -DZLIB_ROOT=${{ runner.temp }}/zlib-install -DZLIB_USE_STATIC_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/minizip-install ${{ runner.temp }}/Minizip
25+
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DZLIB_BUILD_MINIZIP=ON -DZLIB_BUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/zlib-install $zlibSrc.FullName
3526
cmake --build . --config Release -j2
3627
cmake --build . --config Release --target INSTALL
3728
- name: HDF5 install
@@ -41,7 +32,7 @@ jobs:
4132
Expand-Archive ${{ runner.temp }}\hdf5-2.0.0.zip -DestinationPath ${{ runner.temp }}
4233
mkdir hdf5-build
4334
cd hdf5-build
44-
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON -DZLIB_ROOT:PATH=${{ runner.temp }}/zlib-install -DZLIB_INCLUDE_DIR:PATH=${{ runner.temp }}/zlib-install/include -DZLIB_LIBRARY:PATH=${{ runner.temp }}/zlib-install/lib/zlibstatic.lib -DBUILD_SHARED_LIBS:BOOL=OFF -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/hdf5-install ${{ runner.temp }}/hdf5-2.0.0
35+
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON -DZLIB_ROOT:PATH=${{ runner.temp }}/zlib-install -DZLIB_INCLUDE_DIR:PATH=${{ runner.temp }}/zlib-install/include -DZLIB_LIBRARY:PATH=${{ runner.temp }}/zlib-install/lib/zs.lib -DBUILD_SHARED_LIBS:BOOL=OFF -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/hdf5-install ${{ runner.temp }}/hdf5-2.0.0
4536
cmake --build . --config Release -j2
4637
cmake --build . --config Release --target INSTALL
4738
- name: Boost install
@@ -57,7 +48,7 @@ jobs:
5748
cd ${{ github.workspace }}/..
5849
mkdir build
5950
cd build
60-
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}/hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DMINIZIP_ROOT=${{ runner.temp }}/minizip-install -DZLIB_ROOT=${{ runner.temp }}/zlib-install -DZLIB_USE_STATIC_LIBS=TRUE -DBoost_INCLUDE_DIR=${{ runner.temp }}/boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_DOTNET_WRAPPING=TRUE -DSWIG_EXECUTABLE=${{ runner.temp }}/swigwin-4.4.1/swig.exe -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
51+
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}/hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DMINIZIP_ROOT=${{ runner.temp }}/zlib-install -DMINIZIP_USE_STATIC_LIBS=TRUE -DZLIB_ROOT=${{ runner.temp }}/zlib-install -DZLIB_USE_STATIC_LIBS=TRUE -DBoost_INCLUDE_DIR=${{ runner.temp }}/boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_DOTNET_WRAPPING=TRUE -DSWIG_EXECUTABLE=${{ runner.temp }}/swigwin-4.4.1/swig.exe -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
6152
cmake --build . --config Release -j2
6253
cmake --build . --config Release --target INSTALL
6354
- name: Add msbuild to PATH
@@ -179,27 +170,33 @@ jobs:
179170
CIBW_BUILD: cp38-manylinux_* cp39-manylinux_* cp310-manylinux_* cp311-manylinux_* cp312-manylinux_* cp313-manylinux_*
180171
CIBW_ARCHS: auto64
181172
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
182-
CIBW_BEFORE_ALL: >
183-
yum install -y wget gcc-c++ boost-devel &&
184-
yum search epel-release &&
185-
yum info epel-release &&
186-
yum install -y epel-release &&
187-
yum --enablerepo=epel install -y minizip1.2-devel cmake3 &&
188-
wget --no-verbose https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/hdf5-2.0.0.tar.gz &&
189-
tar -xzf hdf5-2.0.0.tar.gz &&
190-
cd hdf5-2.0.0 &&
191-
mkdir build &&
192-
cd build &&
193-
cmake -G "Unix Makefiles" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../hdf5-install .. &&
194-
cmake --build . --config Release &&
195-
make -j4 &&
196-
make install &&
197-
cd ../.. &&
198-
mkdir build &&
199-
cd build &&
200-
cmake3 -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT=${{ github.workspace }}/../hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
201-
cmake3 --build . -j2 --config Release &&
202-
cmake3 --install .
173+
CIBW_BEFORE_ALL: |
174+
yum remove cmake
175+
yum install -y wget gcc-c++ boost-devel
176+
yum search epel-release
177+
yum info epel-release
178+
yum install -y epel-release
179+
yum --enablerepo=epel install -y minizip1.2-devel
180+
cd ${{ github.workspace }}/..
181+
wget --no-verbose https://github.com/Kitware/CMake/releases/download/v4.3.2/cmake-4.3.2-linux-x86_64.tar.gz
182+
tar -xzf cmake-4.3.2-linux-x86_64.tar.gz
183+
export PATH=${{ github.workspace }}/../cmake-4.3.2-linux-x86_64/bin:$PATH
184+
cmake --version # Should cmake version
185+
wget --no-verbose https://support.hdfgroup.org/releases/hdf5/v2_0/v2_0_0/downloads/hdf5-2.0.0.tar.gz
186+
tar -xzf hdf5-2.0.0.tar.gz
187+
cd hdf5-2.0.0
188+
mkdir build
189+
cd build
190+
cmake -G "Unix Makefiles" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DHDF5_ENABLE_ZLIB_SUPPORT:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_GENERATORS:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_UTILS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../hdf5-install ..
191+
cmake --build . --config Release
192+
make -j4
193+
make install
194+
cd ../..
195+
mkdir build
196+
cd build
197+
cmake -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT=${{ github.workspace }}/../hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project}
198+
cmake --build . -j2 --config Release
199+
cmake --install .
203200
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
204201
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/fesapi-install/lib64 &&
205202
auditwheel repair -w {dest_dir} {wheel}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ FESAPI uses cmake as its build tool. A 3.12 version or later of cmake is require
3535
- ONLY IF YOU WANT TO LINK TO PARALLEL HDF5, set a cmake variable called HDF5_PREFER_PARALLEL to ON (and give a look to [example/exampleMPI.cpp](./example/exampleMPI.cpp))
3636
- MINIZIP (using [our own cmake find module](./cmake/modules/FindMINIZIP.cmake))
3737
- (ONLY IF NOT AUTOMATICALLY FOUND) MINIZIP_ROOT : The path to the folder containing include and lib folders of MINIZIP
38+
- ONLY IF YOU WANT TO STATICALLY LINK TO MINIZIP, set a cmake variable called MINIZIP_USE_STATIC_LIBS to ON
3839
- ZLIB (using [cmake find module](https://cmake.org/cmake/help/latest/module/FindZLIB.html))
3940
- (ONLY IF NOT AUTOMATICALLY FOUND) ZLIB_ROOT : The path to the folder containing include and lib folders of ZLIB
4041
- ONLY IF YOU WANT TO STATICALLY LINK TO ZLIB, set a cmake variable called ZLIB_USE_STATIC_LIBS to ON

cmake/modules/FindMINIZIP.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ set(_MINIZIP_SEARCH_NORMAL
4848
unset(_MINIZIP_x86)
4949
list(APPEND _MINIZIP_SEARCHES _MINIZIP_SEARCH_NORMAL)
5050

51-
set(MINIZIP_NAMES minizip minizips)
52-
set(MINIZIP_NAMES_DEBUG minizipd minizipsd minizip_d)
51+
if(MINIZIP_USE_STATIC_LIBS)
52+
set(MINIZIP_NAMES minizips minizip)
53+
set(MINIZIP_NAMES_DEBUG minizipsd minizipd minizip_d)
54+
else()
55+
set(MINIZIP_NAMES minizip)
56+
set(MINIZIP_NAMES_DEBUG minizipd minizip_d)
57+
endif()
5358

5459
# Try each search configuration.
5560
foreach(search ${_MINIZIP_SEARCHES})

src/epc/Package.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ under the License.
3737
#include <zip.h>
3838
#include <unzip.h>
3939
#ifdef _WIN32
40-
#include <iowin32.h>
40+
#include "../tools/iowin32.h"
4141
#endif
4242

4343
#include "FilePart.h"

src/tools/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

2-
set(FESAPI_TOOLS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tools/TimeTools.cpp )
2+
set(FESAPI_TOOLS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tools/TimeTools.cpp
3+
$<$<BOOL:${WIN32}>:${CMAKE_CURRENT_SOURCE_DIR}/tools/iowin32.c> )
34
set(FESAPI_TOOLS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/tools/date.h
45
${CMAKE_CURRENT_SOURCE_DIR}/tools/Statistics.h
56
${CMAKE_CURRENT_SOURCE_DIR}/tools/TimeTools.h
6-
${CMAKE_CURRENT_SOURCE_DIR}/tools/Trigonometry.h )
7+
${CMAKE_CURRENT_SOURCE_DIR}/tools/Trigonometry.h
8+
$<$<BOOL:${WIN32}>:${CMAKE_CURRENT_SOURCE_DIR}/tools/iowin32.h> )

src/tools/MiniZip64_info.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
MiniZip - Copyright (c) 1998-2026 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson
2+
3+
Introduction
4+
---------------------
5+
MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( https://www.winimage.com/zLibDll/minizip.html )
6+
7+
When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0.
8+
All possible work was done for compatibility.
9+
10+
11+
Background
12+
---------------------
13+
When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64
14+
support for unzip.c into minizip for a open source project called gdal ( https://www.gdal.org/ )
15+
16+
That was used as a starting point. And after that ZIP64 support was added to zip.c
17+
some refactoring and code cleanup was also done.
18+
19+
20+
Changed from MiniZip 1.0 to MiniZip 1.1
21+
---------------------------------------
22+
* Added ZIP64 support for unzip ( by Even Rouault )
23+
* Added ZIP64 support for zip ( by Mathias Svensson )
24+
* Reverted some changed that Even Rouault did.
25+
* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users.
26+
* Added unzip patch for BZIP Compression method (patch create by Daniel Borca)
27+
* Added BZIP Compress method for zip
28+
* Did some refactoring and code cleanup
29+
30+
31+
Credits
32+
33+
Gilles Vollant - Original MiniZip author
34+
Even Rouault - ZIP64 unzip Support
35+
Daniel Borca - BZip Compression method support in unzip
36+
Mathias Svensson - ZIP64 zip support
37+
Mathias Svensson - BZip Compression method support in zip
38+
39+
Resource
40+
41+
ZIP App Note https://www.pkware.com/documents/casestudies/APPNOTE.TXT
42+
Zip File specification
43+
44+
45+
Notes.
46+
* To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined.
47+
48+
License
49+
----------------------------------------------------------
50+
Condition of use and distribution are the same than zlib :
51+
52+
This software is provided 'as-is', without any express or implied
53+
warranty. In no event will the authors be held liable for any damages
54+
arising from the use of this software.
55+
56+
Permission is granted to anyone to use this software for any purpose,
57+
including commercial applications, and to alter it and redistribute it
58+
freely, subject to the following restrictions:
59+
60+
1. The origin of this software must not be misrepresented; you must not
61+
claim that you wrote the original software. If you use this software
62+
in a product, an acknowledgment in the product documentation would be
63+
appreciated but is not required.
64+
2. Altered source versions must be plainly marked as such, and must not be
65+
misrepresented as being the original software.
66+
3. This notice may not be removed or altered from any source distribution.
67+
68+
----------------------------------------------------------
69+

0 commit comments

Comments
 (0)