Skip to content

Commit

Permalink
Merge pull request #349 from F2I-Consulting/dev
Browse files Browse the repository at this point in the history
v2.10.0.0
  • Loading branch information
philippeVerney authored Aug 29, 2024
2 parents 0475d33 + 558df97 commit 713cef8
Show file tree
Hide file tree
Showing 220 changed files with 49,701 additions and 62,028 deletions.
114 changes: 68 additions & 46 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
cmake --build . --config Release --target INSTALL
- name: Boost install
run: |
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/boost/files/boost-binaries/1.78.0//boost_1_78_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
(New-Object System.Net.WebClient).DownloadFile("https://sourceforge.net/projects/boost/files/boost-binaries/1.85.0/boost_1_85_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
- name: CMake build and install
run: |
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DMINIZIP_ROOT=${{ runner.temp }}/minizip-install -DZLIB_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DSZIP_LIBRARY_RELEASE=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16/lib/szip.lib -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE ${{ github.workspace }}
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DMINIZIP_ROOT=${{ runner.temp }}/minizip-install -DZLIB_ROOT=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16 -DSZIP_LIBRARY_RELEASE=${{ runner.temp }}\hdf5-1.12.0-Std-win10_64-vs16/lib/szip.lib -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Copy hdf5 dll
Expand All @@ -41,6 +41,10 @@ jobs:
- name: Run Cpp example
run: |
${{ github.workspace }}\..\build\Release\example.exe
- uses: actions/upload-artifact@v4
with:
name: windows-2019
path: ${{ runner.temp }}/fesapi-install
windows-2019-staticLink-cs:
runs-on: windows-2019
steps:
Expand All @@ -52,7 +56,7 @@ jobs:
tar -xzf ${{ runner.temp }}\zlib.tar.gz
mkdir zlib-build
cd zlib-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/zlib-install ${{ runner.temp }}/zlib-1.3
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/zlib-install ${{ runner.temp }}/zlib-1.3.1
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Minizip static lib install
Expand Down Expand Up @@ -87,11 +91,11 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -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 }}\hdf5-1.12.0-Std-win10_64-vs16\include -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.2.0/swig.exe ${{ github.workspace }}
cmake -G"Visual Studio 16 2019" -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.2.0/swig.exe -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . --config Release -j2
cmake --build . --config Release --target INSTALL
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Build the C# example
Expand All @@ -105,7 +109,7 @@ jobs:
- name: Run C# example
run: |
${{ github.workspace }}\cs\example\bin\x64\Release\example.exe
ubuntu-20-java8:
ubuntu-20-java11:
runs-on: ubuntu-20.04
strategy:
fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix failed.
Expand All @@ -119,15 +123,15 @@ jobs:
# { xcc_name: 'clang 12', xcc_pkg: clang-12, cc: clang, cxx: clang++ },
]
env:
XCC: $${{ matrix.xcc_name }} # Set environment variables
XCC: $${{ matrix.xcc_name }}
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'
java-version: '11'
- name: APT install
run: |
sudo apt update
Expand All @@ -150,48 +154,66 @@ jobs:
cd ..
mkdir build
cd build
cmake -DHDF5_ROOT=${{ runner.temp }}/install-hdf5-1.12.2 -DHDF5_USE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -D CMAKE_C_COMPILER=${{ matrix.cc }} -D CMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake -DHDF5_ROOT=${{ runner.temp }}/install-hdf5-1.12.2 -DHDF5_USE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install
cmake --build . -j2
cmake --install .
- name: Run java example
run: |
cd ${{ github.workspace }}/java/src
javac -cp `find ${{ github.workspace }}/../build/install -name fesapiJava*.jar` com/f2i_consulting/example/FesapiJavaExample.java
java -Djava.library.path=${{ github.workspace }}/../build/install/lib -cp `find ${{ github.workspace }}/../build/install -name fesapiJava*.jar`:. com.f2i_consulting.example.FesapiJavaExample
ubuntu-20-python3:
runs-on: ubuntu-20.04
javac -cp `find ${{ runner.temp }}/fesapi-install -name fesapiJava*.jar` com/f2i_consulting/example/FesapiJavaExample.java
java -Djava.library.path=${{ runner.temp }}/fesapi-install/lib -cp `find ${{ runner.temp }}/fesapi-install -name fesapiJava*.jar`:. com.f2i_consulting.example.FesapiJavaExample
- uses: actions/upload-artifact@v4
with:
name: ubuntu-20.04-${{ matrix.cxx }}
path: ${{ runner.temp }}/fesapi-install
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: APT install
run: |
sudo apt update
sudo apt install -y libminizip-dev libboost-all-dev
# Build HDF5 instead of downloading the package because the package is not built with -fPIC causing relocation issue.
- name: HDF5 build and install
run: |
cd ${{ runner.temp }}
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.0/src/hdf5-1.14.0.tar.gz
tar -xzf hdf5-1.14.0.tar.gz
cd hdf5-1.14.0
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DCMAKE_INSTALL_PREFIX:STRING=${{ runner.temp }}/install-hdf5-1.14.0 ..
cmake --build . --config Release
make -j4
make install
- name: CMake build and install
run: |
cd ..
mkdir build
cd build
cmake -DHDF5_ROOT=${{ runner.temp }}/install-hdf5-1.14.0 -DHDF5_USE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON_WRAPPING=TRUE ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run Python example
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/../build/install/lib
pip3 install ${{ github.workspace }}/python/dist/*.whl
python3 ${{ github.workspace }}/python/example/example.py
- name: Stub `setup.py` check
# It will be generated during CMake run
# https://github.com/pypa/cibuildwheel/issues/1139
run: touch python/setup.py
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: cp38-manylinux_* cp39-manylinux_* cp310-manylinux_* cp311-manylinux_* cp312-manylinux_* cp313-manylinux_*
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL: >
yum install -y wget minizip-devel gcc-c++ boost-devel &&
yum search epel-release &&
yum info epel-release &&
yum install -y epel-release &&
yum --enablerepo=epel install -y cmake3 &&
cd / &&
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.3/src/hdf5-1.12.3.tar.gz &&
tar xf hdf5-1.12.3.tar.gz &&
mkdir hdf5-build &&
cd hdf5-build &&
cmake3 -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DHDF5_BUILD_TOOLS:BOOL=OFF -DHDF5_BUILD_EXAMPLES:BOOL=OFF -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_HL_LIB:BOOL=OFF -DCMAKE_INSTALL_PREFIX:STRING=/hdf5-install ../hdf5-1.12.3 &&
cmake3 --build . -j2 --config Release &&
cmake3 --install . &&
cd / &&
mkdir build &&
cd build &&
cmake3 -DCMAKE_BUILD_TYPE=Release -DHDF5_ROOT=/hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
cmake3 --build . -j2 --config Release &&
cmake3 --install .
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/fesapi-install/lib64 &&
auditwheel repair -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python {project}/python/example/example.py
with:
package-dir: ./python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
ubuntu-20-mpi:
runs-on: ubuntu-20.04
steps:
Expand All @@ -208,11 +230,11 @@ jobs:
cd ${{ runner.temp }}
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_C_COMPILER=mpicc -DHDF5_PREFER_PARALLEL:BOOL=TRUE -DWITH_EXAMPLE:BOOL=TRUE ${{ github.workspace }}
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_C_COMPILER=mpicc -DHDF5_PREFER_PARALLEL:BOOL=TRUE -DWITH_EXAMPLE:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run example
run: mpiexec -n 2 ${{ runner.temp }}/build/install/example
run: mpiexec -n 2 ${{ runner.temp }}/fesapi-install/example
ubuntu-20-valgrind-unitTest:
runs-on: ubuntu-20.04
steps:
Expand All @@ -226,7 +248,7 @@ jobs:
cd ..
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE ${{ github.workspace }}
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_EXAMPLE=TRUE -DWITH_RESQML2_2=TRUE -DWITH_TEST=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }}
cmake --build . -j2
cmake --install .
- name: Run Valgrind on example
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/release.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Actions to run when releasing

on:
release:
types: [published]

env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_REF_NAME: ${{ github.ref_name }}

jobs:
# Remark : https://github.com/orgs/community/discussions/46034
add-checksum:
runs-on: ubuntu-latest
steps:
# It is necessary to checkout the repository for GitHub CLI to know which repository to target
- name: Checkout repository
uses: actions/checkout@v4
- name: ZIP checksum
run: |
gh release download --archive=zip
shasum -a 256 *.zip > fesapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
gh release upload ${{ github.ref_name }} fesapi-${GITHUB_REF_NAME#v}.zip.sha256.txt
- name: TAR.GZ checksum
run: |
gh release download --archive=tar.gz
shasum -a 256 *.tar.gz > fesapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
gh release upload ${{ github.ref_name }} fesapi-${GITHUB_REF_NAME#v}.tar.gz.sha256.txt
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
/cs/example/Program.cs
/cs/example/HdfProxyFactoryExample.cs
/cs/example/HdfProxyExample.cs
/cs/EtpClientExample/EtpClientExample.cs
/cs/EtpClientExample/MyOwnClientCoreHandlers.cs
/cs/EtpClientExample/MyOwnDiscoveryProtocolHandlers.cs
/cs/EtpClientExample/MyOwnStoreProtocolHandlers.cs
/swig/swigCsInclude.i
/swig/swigJavaInclude.i
/swig/swigPythonInclude.i
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

# version mechanism
set (Fesapi_VERSION_MAJOR 2)
set (Fesapi_VERSION_MINOR 9)
set (Fesapi_VERSION_MINOR 10)
set (Fesapi_VERSION_PATCH 0)
set (Fesapi_VERSION_TWEAK 1)
set (Fesapi_VERSION_TWEAK 0)

set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK})

Expand Down Expand Up @@ -140,6 +140,7 @@ list(APPEND FESAPI_PROXIES_SOURCES
${FESAPI_ROOT_DIR}/src/proxies/envC.cpp
${FESAPI_ROOT_DIR}/src/proxies/gsoap_resqml2_0_1C.cpp
${FESAPI_ROOT_DIR}/src/proxies/gsoap_eml2_3C.cpp
${FESAPI_ROOT_DIR}/src/proxies/gsoap_uom1_0C.cpp
${FESAPI_ROOT_DIR}/src/proxies/namespace.cpp
${FESAPI_ROOT_DIR}/src/proxies/stdsoap2.cpp
${FESAPI_ROOT_DIR}/src/proxies/struct_tm.cpp
Expand All @@ -151,6 +152,8 @@ list(APPEND FESAPI_PROXIES_HEADERS
${FESAPI_ROOT_DIR}/src/proxies/gsoap_resqml2_0_1Stub.h
${FESAPI_ROOT_DIR}/src/proxies/gsoap_eml2_3H.h
${FESAPI_ROOT_DIR}/src/proxies/gsoap_eml2_3Stub.h
${FESAPI_ROOT_DIR}/src/proxies/gsoap_uom1_0H.h
${FESAPI_ROOT_DIR}/src/proxies/gsoap_uom1_0Stub.h
${FESAPI_ROOT_DIR}/src/proxies/stdsoap2.h
)

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# If you just want some precompiled binaries (just to test for example)
- Please first look in the [assets](https://github.com/F2I-Consulting/fesapi/releases) of the releases if it as already provided
- Please first check in the [assets](https://github.com/F2I-Consulting/fesapi/releases) of the releases if your version has already been provided? For a Python version, just look at [PyPI](https://pypi.org/project/fesapi/).
- If not, create an [issue](https://github.com/F2I-Consulting/fesapi/issues/new?assignees=&labels=&projects=&template=feature_request.md) and ask for the version you would want.
# Prepare your build environment
- Create a folder called fesapiEnv.
Expand All @@ -23,7 +23,7 @@ We advise you to install these third party libraries respectively into
- fesapiEnv/dependencies/minizip-particularVersion
- fesapiEnv/dependencies/boost-particularVersion
# Configure the build
Fesapi uses cmake as its build tool. A 3.12 version or later of cmake is required https://cmake.org/download/. We also recommend using cmake-gui (already included in the bin folder of the binary releases of cmake) which provides a graphical user interface on top of cmake. If you want to use cmake in command line, you would find example in [Azure Pipeline file](./azure-pipelines.yml). Follow the below instructions :
FESAPI uses cmake as its build tool. A 3.12 version or later of cmake is required https://cmake.org/download/. We also recommend using cmake-gui (already included in the bin folder of the binary releases of cmake) which provides a graphical user interface on top of cmake. If you want to use cmake in command line, you would find example in [GitHub Actions file](./.github/workflows/github-actions.yml). Follow the below instructions :

- yourPath/fesapiEnv/fesapi defines where is the source code folder
- yourPath/fesapiEnv/build/theNameYouWant defines where to build the binaries
Expand Down Expand Up @@ -59,15 +59,14 @@ As a first way to start, we advise people to look at examples provided with FESA
- C++ : [in example/example.cpp](./example/example.cpp)
- C# : in cs/example/example.sln (Program.cs will be generated by cmake configuration when WITH_DOTNET_WRAPPING is ON, the source file is initially located [in cmake/Program.cs](./cmake/Program.cs))
- Java (JDK 1.5 and later) : in java/src/com/f2i_consulting/example/FesapiJavaExample.java (FesapiJavaExample.java will be generated by cmake configuration when WITH_JAVA_WRAPPING is ON, the source file is initially located [in cmake/FesapiJavaExample.java](./cmake/FesapiJavaExample.java))
- Python3 (no support for Python2) : [in python/example/example.py](./python/example/example.py) (please follow instructions in the documentation header of this example python file)
- Python3 (no support for Python2) : [in python/example/example.py](./python/example/example.py) or as a jupyter notebook [in python/example/fesapi.ipynb](./python/example/fesapi.ipynb)

You can also find Doxygen generated documentation [here](https://f2i-consulting.com/fesapi/doxygen/)

# Testing
This software was tested with :
- Catch2 from [Catch Org](https://github.com/catchorg/Catch2)
- [GitHub actions](https://github.com/features/actions)
- [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/)
- [GitHub Actions](https://github.com/features/actions)

# Credits
This software was developed with :
Expand Down
4 changes: 4 additions & 0 deletions cmake/FesapiCppConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include(CMakeFindDependencyMacro)

# Include the actual targets
include("${CMAKE_CURRENT_LIST_DIR}/FesapiCppTargets.cmake")
Loading

0 comments on commit 713cef8

Please sign in to comment.