Skip to content

Commit f2099a5

Browse files
Merge pull request #355 from F2I-Consulting/dev
v2.12.1.0
2 parents 08a5d07 + 5bd7613 commit f2099a5

5 files changed

Lines changed: 53 additions & 22 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cmake --build . --config Release --target INSTALL
2222
- name: Boost install
2323
run: |
24-
(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")
24+
(New-Object System.Net.WebClient).DownloadFile("https://archives.boost.io/release/1.87.0/binaries/boost_1_87_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
2525
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
2626
- name: CMake build and install
2727
run: |
@@ -80,7 +80,7 @@ jobs:
8080
cmake --build . --config Release --target INSTALL
8181
- name: Boost install
8282
run: |
83-
(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")
83+
(New-Object System.Net.WebClient).DownloadFile("https://archives.boost.io/release/1.87.0/binaries/boost_1_87_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
8484
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
8585
- name: Swig install
8686
run: |
@@ -180,7 +180,6 @@ jobs:
180180
env:
181181
CIBW_BUILD: cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64
182182
CIBW_ARCHS: auto64
183-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
184183
CIBW_BEFORE_ALL: >
185184
%VCPKG_INSTALLATION_ROOT%\vcpkg install boost-uuid minizip hdf5[zlib] &&
186185
cd ${{ runner.temp }} &&
@@ -252,13 +251,15 @@ jobs:
252251
CIBW_BUILD: cp38-macosx_* cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_* cp313-macosx_*
253252
CIBW_ARCHS: auto64
254253
# See https://cibuildwheel.pypa.io/en/stable/cpp_standards/#macos-and-deployment-target-versions
255-
MACOSX_DEPLOYMENT_TARGET: 10.14
254+
MACOSX_DEPLOYMENT_TARGET: 11.0
255+
# Dont use brew for dependencies https://github.com/pypa/cibuildwheel/issues/1251#issuecomment-1234553537
256256
CIBW_BEFORE_ALL: >
257-
brew install boost swig &&
258-
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
259257
cd ${{ github.workspace }}/.. &&
260-
mkdir minizip-build &&
261-
cd minizip-build &&
258+
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz &&
259+
tar xf boost_1_87_0.tar.gz &&
260+
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
261+
mkdir ${{ github.workspace }}/../minizip-build &&
262+
cd ${{ github.workspace }}/../minizip-build &&
262263
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/../minizip-install ${{ github.workspace }}/../minizip &&
263264
cmake --build . -j2 --config Release &&
264265
cmake --install . &&
@@ -267,12 +268,13 @@ jobs:
267268
tar xf hdf5-1.14.5.tar.gz &&
268269
mkdir hdf5-build &&
269270
cd hdf5-build &&
270-
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 &&
271+
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 ${{ github.workspace }}/../hdf5-1.14.5 &&
271272
cmake --build . -j2 --config Release &&
272273
cmake --install . &&
274+
brew install swig &&
273275
mkdir ${{ github.workspace }}/../build &&
274276
cd ${{ github.workspace }}/../build &&
275-
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 }} &&
277+
cmake -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=${{ github.workspace }}/../boost_1_87_0 -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 }} &&
276278
cmake --build . -j2 --config Release &&
277279
cmake --install .
278280
# See https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1313
# version mechanism
1414
set (Fesapi_VERSION_MAJOR 2)
1515
set (Fesapi_VERSION_MINOR 12)
16-
set (Fesapi_VERSION_PATCH 0)
16+
set (Fesapi_VERSION_PATCH 1)
1717
set (Fesapi_VERSION_TWEAK 0)
1818

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

