Skip to content

Commit 08a5d07

Browse files
Merge pull request #354 from F2I-Consulting/dev
v2.12.0.0
2 parents a3e3015 + 04d4506 commit 08a5d07

40 files changed

Lines changed: 2302 additions & 1141 deletions

.github/workflows/github-actions.yml

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,40 @@ jobs:
166166
with:
167167
name: ubuntu-20.04-${{ matrix.cxx }}
168168
path: ${{ runner.temp }}/fesapi-install
169+
build_wheels_windows:
170+
name: Build wheels on windows-latest
171+
runs-on: windows-latest
172+
steps:
173+
- uses: actions/checkout@v4
174+
- name: Stub `setup.py` check
175+
# It will be generated during CMake run
176+
# https://github.com/pypa/cibuildwheel/issues/1139
177+
run: touch python/setup.py
178+
- name: Build wheels
179+
uses: pypa/cibuildwheel@v2.21.3
180+
env:
181+
CIBW_BUILD: cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64
182+
CIBW_ARCHS: auto64
183+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
184+
CIBW_BEFORE_ALL: >
185+
%VCPKG_INSTALLATION_ROOT%\vcpkg install boost-uuid minizip hdf5[zlib] &&
186+
cd ${{ runner.temp }} &&
187+
mkdir fesapi-build &&
188+
cd fesapi-build &&
189+
cmake -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }} &&
190+
cmake --build . --config Release -j2 &&
191+
cmake --build . --config Release --target INSTALL &&
192+
pip install delvewheel
193+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
194+
delvewheel repair --add-path ${{ runner.temp }}\fesapi-build\Release --namespace-pkg fesapi -w {dest_dir} {wheel}
195+
CIBW_TEST_COMMAND: python ${{github.workspace}}\python\example\example.py
196+
with:
197+
package-dir: ./python
198+
output-dir: wheelhouse
199+
- uses: actions/upload-artifact@v4
200+
with:
201+
name: cibw-wheels-windows
202+
path: ./wheelhouse/*.whl
169203
build_wheels_linux:
170204
name: Build wheels on ubuntu-latest
171205
runs-on: ubuntu-latest
@@ -176,28 +210,20 @@ jobs:
176210
# https://github.com/pypa/cibuildwheel/issues/1139
177211
run: touch python/setup.py
178212
- name: Build wheels
179-
uses: pypa/cibuildwheel@v2.19.2
213+
uses: pypa/cibuildwheel@v2.21.3
180214
env:
181215
CIBW_BUILD: cp38-manylinux_* cp39-manylinux_* cp310-manylinux_* cp311-manylinux_* cp312-manylinux_* cp313-manylinux_*
182216
CIBW_ARCHS: auto64
217+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
183218
CIBW_BEFORE_ALL: >
184-
yum install -y wget minizip-devel gcc-c++ boost-devel &&
219+
yum install -y wget gcc-c++ boost-devel &&
185220
yum search epel-release &&
186221
yum info epel-release &&
187222
yum install -y epel-release &&
188-
yum --enablerepo=epel install -y cmake3 &&
189-
cd / &&
190-
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.3/src/hdf5-1.12.3.tar.gz &&
191-
tar xf hdf5-1.12.3.tar.gz &&
192-
mkdir hdf5-build &&
193-
cd hdf5-build &&
194-
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 &&
195-
cmake3 --build . -j2 --config Release &&
196-
cmake3 --install . &&
197-
cd / &&
223+
yum --enablerepo=epel install -y minizip1.2-devel hdf5-devel cmake3 &&
198224
mkdir build &&
199225
cd build &&
200-
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} &&
226+
cmake3 -DCMAKE_BUILD_TYPE=Release -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX:STRING=/fesapi-install {project} &&
201227
cmake3 --build . -j2 --config Release &&
202228
cmake3 --install .
203229
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
@@ -209,7 +235,7 @@ jobs:
209235
output-dir: wheelhouse
210236
- uses: actions/upload-artifact@v4
211237
with:
212-
name: cibw-wheels-ubuntu-latest
238+
name: cibw-wheels-manylinux_2_28
213239
path: ./wheelhouse/*.whl
214240
build_wheels_mac:
215241
name: Build wheels on macos-14
@@ -221,10 +247,12 @@ jobs:
221247
# https://github.com/pypa/cibuildwheel/issues/1139
222248
run: touch python/setup.py
223249
- name: Build wheels
224-
uses: pypa/cibuildwheel@v2.19.2
250+
uses: pypa/cibuildwheel@v2.21.3
225251
env:
226252
CIBW_BUILD: cp38-macosx_* cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_* cp313-macosx_*
227253
CIBW_ARCHS: auto64
254+
# See https://cibuildwheel.pypa.io/en/stable/cpp_standards/#macos-and-deployment-target-versions
255+
MACOSX_DEPLOYMENT_TARGET: 10.14
228256
CIBW_BEFORE_ALL: >
229257
brew install boost swig &&
230258
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
@@ -256,7 +284,7 @@ jobs:
256284
output-dir: wheelhouse
257285
- uses: actions/upload-artifact@v4
258286
with:
259-
name: cibw-wheels-macos-14
287+
name: cibw-wheels-macosx_arm64
260288
path: ./wheelhouse/*.whl
261289
ubuntu-20-mpi:
262290
runs-on: ubuntu-20.04

CMakeLists.txt

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1212

1313
# version mechanism
1414
set (Fesapi_VERSION_MAJOR 2)
15-
set (Fesapi_VERSION_MINOR 11)
15+
set (Fesapi_VERSION_MINOR 12)
1616
set (Fesapi_VERSION_PATCH 0)
1717
set (Fesapi_VERSION_TWEAK 0)
1818

@@ -31,7 +31,7 @@ IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
3131
ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
3232

3333
if (NOT DEFINED CMAKE_CXX_STANDARD)
34-
set(CMAKE_CXX_STANDARD 11)
34+
set(CMAKE_CXX_STANDARD 17)
3535
endif()
3636
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3737
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -94,33 +94,8 @@ IF (NOT EXISTS ${SZIP_LIBRARY_DEBUG} AND WIN32 AND NOT ${HDF5_BUILT_AS_DYNAMIC_L
9494
MESSAGE(WARNING "The Szip library (SZIP_LIBRARY_DEBUG variable) does not look to be a valid file. Please modify it.")
9595
ENDIF ()
9696

97-
# Boost DEPENDENCY : Uuid (and potentially regex)
98-
unset(CAN_USE_STD_REGEX CACHE)
99-
include(CheckCXXSourceCompiles)
100-
check_cxx_source_compiles(
101-
"#include <iostream>
102-
103-
//https://gcc.gnu.org/develop.html#timeline
104-
int a =
105-
#if !defined(__GLIBCXX__) || __GLIBCXX__ > 20150623 || __GLIBCXX__ == 20140422 || __GLIBCXX__ == 20140716 || __GLIBCXX__ == 20141030
106-
1;
107-
#else
108-
fgsfds;
109-
#endif
110-
111-
int main ()
112-
{
113-
return 0;
114-
115-
}"
116-
117-
CAN_USE_STD_REGEX
118-
)
119-
if (NOT CAN_USE_STD_REGEX)
120-
find_package(Boost 1.44.0 REQUIRED regex) # 1.44 because we want boost::uuids::to_string method
121-
else ()
122-
find_package(Boost 1.44.0 REQUIRED) # 1.44 because we want boost::uuids::to_string method
123-
endif()
97+
# Boost DEPENDENCY
98+
find_package(Boost 1.44.0 REQUIRED) # 1.44 because we want boost::uuids::to_string method
12499

125100
# ============================================================================
126101
# some useful variables

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
- build
88
- fesapi (Git clone this repository into this folder "fesapi". You should then have a path fesapiEnv/fesapi/src)
99
- dependencies
10-
- The following compilers are known to work (used in CI)
11-
- gcc from version 4.8
12-
- visual studio from version 2017
10+
- The following compilers are known to work
11+
- gcc from version 8
12+
- visual studio from version 2019
1313
- clang from version 5.0
1414

1515
# Prepare the dependencies
1616
Download (build and install if necessary) third party libraries:
1717
- HDF5: Versions of 1.8.* (starting from 1.8.18), 1.10.* ([starting from 1.10.2](https://www.hdfgroup.org/2018/04/why-should-i-care-about-the-hdf5-1-10-2-release/)), all 1.12.* and all 1.14.* should be ok. https://support.hdfgroup.org/ftp/HDF5/releases/
1818
- MINIZIP : Version 1.1 is needed : it is the official version included in [current zlib distribution](https://www.zlib.net/) (look into "contrib" folder). You can directly install minizip development package on most of Linux distributions (https://packages.ubuntu.com/xenial/libminizip-dev). On Windows (or older Linux distributions), you can copy the CMakeLists.txt file from fesapi/cmake/minizip to the zlib minizip directory to help you to build minizip (we also provide a copy of minizip 1.1 with cmake files on github : https://github.com/F2I-Consulting/Minizip). It is also highly recommended to link minizip to the same zlib library than the one associated to your HDF5 library.
19-
- BOOST : Starting from version 1.44.0 (and at least 1.67.0 if you don't want to face [valgrid false positives](https://www.boost.org/doc/libs/1_66_0/libs/uuid/doc/uuid.html#Design%20notes)). FYI, on windows, boost uuid depends on bcrypt library.
19+
- BOOST (uuid) : Starting from version 1.44.0 (and at least 1.67.0 if you don't want to face [valgrid false positives](https://www.boost.org/doc/libs/1_66_0/libs/uuid/doc/uuid.html#Design%20notes)). FYI, on windows, boost uuid depends on bcrypt library.
2020

2121
We advise you to install these third party libraries respectively into
2222
- fesapiEnv/dependencies/hdf5-particularVersion

cmake/pyproject.toml.in

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = 'fesapi'
7+
version = '${Fesapi_PYTHON_VERSION}'
8+
authors = [
9+
{name = "F2I-CONSULTING"},
10+
]
11+
maintainers = [
12+
{name = "F2I-CONSULTING"},
13+
]
14+
description = "A library for using the Energistics data standards"
15+
readme = "README.md"
16+
classifiers=[
17+
'Development Status :: 5 - Production/Stable',
18+
'Intended Audience :: Developers',
19+
'License :: OSI Approved :: Apache Software License',
20+
'Operating System :: Microsoft :: Windows',
21+
'Operating System :: POSIX :: Linux',
22+
'Operating System :: MacOS',
23+
'Natural Language :: English',
24+
'Programming Language :: Python :: 3',
25+
'Programming Language :: Python :: 3.8',
26+
'Programming Language :: Python :: 3.9',
27+
'Programming Language :: Python :: 3.10',
28+
'Programming Language :: Python :: 3.11',
29+
'Programming Language :: Python :: 3.12',
30+
'Topic :: Software Development',
31+
'Topic :: Software Development :: Libraries',
32+
'Topic :: Software Development :: Libraries :: Application Frameworks ',
33+
'Topic :: File Formats',
34+
]
35+
keywords = [
36+
"energistics",
37+
"resqml",
38+
"eml",
39+
"witsml",
40+
"prodml",
41+
"osdu",
42+
"rddms",
43+
]
44+
requires-python = ">=3.8"
45+
46+
[project.urls]
47+
source = "https://github.com/F2I-Consulting/fesapi/issues"
48+
releasenotes = "https://github.com/F2I-Consulting/fesapi/releases"
49+
documentation = "https://www.f2i-consulting.com/fesapi/doxygen/"
50+
issues = "https://github.com/F2I-Consulting/fesapi/issues"
51+
52+
[tool.setuptools]
53+
packages=['fesapi']
54+
package-dir={"fesapi" = "fesapi"}
55+
ext-modules = [
56+
{name='fesapi._fesapi', sources=['swigGeneratedPythonWrapper.cpp'], library-dirs=['${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}'], libraries=['${ASSEMBLY_NAME}',], ${EXTRA_COMPILE_ARGS}}
57+
]
58+
59+
[tool.setuptools.package-data]
60+
fesapi = ["*.dll", "*.so", "*.so.*"]

cmake/setup.py.in

Lines changed: 0 additions & 65 deletions
This file was deleted.

example/example.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,26 @@ bool serialize(const string& filePath)
24682468
EML2_NS::AbstractHdfProxy* hdfProxy = repo.createHdfProxy("", "Hdf Proxy", epcDoc.getStorageDirectory(), epcDoc.getName() + ".h5", COMMON_NS::DataObjectRepository::openingMode::OVERWRITE);
24692469
//hdfProxy->setCompressionLevel(6);
24702470

2471-
localTime3dCrs = repo.createLocalTime3dCrs("", "Default local time CRS", 1.0, 0.1, 15, .0, gsoap_resqml2_0_1::eml20__LengthUom::m, 23031, gsoap_resqml2_0_1::eml20__TimeUom::s, gsoap_resqml2_0_1::eml20__LengthUom::m, "Unknown", false); // CRS translation is just for testing;
2471+
localTime3dCrs = repo.createLocalTime3dCrs("", "Default local time CRS", 1.0, 0.1, 15, .0, gsoap_resqml2_0_1::eml20__LengthUom::m,
2472+
"PROJCRS[\"ETRS89 Lambert Azimuthal Equal Area CRS\", BASEGEODCRS[\"ETRS89\","
2473+
"DATUM[\"ETRS89\","
2474+
"ELLIPSOID[\"GRS 80\", 6378137, 298.257222101, LENGTHUNIT[\"metre\", 1.0]]]],"
2475+
"CONVERSION[\"LAEA\","
2476+
"METHOD[\"Lambert Azimuthal Equal Area\", ID[\"EPSG\", 9820]],"
2477+
"PARAMETER[\"Latitude of origin\", 52.0,"
2478+
"ANGLEUNIT[\"degree\", 0.0174532925199433]],"
2479+
"PARAMETER[\"Longitude of origin\", 10.0,"
2480+
"ANGLEUNIT[\"degree\", 0.0174532925199433]],"
2481+
"PARAMETER[\"False easting\", 4321000.0, LENGTHUNIT[\"metre\", 1.0]],"
2482+
"PARAMETER[\"False northing\", 3210000.0, LENGTHUNIT[\"metre\", 1.0]]],"
2483+
"CS[Cartesian, 2],"
2484+
"AXIS[\"(Y)\", north, ORDER[1]],"
2485+
"AXIS[\"(X)\", east, ORDER[2]],"
2486+
"LENGTHUNIT[\"metre\", 1.0],"
2487+
"SCOPE[\"Description of a purpose\"],"
2488+
"AREA[\"An area description\"],"
2489+
"ID[\"EuroGeographics\", \"ETRS-LAEA\"]]",
2490+
gsoap_resqml2_0_1::eml20__TimeUom::s, gsoap_resqml2_0_1::eml20__LengthUom::m, "Unknown", false); // CRS translation is just for testing;
24722491
local3dCrs = repo.createLocalDepth3dCrs("", "Default local CRS", .0, .0, .0, .0, gsoap_resqml2_0_1::eml20__LengthUom::m, 23031, gsoap_resqml2_0_1::eml20__LengthUom::m, "Unknown", false);
24732492
repo.setDefaultCrs(local3dCrs);
24742493

@@ -5114,11 +5133,15 @@ void deserialize(const string & inputFile)
51145133
cout << "Title is : " << crs->getTitle() << endl;
51155134
if (crs->isProjectedCrsDefinedWithEpsg())
51165135
cout << "Projected : EPSG " << crs->getProjectedCrsEpsgCode() << endl;
5136+
else if (crs->isProjectedCrsDefinedWithWkt())
5137+
cout << "Projected : WKT " << crs->getProjectedCrsWkt() << endl;
51175138
else if (crs->isProjectedCrsUnknown())
51185139
cout << "Projected : Unknown." << "Reason is:" << crs->getProjectedCrsUnknownReason() << endl;
51195140

51205141
if (crs->isVerticalCrsDefinedWithEpsg())
51215142
cout << "Vertical : EPSG one" << endl;
5143+
else if (crs->isVerticalCrsDefinedWithWkt())
5144+
cout << "Vertical : WKT " << crs->getVerticalCrsWkt() << endl;
51225145
else if (crs->isVerticalCrsUnknown())
51235146
cout << "Vertical : Unknown." << "Reason is:" << crs->getVerticalCrsUnknownReason() << endl;
51245147

python/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ignore cmake and swig auto generated files
2-
setup.py
2+
pyproject.toml
33
swigGeneratedPythonWrapper.cpp
44
swigGeneratedPythonWrapper.h
55

python/BUILD.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Enable CMake boolean variable SWIG_PYTHON_BUILTIN if you want more performance : read [SWIG documentation](http://swig.org/Doc4.0/SWIGDocumentation.html#Python_nn28) for more information about this "builtin" parameter. The main drawback of using such a parameter is that it will be harder/impossible for your Python IDE to enable autocompletion for your FESAPI python extension. The recommendation is to use SWIG_PYTHON_BUILTIN only in production.
2+
3+
Please disable the SWIG_LINKED_TO_RELEASE cmake variable if you build FESAPI in Debug mode.

python/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ else (WIN32)
2828
endif (WIN32)
2929
configure_file(${CMAKE_SOURCE_DIR}/cmake/swigPythonInclude.i.in ${CMAKE_SOURCE_DIR}/swig/swigPythonInclude.i) # Overwrite if different
3030
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
31-
set (EXTRA_COMPILE_ARGS "extra_compile_args=['/DSWIG_TYPE_TABLE=FESTAPI']")
31+
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI']")
3232
else ()
33-
set (EXTRA_COMPILE_ARGS "extra_compile_args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++11']")
33+
set (EXTRA_COMPILE_ARGS "extra-compile-args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++11']")
3434
endif()
35-
configure_file(${CMAKE_SOURCE_DIR}/cmake/setup.py.in ${CMAKE_SOURCE_DIR}/python/setup.py) # Overwrite if different
35+
configure_file(${CMAKE_SOURCE_DIR}/cmake/pyproject.toml.in ${CMAKE_SOURCE_DIR}/python/pyproject.toml) # Overwrite if different
3636

3737
# SWIG execution
3838
message("Generating SWIG Python files...")

python/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
Enable CMake boolean variable SWIG_PYTHON_BUILTIN if you want more performance : read [SWIG documentation](http://swig.org/Doc4.0/SWIGDocumentation.html#Python_nn28) for more information about this "builtin" parameter. The main drawback of using such a parameter is that it will be harder/impossible for your Python IDE to enable autocompletion for your FESAPI python extension. The recommendation is to use SWIG_PYTHON_BUILTIN only in production.
21

3-
Please disable the SWIG_LINKED_TO_RELEASE cmake variable if you build FESAPI in Debug mode.
2+
**FESAPI** is a library for Energistics data standards (mainly RESQML™)
3+
4+
### Examples
5+
6+
A Python script and a Jupyter Notebook are available [here](https://github.com/F2I-Consulting/fesapi/tree/master/python/example).
7+
8+
### Credits
9+
This software was developed with :
10+
- the gSOAP toolkit from Genivia Inc
11+
- the date library from Howard Hinnant
12+
13+
FESAPI Product incorporates RESQML™, WITSML™ and PRODML™ technology/standards provided by the Energistics Consortium, Inc.
14+
15+
RESQML, WITSML and PRODML are trademarks or registered trademarks of Energistics Consortium, Inc.

0 commit comments

Comments
 (0)