Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.11.0.0 #351

Merged
merged 16 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 62 additions & 18 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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.85.0/boost_1_85_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
(New-Object System.Net.WebClient).DownloadFile("https://boostorg.jfrog.io/artifactory/main/release/1.86.0/binaries/boost_1_86_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: |
Expand Down Expand Up @@ -70,28 +70,28 @@ jobs:
cmake --build . --config Release --target INSTALL
- name: HDF5 install
run: |
Invoke-WebRequest https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.3/src/hdf5-1.14.3.zip -OutFile ${{ runner.temp }}\hdf5-1.14.3.zip
Invoke-WebRequest https://support.hdfgroup.org/releases/hdf5/v1_14/v1_14_5/downloads/hdf5-1.14.5.zip -OutFile ${{ runner.temp }}\hdf5-1.14.5.zip
cd ${{ runner.temp }}
Expand-Archive ${{ runner.temp }}\hdf5-1.14.3.zip -DestinationPath ${{ runner.temp }}
Expand-Archive ${{ runner.temp }}\hdf5-1.14.5.zip -DestinationPath ${{ runner.temp }}
mkdir hdf5-build
cd hdf5-build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH=${{ runner.temp }}/zlib-install/include -DZLIB_LIBRARY:PATH=${{ runner.temp }}/zlib-install/lib/zlibstatic.lib -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-1.14.3
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH=${{ runner.temp }}/zlib-install/include -DZLIB_LIBRARY:PATH=${{ runner.temp }}/zlib-install/lib/zlibstatic.lib -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-1.14.5
cmake --build . --config Release -j2
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.84.0//boost_1_84_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
(New-Object System.Net.WebClient).DownloadFile("https://boostorg.jfrog.io/artifactory/main/release/1.86.0/binaries/boost_1_86_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: Swig install
run: |
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.2.0.zip", "${{ runner.temp }}\swigwin-4.2.0.zip")
7z x ${{ runner.temp }}\swigwin-4.2.0.zip -o${{ runner.temp }}
(New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.3.0.zip", "${{ runner.temp }}\swigwin-4.3.0.zip")
7z x ${{ runner.temp }}\swigwin-4.3.0.zip -o${{ runner.temp }}
- 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-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 -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.3.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
Expand Down Expand Up @@ -166,12 +166,9 @@ jobs:
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]
build_wheels_linux:
name: Build wheels on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Stub `setup.py` check
Expand Down Expand Up @@ -212,7 +209,54 @@ jobs:
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
name: cibw-wheels-ubuntu-latest
path: ./wheelhouse/*.whl
build_wheels_mac:
name: Build wheels on macos-14
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- 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/[email protected]
env:
CIBW_BUILD: cp38-macosx_* cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_* cp313-macosx_*
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL: >
brew install boost swig &&
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
cd ${{ github.workspace }}/.. &&
mkdir minizip-build &&
cd minizip-build &&
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/../minizip-install ${{ github.workspace }}/../minizip &&
cmake --build . -j2 --config Release &&
cmake --install . &&
cd ${{ github.workspace }}/.. &&
wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_1.14.5/hdf5-1.14.5.tar.gz &&
tar xf hdf5-1.14.5.tar.gz &&
mkdir hdf5-build &&
cd hdf5-build &&
cmake -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=${{ github.workspace }}/../hdf5-install ../hdf5-1.14.5 &&
cmake --build . -j2 --config Release &&
cmake --install . &&
mkdir ${{ github.workspace }}/../build &&
cd ${{ github.workspace }}/../build &&
cmake -DCMAKE_BUILD_TYPE=Release -DMINIZIP_ROOT=${{ github.workspace }}/../minizip-install -DHDF5_ROOT=${{ github.workspace }}/../hdf5-install -DHDF5_USE_STATIC_LIBRARIES=TRUE -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=${{ github.workspace }}/../fesapi-install ${{ github.workspace }} &&
cmake --build . -j2 --config Release &&
cmake --install .
# See https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=${{ github.workspace }}/../fesapi-install/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
CIBW_TEST_COMMAND: python ${{ github.workspace }}/python/example/example.py
with:
package-dir: ./python
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-macos-14
path: ./wheelhouse/*.whl
ubuntu-20-mpi:
runs-on: ubuntu-20.04
Expand All @@ -235,8 +279,8 @@ jobs:
cmake --install .
- name: Run example
run: mpiexec -n 2 ${{ runner.temp }}/fesapi-install/example
ubuntu-20-valgrind-unitTest:
runs-on: ubuntu-20.04
ubuntu-latest-valgrind-unitTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: APT install
Expand All @@ -249,7 +293,7 @@ jobs:
mkdir build
cd build
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 --build . -j2 --config Debug
cmake --install .
- name: Run Valgrind on example
run: |
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

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

set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK})
Expand All @@ -30,7 +30,9 @@ IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX ${FESAPI_BINARY_DIR}/install CACHE PATH "FesapiCpp install prefix" FORCE)
ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(CMAKE_CXX_STANDARD 11)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ setup (name = 'fesapi',

### Examples

A Python script and a Jupyter Notebook are available [here](https://github.com/F2I-Consulting/fesapi/tree/dev/python/example).
A Python script and a Jupyter Notebook are available [here](https://github.com/F2I-Consulting/fesapi/tree/master/python/example).

### Credits
This software was developed with :
Expand Down
49 changes: 27 additions & 22 deletions cmake/swigPythonInclude.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ namespace COMMON_NS
swig_type_info * const outtype = [&] {
if (result != nullptr)
{
const std::string cppNs = [&] {
const std::string xmlTag = result->getXmlTag();
if (xmlTag == "EpcExternalPartReference") {
return SWIG_TypeQuery("eml2::EpcExternalPartReference *");
}
const std::string cppNs = [&result] {
const std::string xmlNs(result->getXmlNamespace());
if (xmlNs == "eml20") return "${FESAPI_EML2_0_NS}";
else if (xmlNs == "eml23") return "${FESAPI_EML2_3_NS}";
else if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
else if (xmlNs == "resqml22") return "${FESAPI_RESQML2_2_NS}";
else if (xmlNs == "witsml21") return "${FESAPI_WITSML2_1_NS}";
else if (xmlNs == "prodml22") return "${FESAPI_PRODML2_2_NS}";
else if (xmlNs == "eml23") return "${FESAPI_EML2_3_NS}";
}();

// Check potential downcasting
return SWIG_TypeQuery((cppNs + "::" + result->getXmlTag() + " *").c_str());
return SWIG_TypeQuery((cppNs + "::" + xmlTag + " *").c_str());
}
else {
return $descriptor;
Expand All @@ -49,22 +52,32 @@ namespace COMMON_NS

namespace EML2_NS
{
%typemap(out) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*
%typemap(out) EpcExternalPartReference*
{
swig_type_info * const outtype = [&] {
return result != nullptr
? SWIG_TypeQuery("eml2::EpcExternalPartReference *")
: $descriptor;
}();

resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), outtype, 0);
}

%typemap(out) Activity*, ActivityTemplate*, PropertyKind*, TimeSeries*
#ifdef WITH_RESQML2_2
,GraphicalInformationSet*
#endif
{
swig_type_info * const outtype = [&] {
if (result != nullptr)
{
const std::string cppNs = [&] {
const std::string cppNs = [&result] {
const std::string xmlNs(result->getXmlNamespace());
if (xmlNs == "eml20") return "${FESAPI_EML2_0_NS}";
else if (xmlNs == "eml23") return "${FESAPI_EML2_3_NS}";
else if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
else if (xmlNs == "resqml22") return "${FESAPI_RESQML2_2_NS}";
else if (xmlNs == "witsml21") return "${FESAPI_WITSML2_1_NS}";
else if (xmlNs == "prodml22") return "${FESAPI_PRODML2_2_NS}";
else if (xmlNs == "eml23") return "${FESAPI_EML2_3_NS}";
}();

// Check potential downcasting
Expand All @@ -80,7 +93,7 @@ namespace EML2_NS
}

namespace RESQML2_NS
{
{
%typemap(out) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractLocal3dCrs*,
AbstractProperty*, AbstractValuesProperty*,
AbstractStratigraphicOrganizationInterpretation*,
Expand Down Expand Up @@ -155,14 +168,10 @@ namespace RESQML2_NS
swig_type_info * const outtype = [&] {
if (result != nullptr)
{
const std::string cppNs = [&] {
const std::string cppNs = [&result] {
const std::string xmlNs(result->getXmlNamespace());
if (xmlNs == "eml20") return "${FESAPI_EML2_0_NS}";
else if (xmlNs == "eml23") return "${FESAPI_EML2_3_NS}";
else if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
if (xmlNs == "resqml20") return "${FESAPI_RESQML2_0_1_NS}";
else if (xmlNs == "resqml22") return "${FESAPI_RESQML2_2_NS}";
else if (xmlNs == "witsml21") return "${FESAPI_WITSML2_1_NS}";
else if (xmlNs == "prodml22") return "${FESAPI_PRODML2_2_NS}";
}();

// Check potential downcasting
Expand All @@ -186,12 +195,8 @@ namespace RESQML2_NS
{
std::string cppNs;
const std::string xmlNs(result->getXmlNamespace());
if (xmlNs == "eml20") cppNs = "${FESAPI_EML2_0_NS}";
else if (xmlNs == "eml23") cppNs = "${FESAPI_EML2_3_NS}";
else if (xmlNs == "resqml20") cppNs = "${FESAPI_RESQML2_0_1_NS}";
if (xmlNs == "resqml20") cppNs = "${FESAPI_RESQML2_0_1_NS}";
else if (xmlNs == "resqml22") cppNs = "${FESAPI_RESQML2_2_NS}";
else if (xmlNs == "witsml21") cppNs = "${FESAPI_WITSML2_1_NS}";
else if (xmlNs == "prodml22") cppNs = "${FESAPI_PRODML2_2_NS}";

std::string cppClass;
auto geomKind = result->getGeometryKind();
Expand Down
6 changes: 3 additions & 3 deletions cs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ set (EXECUTE_COMMAND "${SWIG_EXECUTABLE}")
if (WITH_RESQML2_2)
list (APPEND EXECUTE_COMMAND -DWITH_RESQML2_2)
endif (WITH_RESQML2_2)
if (UNIX)
if (UNIX AND NOT APPLE)
list (APPEND EXECUTE_COMMAND -DSWIGWORDSIZE64)
endif (UNIX)
endif (UNIX AND NOT APPLE)
list (APPEND EXECUTE_COMMAND -v)
list (APPEND EXECUTE_COMMAND -c++)
list (APPEND EXECUTE_COMMAND -csharp)
list (APPEND EXECUTE_COMMAND -dllimport)
list (APPEND EXECUTE_COMMAND ${CPP_LIBRARY_NAME}${CMAKE_RELEASE_POSTFIX}.${Fesapi_VERSION}.dll)
list (APPEND EXECUTE_COMMAND ${CPP_LIBRARY_NAME}${CMAKE_RELEASE_POSTFIX}-${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.dll)
list (APPEND EXECUTE_COMMAND -namespace)
list (APPEND EXECUTE_COMMAND F2iConsulting.Fesapi)
list (APPEND EXECUTE_COMMAND -o)
Expand Down
Loading
Loading