Skip to content

Commit

Permalink
Merge pull request #355 from F2I-Consulting/dev
Browse files Browse the repository at this point in the history
v2.12.1.0
  • Loading branch information
philippeVerney authored Jan 13, 2025
2 parents 08a5d07 + 5bd7613 commit f2099a5
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 22 deletions.
22 changes: 12 additions & 10 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://boostorg.jfrog.io/artifactory/main/release/1.86.0/binaries/boost_1_86_0-msvc-14.2-64.exe", "${{ runner.temp }}\boost.exe")
(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")
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 @@ -80,7 +80,7 @@ jobs:
cmake --build . --config Release --target INSTALL
- name: Boost install
run: |
(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")
(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")
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
- name: Swig install
run: |
Expand Down Expand Up @@ -180,7 +180,6 @@ jobs:
env:
CIBW_BUILD: cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64
CIBW_ARCHS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BEFORE_ALL: >
%VCPKG_INSTALLATION_ROOT%\vcpkg install boost-uuid minizip hdf5[zlib] &&
cd ${{ runner.temp }} &&
Expand Down Expand Up @@ -252,13 +251,15 @@ jobs:
CIBW_BUILD: cp38-macosx_* cp39-macosx_* cp310-macosx_* cp311-macosx_* cp312-macosx_* cp313-macosx_*
CIBW_ARCHS: auto64
# See https://cibuildwheel.pypa.io/en/stable/cpp_standards/#macos-and-deployment-target-versions
MACOSX_DEPLOYMENT_TARGET: 10.14
MACOSX_DEPLOYMENT_TARGET: 11.0
# Dont use brew for dependencies https://github.com/pypa/cibuildwheel/issues/1251#issuecomment-1234553537
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 &&
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz &&
tar xf boost_1_87_0.tar.gz &&
git clone https://github.com/F2I-Consulting/Minizip.git ${{ github.workspace }}/../minizip &&
mkdir ${{ github.workspace }}/../minizip-build &&
cd ${{ github.workspace }}/../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 . &&
Expand All @@ -267,12 +268,13 @@ jobs:
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 -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 &&
cmake --build . -j2 --config Release &&
cmake --install . &&
brew install swig &&
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 -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 }} &&
cmake --build . -j2 --config Release &&
cmake --install .
# See https://cibuildwheel.pypa.io/en/stable/faq/#macos-passing-dyld_library_path-to-delocate
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# version mechanism
set (Fesapi_VERSION_MAJOR 2)
set (Fesapi_VERSION_MINOR 12)
set (Fesapi_VERSION_PATCH 0)
set (Fesapi_VERSION_PATCH 1)
set (Fesapi_VERSION_TWEAK 0)

set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK})
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/swigPythonInclude.i.in ${CMAKE_SOURCE_D
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI']")
else ()
set (EXTRA_COMPILE_ARGS "extra-compile-args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++11']")
set (EXTRA_COMPILE_ARGS "extra-compile-args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++17']")
endif()
configure_file(${CMAKE_SOURCE_DIR}/cmake/pyproject.toml.in ${CMAKE_SOURCE_DIR}/python/pyproject.toml) # Overwrite if different

Expand Down
1 change: 0 additions & 1 deletion src/common/DataObjectRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ COMMON_NS::AbstractObject* DataObjectRepository::addOrReplaceDataObject(std::uni
}

(*same).swap(proxy);
rawProxyPtr = proxy.get();
}
else {
if (!(*same)->isPartial()) {
Expand Down
48 changes: 39 additions & 9 deletions swig/swigModule.i
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ under the License.

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

#if defined(SWIGJAVA) || defined(SWIGCSHARP)
%nspace COMMON_NS::AbstractObject;
%nspace COMMON_NS::DataObjectReference;
%nspace COMMON_NS::DataObjectRepository;
%nspace COMMON_NS::EnumStringMapper;
%nspace COMMON_NS::EpcDocument;
%nspace COMMON_NS::HdfProxyFactory;
#endif

//************************/
// JAVA
//************************/
Expand Down Expand Up @@ -78,6 +87,14 @@ under the License.
SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE)

%typemap(cscode) COMMON_NS::DataObjectRepository %{
private HdfProxyFactory hdfProxyFactoryReference = null;
%}

%typemap(csin,
post=" hdfProxyFactoryReference = $csinput;"
) COMMON_NS::HdfProxyFactory * factory "HdfProxyFactory.getCPtr($csinput)"

%include "swigCsInclude.i"
#endif

Expand All @@ -92,6 +109,22 @@ under the License.
%}
%include "swigPythonInclude.i"

/* Following extensions aims at preventing the Python garbage collector from
garbage collecting an HDF Proxy factory that may be still used by a repository. */
%fragment("hdf_proxy_factory_reference_init", "init") {
hdf_proxy_factory_reference();
}
%fragment("hdf_proxy_factory_reference_function", "header", fragment="hdf_proxy_factory_reference_init") {
static PyObject *hdf_proxy_factory_reference() {
static PyObject *hdf_proxy_factory_reference_string = SWIG_Python_str_FromChar("__hdf_proxy_factory_reference");
return hdf_proxy_factory_reference_string;
}
}
%extend COMMON_NS::DataObjectRepository {
%typemap(ret, fragment="hdf_proxy_factory_reference_function") void setHdfProxyFactory(COMMON_NS::HdfProxyFactory * factory) %{
PyObject_SetAttr($self, hdf_proxy_factory_reference(), args);
%}
}
#endif


Expand Down Expand Up @@ -172,15 +205,6 @@ under the License.

typedef long long time_t;

#if defined(SWIGJAVA) || defined(SWIGCSHARP)
%nspace COMMON_NS::AbstractObject;
%nspace COMMON_NS::DataObjectReference;
%nspace COMMON_NS::DataObjectRepository;
%nspace COMMON_NS::EnumStringMapper;
%nspace COMMON_NS::EpcDocument;
%nspace COMMON_NS::HdfProxyFactory;
#endif

namespace EML2_NS
{
class Activity;
Expand Down Expand Up @@ -813,12 +837,18 @@ import com.f2i_consulting.fesapi.*;
%}
%typemap(javainterfaces) COMMON_NS::DataObjectRepository "AutoCloseable"
%typemap(javacode) COMMON_NS::DataObjectRepository %{
private HdfProxyFactory hdfProxyFactoryReference;

@Override
public void close() {
clear();
delete();
}
%}
%typemap(javain,
post=" hdfProxyFactoryReference = $javainput;"
) COMMON_NS::HdfProxyFactory * factory "HdfProxyFactory.getCPtr($javainput)"

/**
* @brief A DataObjectRepository stores in memory all dataObjects.
* This is the in-memory container which holds deserialized (EPC) files and fetched ETP dataobjects.
Expand Down

0 comments on commit f2099a5

Please sign in to comment.