python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/swigPythonInclude.i.in ${CMAKE_SOURCE_D
3030
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
3131
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++17']")
3434
endif()
3535
configure_file(${CMAKE_SOURCE_DIR}/cmake/pyproject.toml.in ${CMAKE_SOURCE_DIR}/python/pyproject.toml) # Overwrite if different
3636

src/common/DataObjectRepository.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ COMMON_NS::AbstractObject* DataObjectRepository::addOrReplaceDataObject(std::uni
649649
}
650650

651651
(*same).swap(proxy);
652-
rawProxyPtr = proxy.get();
653652
}
654653
else {
655654
if (!(*same)->isPartial()) {

swig/swigModule.i

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ under the License.
3232

3333
%include "../src/nsDefinitions.h"
3434

35+
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
36+
%nspace COMMON_NS::AbstractObject;
37+
%nspace COMMON_NS::DataObjectReference;
38+
%nspace COMMON_NS::DataObjectRepository;
39+
%nspace COMMON_NS::EnumStringMapper;
40+
%nspace COMMON_NS::EpcDocument;
41+
%nspace COMMON_NS::HdfProxyFactory;
42+
#endif
43+
3544
//************************/
3645
// JAVA
3746
//************************/
@@ -78,6 +87,14 @@ under the License.
7887
SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
7988
SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
8089

90+
%typemap(cscode) COMMON_NS::DataObjectRepository %{
91+
private HdfProxyFactory hdfProxyFactoryReference = null;
92+
%}
93+
94+
%typemap(csin,
95+
post=" hdfProxyFactoryReference = $csinput;"
96+
) COMMON_NS::HdfProxyFactory * factory "HdfProxyFactory.getCPtr($csinput)"
97+
8198
%include "swigCsInclude.i"
8299
#endif
83100

@@ -92,6 +109,22 @@ under the License.
92109
%}
93110
%include "swigPythonInclude.i"
94111

112+
/* Following extensions aims at preventing the Python garbage collector from
113+
garbage collecting an HDF Proxy factory that may be still used by a repository. */
114+
%fragment("hdf_proxy_factory_reference_init", "init") {
115+
hdf_proxy_factory_reference();
116+
}
117+
%fragment("hdf_proxy_factory_reference_function", "header", fragment="hdf_proxy_factory_reference_init") {
118+
static PyObject *hdf_proxy_factory_reference() {
119+
static PyObject *hdf_proxy_factory_reference_string = SWIG_Python_str_FromChar("__hdf_proxy_factory_reference");
120+
return hdf_proxy_factory_reference_string;
121+
}
122+
}
123+
%extend COMMON_NS::DataObjectRepository {
124+
%typemap(ret, fragment="hdf_proxy_factory_reference_function") void setHdfProxyFactory(COMMON_NS::HdfProxyFactory * factory) %{
125+
PyObject_SetAttr($self, hdf_proxy_factory_reference(), args);
126+
%}
127+
}
95128
#endif
96129

97130

@@ -172,15 +205,6 @@ under the License.
172205

173206
typedef long long time_t;
174207

175-
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
176-
%nspace COMMON_NS::AbstractObject;
177-
%nspace COMMON_NS::DataObjectReference;
178-
%nspace COMMON_NS::DataObjectRepository;
179-
%nspace COMMON_NS::EnumStringMapper;
180-
%nspace COMMON_NS::EpcDocument;
181-
%nspace COMMON_NS::HdfProxyFactory;
182-
#endif
183-
184208
namespace EML2_NS
185209
{
186210
class Activity;
@@ -813,12 +837,18 @@ import com.f2i_consulting.fesapi.*;
813837
%}
814838
%typemap(javainterfaces) COMMON_NS::DataObjectRepository "AutoCloseable"
815839
%typemap(javacode) COMMON_NS::DataObjectRepository %{
840+
private HdfProxyFactory hdfProxyFactoryReference;
841+
816842
@Override
817843
public void close() {
818844
clear();
819845
delete();
820846
}
821847
%}
848+
%typemap(javain,
849+
post=" hdfProxyFactoryReference = $javainput;"
850+
) COMMON_NS::HdfProxyFactory * factory "HdfProxyFactory.getCPtr($javainput)"
851+
822852
/**
823853
* @brief A DataObjectRepository stores in memory all dataObjects.
824854
* This is the in-memory container which holds deserialized (EPC) files and fetched ETP dataobjects.

0 commit comments

Comments
 (0)