From 68dba9775c4fc4e6f51c169ebde03646fbf24ecf Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 21 Aug 2025 15:55:52 +0200 Subject: [PATCH 01/17] Update installation paths in CMakeLists.txt to specify runtime and library destinations --- extlib/portablexdr-4.9.1/CMakeLists.txt | 6 ++++-- source/bin/CMakeLists.txt | 12 +++++++----- source/client/CMakeLists.txt | 20 +++++++++++++------ source/client2/CMakeLists.txt | 20 +++++++++++++------ source/plugins/CMakeLists.txt | 8 ++++++-- source/serialisation/CMakeLists.txt | 4 +++- source/server/CMakeLists.txt | 12 +++++++++--- source/server2/CMakeLists.txt | 12 +++++++++--- source/wrappers/c++/CMakeLists.txt | 26 ++++++++++++++++--------- source/wrappers/java/CMakeLists.txt | 4 +++- 10 files changed, 86 insertions(+), 38 deletions(-) diff --git a/extlib/portablexdr-4.9.1/CMakeLists.txt b/extlib/portablexdr-4.9.1/CMakeLists.txt index 2e7603672..f74955ae2 100644 --- a/extlib/portablexdr-4.9.1/CMakeLists.txt +++ b/extlib/portablexdr-4.9.1/CMakeLists.txt @@ -43,7 +43,9 @@ install( ) install( - TARGETS ${PROJECT_NAME} - DESTINATION lib + TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/bin/CMakeLists.txt b/source/bin/CMakeLists.txt index 43e6031f5..f60affb4b 100644 --- a/source/bin/CMakeLists.txt +++ b/source/bin/CMakeLists.txt @@ -23,12 +23,12 @@ if( ENABLE_CAPNP ) target_link_libraries( uda_cli PRIVATE serialisation-static ) target_compile_definitions( uda_cli PRIVATE CAPNP_ENABLED=1 ) - + find_library( STDCXX_LIBRARY_FILE stdc++ HINTS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES} ) get_filename_component(STDCXX_LIBRARY_DIR ${STDCXX_LIBRARY_FILE} DIRECTORY ) - + if ( "${STDCXX_LIBRARY_DIR}" STREQUAL "" ) - set ( STDCXX_RPATH "" ) + set ( STDCXX_RPATH "" ) else() set ( STDCXX_RPATH "-Wl,-rpath,${STDCXX_LIBRARY_DIR} -L${STDCXX_LIBRARY_DIR} -lstdc++" ) endif() @@ -41,13 +41,15 @@ if( ENABLE_CAPNP ) set_target_properties( uda_cli PROPERTIES - LINK_FLAGS "${CAPNP_RPATH} ${STDCXX_RPATH}" + LINK_FLAGS "${CAPNP_RPATH} ${STDCXX_RPATH}" ) endif() install( TARGETS uda_cli - DESTINATION bin + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ ) diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index 3a2858294..aec8a8d33 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -140,7 +140,7 @@ endif() if( NOT CLIENT_ONLY ) add_library( fatclient-static STATIC ${FATCLIENT_OBJS} ) target_link_libraries( fatclient-static PUBLIC plugins-static ${CLIENT_LINK_LIBS} ) - + if( BUILD_SHARED_LIBS ) add_library( fatclient-shared SHARED ${FATCLIENT_OBJS} ) target_link_libraries( fatclient-shared PUBLIC plugins-shared ${CLIENT_LINK_LIBS} ) @@ -153,7 +153,9 @@ set_target_properties( client-static ) install( TARGETS client-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -172,7 +174,9 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS client-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() @@ -189,9 +193,11 @@ if( NOT CLIENT_ONLY ) ) install( TARGETS fatclient-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) - + if( BUILD_SHARED_LIBS ) set_target_properties( fatclient-shared PROPERTIES @@ -208,7 +214,9 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fatclient-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() endif() diff --git a/source/client2/CMakeLists.txt b/source/client2/CMakeLists.txt index 18ac1ea41..22b340697 100755 --- a/source/client2/CMakeLists.txt +++ b/source/client2/CMakeLists.txt @@ -139,7 +139,7 @@ endif() if( NOT CLIENT_ONLY ) add_library( fatclient2-static STATIC ${FATCLIENT_OBJS} ) target_link_libraries( fatclient2-static PRIVATE plugins-static ${CLIENT_LINK_LIBS} ) - + if( BUILD_SHARED_LIBS ) add_library( fatclient2-shared SHARED ${FATCLIENT_OBJS} ) target_link_libraries( fatclient2-shared PRIVATE plugins-shared ${CLIENT_LINK_LIBS} ) @@ -152,7 +152,9 @@ set_target_properties( client2-static ) install( TARGETS client2-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -171,7 +173,9 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS client2-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() @@ -188,9 +192,11 @@ if( NOT CLIENT_ONLY ) ) install( TARGETS fatclient2-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) - + if( BUILD_SHARED_LIBS ) set_target_properties( fatclient2-shared PROPERTIES @@ -207,7 +213,9 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fatclient2-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() endif() diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index 52b03f920..53dea5a6b 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -112,7 +112,9 @@ set_target_properties( plugins-static install( TARGETS plugins-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -132,7 +134,9 @@ if( BUILD_SHARED_LIBS ) install( TARGETS plugins-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index ddc9b27fa..df48a86f5 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -19,7 +19,9 @@ set_target_properties( serialisation-static ) install( TARGETS serialisation-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) file( GLOB HEADER_FILES "*.h" ) diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt index 0a17a0c02..4c4decf03 100755 --- a/source/server/CMakeLists.txt +++ b/source/server/CMakeLists.txt @@ -210,7 +210,9 @@ set_target_properties( server-static install( TARGETS server-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -230,7 +232,9 @@ if( BUILD_SHARED_LIBS ) install( TARGETS server-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() @@ -250,7 +254,9 @@ if( WIN32 ) endif() install( TARGETS server-exe - DESTINATION bin + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ######################################################################################################################## diff --git a/source/server2/CMakeLists.txt b/source/server2/CMakeLists.txt index 42dd89eab..f72bd8181 100755 --- a/source/server2/CMakeLists.txt +++ b/source/server2/CMakeLists.txt @@ -179,7 +179,9 @@ set_target_properties( server2-static install( TARGETS server2-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -199,7 +201,9 @@ if( BUILD_SHARED_LIBS ) install( TARGETS server2-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() @@ -219,7 +223,9 @@ if( WIN32 ) endif() install( TARGETS server2-exe - DESTINATION bin + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ######################################################################################################################## diff --git a/source/wrappers/c++/CMakeLists.txt b/source/wrappers/c++/CMakeLists.txt index 8bf3ebe11..0e94d33b1 100755 --- a/source/wrappers/c++/CMakeLists.txt +++ b/source/wrappers/c++/CMakeLists.txt @@ -106,7 +106,7 @@ if( NOT CLIENT_ONLY ) add_library( fat${LIB_NAME}-static STATIC $ ${FATCLIENT_OBJS} ) target_link_libraries( fat${LIB_NAME}-static PRIVATE ${LINK_LIB} plugins-static ) - + if( BUILD_SHARED_LIBS ) add_library( fat${LIB_NAME}-shared SHARED $ ${FATCLIENT_OBJS} ) target_link_libraries( fat${LIB_NAME}-shared PRIVATE ${LINK_LIB} plugins-shared ) @@ -119,7 +119,9 @@ set_target_properties( ${LIB_NAME}-static ) install( TARGETS ${LIB_NAME}-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if( BUILD_SHARED_LIBS ) @@ -138,7 +140,9 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS ${LIB_NAME}-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() @@ -159,11 +163,13 @@ if( NOT CLIENT_ONLY ) PROPERTIES OUTPUT_NAME fat${LIB_NAME} ) - + install( TARGETS fat${LIB_NAME}-static - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) - + if( BUILD_SHARED_LIBS ) set_target_properties( fat${LIB_NAME}-shared PROPERTIES @@ -180,17 +186,19 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fat${LIB_NAME}-shared - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endif() - + # pkg-config file configure_file( ${CMAKE_SOURCE_DIR}/source/etc/uda-fat-cpp.pc.in ${CMAKE_BINARY_DIR}/etc/uda/uda-fat-cpp.pc @ONLY ) - + install( FILES ${CMAKE_BINARY_DIR}/etc/uda/uda-fat-cpp.pc DESTINATION modulefiles/uda ) diff --git a/source/wrappers/java/CMakeLists.txt b/source/wrappers/java/CMakeLists.txt index d2903303c..7741c8a3c 100755 --- a/source/wrappers/java/CMakeLists.txt +++ b/source/wrappers/java/CMakeLists.txt @@ -64,5 +64,7 @@ if( WIN32 ) endif() install( TARGETS ${LIB_NAME} - DESTINATION lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) From f15464a1bfd384c42623caf23bd3b994fe96d42a Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 11:33:00 +0200 Subject: [PATCH 02/17] Update CMake installation paths to use CMAKE_INSTALL_BINDIR for runtime destinations --- source/bin/CMakeLists.txt | 2 +- source/client/CMakeLists.txt | 8 ++++---- source/client2/CMakeLists.txt | 8 ++++---- source/plugins/CMakeLists.txt | 4 ++-- source/serialisation/CMakeLists.txt | 2 +- source/server/CMakeLists.txt | 6 +++--- source/server2/CMakeLists.txt | 6 +++--- source/wrappers/c++/CMakeLists.txt | 8 ++++---- source/wrappers/java/CMakeLists.txt | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/source/bin/CMakeLists.txt b/source/bin/CMakeLists.txt index f60affb4b..4c15ea773 100644 --- a/source/bin/CMakeLists.txt +++ b/source/bin/CMakeLists.txt @@ -47,7 +47,7 @@ endif() install( TARGETS uda_cli - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index aec8a8d33..8515a8d8e 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -153,7 +153,7 @@ set_target_properties( client-static ) install( TARGETS client-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -174,7 +174,7 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS client-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -193,7 +193,7 @@ if( NOT CLIENT_ONLY ) ) install( TARGETS fatclient-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -214,7 +214,7 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fatclient-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/client2/CMakeLists.txt b/source/client2/CMakeLists.txt index 22b340697..28aa3e52e 100755 --- a/source/client2/CMakeLists.txt +++ b/source/client2/CMakeLists.txt @@ -152,7 +152,7 @@ set_target_properties( client2-static ) install( TARGETS client2-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -173,7 +173,7 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS client2-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -192,7 +192,7 @@ if( NOT CLIENT_ONLY ) ) install( TARGETS fatclient2-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -213,7 +213,7 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fatclient2-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index 53dea5a6b..b8f93360a 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -112,7 +112,7 @@ set_target_properties( plugins-static install( TARGETS plugins-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -134,7 +134,7 @@ if( BUILD_SHARED_LIBS ) install( TARGETS plugins-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index df48a86f5..d089a8177 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -19,7 +19,7 @@ set_target_properties( serialisation-static ) install( TARGETS serialisation-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt index 4c4decf03..b965afc11 100755 --- a/source/server/CMakeLists.txt +++ b/source/server/CMakeLists.txt @@ -210,7 +210,7 @@ set_target_properties( server-static install( TARGETS server-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -232,7 +232,7 @@ if( BUILD_SHARED_LIBS ) install( TARGETS server-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -254,7 +254,7 @@ if( WIN32 ) endif() install( TARGETS server-exe - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/server2/CMakeLists.txt b/source/server2/CMakeLists.txt index f72bd8181..5e34cea6e 100755 --- a/source/server2/CMakeLists.txt +++ b/source/server2/CMakeLists.txt @@ -179,7 +179,7 @@ set_target_properties( server2-static install( TARGETS server2-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -201,7 +201,7 @@ if( BUILD_SHARED_LIBS ) install( TARGETS server2-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -223,7 +223,7 @@ if( WIN32 ) endif() install( TARGETS server2-exe - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/wrappers/c++/CMakeLists.txt b/source/wrappers/c++/CMakeLists.txt index 0e94d33b1..38a573e08 100755 --- a/source/wrappers/c++/CMakeLists.txt +++ b/source/wrappers/c++/CMakeLists.txt @@ -119,7 +119,7 @@ set_target_properties( ${LIB_NAME}-static ) install( TARGETS ${LIB_NAME}-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -140,7 +140,7 @@ if( BUILD_SHARED_LIBS ) endif() install( TARGETS ${LIB_NAME}-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -165,7 +165,7 @@ if( NOT CLIENT_ONLY ) ) install( TARGETS fat${LIB_NAME}-static - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -186,7 +186,7 @@ if( NOT CLIENT_ONLY ) endif() install( TARGETS fat${LIB_NAME}-shared - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/source/wrappers/java/CMakeLists.txt b/source/wrappers/java/CMakeLists.txt index 7741c8a3c..6dd26e089 100755 --- a/source/wrappers/java/CMakeLists.txt +++ b/source/wrappers/java/CMakeLists.txt @@ -64,7 +64,7 @@ if( WIN32 ) endif() install( TARGETS ${LIB_NAME} - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) From 3610b3fa1faa0062452f482e9a8564b972e0d041 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 17:12:30 +0200 Subject: [PATCH 03/17] Refactor library names in win.setup.py.in for consistency and clarity --- source/wrappers/python/win.setup.py.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/wrappers/python/win.setup.py.in b/source/wrappers/python/win.setup.py.in index cb56dd952..343e010b0 100644 --- a/source/wrappers/python/win.setup.py.in +++ b/source/wrappers/python/win.setup.py.in @@ -37,14 +37,14 @@ uda_lib_names = '@UDA_LIBS@'.split(';') if '@UDA_LIBS@' else [] build_fat = os.environ.get('UDA_FAT_PYTHON', False) if build_fat: uda_libs = [ - 'libfat@PROJECT_NAME@_client.' + stalib_ext, - 'lib@PROJECT_NAME@_plugins.' + stalib_ext, - ] + ['lib@PROJECT_NAME@_' + name + '.' + stalib_ext for name in uda_lib_names] + 'fat@PROJECT_NAME@_client', + '@PROJECT_NAME@_plugins', + ] + ['@PROJECT_NAME@_' + name for name in uda_lib_names] extra_libs = ['xml2', 'pq'] extra_macros = [('FATCLIENT', None)] else: uda_libs = [ - '@PROJECT_NAME@_client.dll.' + stalib_ext, + '@PROJECT_NAME@_client.' + stalib_ext, ] + ['@PROJECT_NAME@_' + name + '.' + stalib_ext for name in uda_lib_names] extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = [] @@ -83,7 +83,7 @@ def get_version(v): setup( - name='ukaea_pyuda_test', + name='uda', version=get_version('@PROJECT_VERSION@'), description='Unified Data Access (UDA)', long_description='Unified Data Access (UDA)', From e85da97ba8caaf596719c47c289f5d6897a3af6f Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 17:14:15 +0200 Subject: [PATCH 04/17] Update static library output names in CMakeLists.txt files to include '_static' suffix for clarity --- source/client/CMakeLists.txt | 4 ++-- source/client2/CMakeLists.txt | 4 ++-- source/plugins/CMakeLists.txt | 2 +- source/serialisation/CMakeLists.txt | 2 +- source/server/CMakeLists.txt | 2 +- source/server2/CMakeLists.txt | 2 +- source/wrappers/c++/CMakeLists.txt | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index 8515a8d8e..5b423af00 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -149,7 +149,7 @@ endif() set_target_properties( client-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_client + OUTPUT_NAME ${PROJECT_NAME}_client_static ) install( TARGETS client-static @@ -189,7 +189,7 @@ install( FILES ${HEADER_FILES} if( NOT CLIENT_ONLY ) set_target_properties( fatclient-static PROPERTIES - OUTPUT_NAME fat${PROJECT_NAME}_client + OUTPUT_NAME fat${PROJECT_NAME}_client_static ) install( TARGETS fatclient-static diff --git a/source/client2/CMakeLists.txt b/source/client2/CMakeLists.txt index 28aa3e52e..5a4c03115 100755 --- a/source/client2/CMakeLists.txt +++ b/source/client2/CMakeLists.txt @@ -148,7 +148,7 @@ endif() set_target_properties( client2-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_client2 + OUTPUT_NAME ${PROJECT_NAME}_client2_static ) install( TARGETS client2-static @@ -188,7 +188,7 @@ install( FILES ${HEADER_FILES} if( NOT CLIENT_ONLY ) set_target_properties( fatclient2-static PROPERTIES - OUTPUT_NAME fat${PROJECT_NAME}_client2 + OUTPUT_NAME fat${PROJECT_NAME}_client2_static ) install( TARGETS fatclient2-static diff --git a/source/plugins/CMakeLists.txt b/source/plugins/CMakeLists.txt index b8f93360a..146dca3c9 100755 --- a/source/plugins/CMakeLists.txt +++ b/source/plugins/CMakeLists.txt @@ -107,7 +107,7 @@ endif() set_target_properties( plugins-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_plugins + OUTPUT_NAME ${PROJECT_NAME}_plugins_static ) install( diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index d089a8177..150492196 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories( set_target_properties( serialisation-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_serialisation + OUTPUT_NAME ${PROJECT_NAME}_serialisation_static ) install( TARGETS serialisation-static diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt index b965afc11..2cef1c213 100755 --- a/source/server/CMakeLists.txt +++ b/source/server/CMakeLists.txt @@ -205,7 +205,7 @@ endif() set_target_properties( server-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_server + OUTPUT_NAME ${PROJECT_NAME}_server_static ) install( diff --git a/source/server2/CMakeLists.txt b/source/server2/CMakeLists.txt index 5e34cea6e..d834c1bd4 100755 --- a/source/server2/CMakeLists.txt +++ b/source/server2/CMakeLists.txt @@ -174,7 +174,7 @@ endif() set_target_properties( server2-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_server2 + OUTPUT_NAME ${PROJECT_NAME}_server2_static ) install( diff --git a/source/wrappers/c++/CMakeLists.txt b/source/wrappers/c++/CMakeLists.txt index 38a573e08..105cddf21 100755 --- a/source/wrappers/c++/CMakeLists.txt +++ b/source/wrappers/c++/CMakeLists.txt @@ -115,7 +115,7 @@ endif() set_target_properties( ${LIB_NAME}-static PROPERTIES - OUTPUT_NAME ${LIB_NAME} + OUTPUT_NAME ${LIB_NAME}_static ) install( TARGETS ${LIB_NAME}-static From 9181ac3c2ac5985d314825d9ef56172f74c9e08a Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 17:16:49 +0200 Subject: [PATCH 05/17] Update runtime installation destination in xdr CMakeLists.txt --- extlib/portablexdr-4.9.1/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extlib/portablexdr-4.9.1/CMakeLists.txt b/extlib/portablexdr-4.9.1/CMakeLists.txt index f74955ae2..5c427a490 100644 --- a/extlib/portablexdr-4.9.1/CMakeLists.txt +++ b/extlib/portablexdr-4.9.1/CMakeLists.txt @@ -44,7 +44,7 @@ install( install( TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) From 53a7dceb33915bd33ed1db922fb73b197dd9c431 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 18:25:35 +0200 Subject: [PATCH 06/17] Return to use norm import library suffix --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 665e89ca5..0facedc91 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ set( Boost_USE_MULTITHREADED OFF ) # Version and Machine information # Set VERSION and FULL_VERSION from `git describe` -# but use git export attribute for release tarballs +# but use git export attribute for release tarballs set( GIT_ARCHIVE_DESCRIBE [[$Format:%(describe)$]] ) include( DetermineVersion ) @@ -109,16 +109,16 @@ endif() if( NOT WIN32 ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pthread -Wno-implicit-function-declaration" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread" ) - + if( MINGW ) add_definitions( -DMINGW ) endif() - + if( GOPTION ) message( "Compiling with g option to generate and embed debug information" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" ) - endif() + endif() endif() if( WIN32 AND NOT MINGW ) @@ -136,12 +136,12 @@ if( WIN32 OR MINGW ) set( CMAKE_FIND_LIBRARY_PREFIXES "lib" "" ) set( CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".dll.lib" ".a" ".lib" ) if( MINGW ) - set( IMPLIB_SUFFIX ".dll.a" ) + set( IMPLIB_SUFFIX ".a" ) else() - set( IMPLIB_SUFFIX ".dll.lib" ) + set( IMPLIB_SUFFIX ".lib" ) endif() find_package( XDR REQUIRED ) - + # "-Wl,-z,defs" is an ELF instruction, not supported by Windows string( REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}" ) endif() @@ -184,7 +184,7 @@ endif() if( SSLAUTHENTICATION ) message( "Including SSL/RTL X509 User Authentication" ) add_definitions( -DSSLAUTHENTICATION ) -endif() +endif() if( BUILD_SHARED_LIBS ) message( "Build shared libraries asked" ) @@ -256,7 +256,7 @@ if( WIN32 OR MINGW ) # otherwise it is not able to find files set( CPACK_NSIS_FULL_INSTALL "File /r \\\"\\\${INST_DIR_WIN}\\\\*.*\\\"" ) endif() - + set( CPACK_TEMPORARY_INSTALL_DIRECTORY "${CMAKE_BINARY_DIR}/cpack" ) set( CPACK_PACKAGE_DIRECTORY "${CMAKE_WIN_BINARY_DIR}" ) set( CPACK_TEMPORARY_DIRECTORY "${CMAKE_BINARY_DIR}/cpack" ) From b27d5790a7d367dd24b901eb1fd0a9b9de29d306 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 28 Aug 2025 18:40:31 +0200 Subject: [PATCH 07/17] Revert output name of serialisation-static library to remove '_static' suffix for consistency --- source/serialisation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index 150492196..d089a8177 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories( set_target_properties( serialisation-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_serialisation_static + OUTPUT_NAME ${PROJECT_NAME}_serialisation ) install( TARGETS serialisation-static From 17914121627dfd2b79488347f7c61d1dc38ee87c Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Sat, 30 Aug 2025 13:45:44 +0200 Subject: [PATCH 08/17] Refactor CMakeLists.txt to clarify output names and add shared library support --- source/serialisation/CMakeLists.txt | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index d089a8177..a461278c1 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -15,15 +15,48 @@ target_include_directories( set_target_properties( serialisation-static PROPERTIES - OUTPUT_NAME ${PROJECT_NAME}_serialisation + OUTPUT_NAME ${PROJECT_NAME}_serialisation_static ) +# Optionally build a shared library variant as well +if( BUILD_SHARED_LIBS ) + add_library( serialisation-shared SHARED capnp_serialisation.cpp ${CAPNP_SRCS} ) + target_link_libraries( serialisation-shared PRIVATE CapnProto::capnp ) + target_include_directories( + serialisation-shared + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/source ${CMAKE_SOURCE_DIR}/extlib/GSL-4.0.0/include + ) + + set_target_properties( serialisation-shared + PROPERTIES + OUTPUT_NAME ${PROJECT_NAME}_serialisation + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${PROJECT_VERSION_MAJOR} + ) + + if( WIN32 ) + set_target_properties( serialisation-shared + PROPERTIES + COMPILE_FLAGS -DLIBRARY_EXPORTS + IMPORT_SUFFIX ${IMPLIB_SUFFIX} + ) + endif() +endif() + install( TARGETS serialisation-static RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +if( BUILD_SHARED_LIBS ) + install( TARGETS serialisation-shared + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() + file( GLOB HEADER_FILES "*.h" ) install( FILES ${HEADER_FILES} From 437425d46649f7f95bbec52851e748d23d287944 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Sat, 30 Aug 2025 15:02:07 +0200 Subject: [PATCH 09/17] Add Windows export configuration for MSVC in CMakeLists.txt --- source/serialisation/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/serialisation/CMakeLists.txt b/source/serialisation/CMakeLists.txt index a461278c1..c58cd7f6a 100644 --- a/source/serialisation/CMakeLists.txt +++ b/source/serialisation/CMakeLists.txt @@ -3,6 +3,11 @@ find_package( CapnProto REQUIRED ) +if( WIN32 ) + # Use variable-based auto-export so MSVC generates import libs without header annotations + set( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON ) +endif() + capnp_generate_cpp( CAPNP_SRCS CANPNP_HDRS schema.capnp ) add_library( serialisation-static STATIC capnp_serialisation.cpp ${CAPNP_SRCS} ) From 598fb47d82db0afeb9bf2759f90c0fa1ebef6de0 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Sat, 30 Aug 2025 15:03:55 +0200 Subject: [PATCH 10/17] Refactor setup.py.in to simplify library naming and include uda_libs in the libraries list --- source/wrappers/python/setup.py.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 59762962c..e9b60221b 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -33,16 +33,16 @@ uda_lib_names = '@UDA_LIBS@'.split(';') if '@UDA_LIBS@' else [] build_fat = os.environ.get('UDA_FAT_PYTHON', False) if build_fat: uda_libs = [ - 'libfat@PROJECT_NAME@_client.' + stalib_ext, - 'lib@PROJECT_NAME@_plugins.' + stalib_ext, - ] + ['lib@PROJECT_NAME@_' + name + '.' + stalib_ext for name in uda_lib_names] + 'fat@PROJECT_NAME@_client', + '@PROJECT_NAME@_plugins', + ] + ['@PROJECT_NAME@_' + name for name in uda_lib_names] extra_libs = ['xml2'] extra_libs.extend('@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else []) extra_macros = [('FATCLIENT', None)] else: uda_libs = [ - 'lib@PROJECT_NAME@_client.' + stalib_ext, - ] + ['lib@PROJECT_NAME@_' + name + '.' + stalib_ext for name in uda_lib_names] + '@PROJECT_NAME@_client', + ] + ['@PROJECT_NAME@_' + name for name in uda_lib_names] extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = [] @@ -57,7 +57,7 @@ ext = Extension( numpy.get_include(), '@FMT_INCLUDE_DIR@' ])), - libraries=list(filter(None, ['ssl', 'crypto', 'xml2'] + extra_libs)), + libraries=list(filter(None, ['ssl', 'crypto', 'xml2'] + extra_libs + uda_libs)), library_dirs=list(filter(None, [ '@STDCXX_LIB_DIR@', '@OPENSSL_LIB_DIR@', @@ -72,7 +72,6 @@ ext = Extension( '@CAPNP_LIB_DIR@', '@FMT_LIB_DIR@' ])), - extra_objects=[os.path.join(root, 'lib', uda_lib) for uda_lib in uda_libs], extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, language='c++', From 321ac4785da14d4b9f097dd0515082064ba8bcfb Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 4 Sep 2025 17:42:09 +0200 Subject: [PATCH 11/17] add '_static' suffix for fat uda-cpp --- source/wrappers/c++/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/c++/CMakeLists.txt b/source/wrappers/c++/CMakeLists.txt index 105cddf21..4ba61446f 100755 --- a/source/wrappers/c++/CMakeLists.txt +++ b/source/wrappers/c++/CMakeLists.txt @@ -161,7 +161,7 @@ install( FILES ${CMAKE_BINARY_DIR}/etc/uda/uda-cpp.pc if( NOT CLIENT_ONLY ) set_target_properties( fat${LIB_NAME}-static PROPERTIES - OUTPUT_NAME fat${LIB_NAME} + OUTPUT_NAME fat${LIB_NAME}_static ) install( TARGETS fat${LIB_NAME}-static From 96acdcb1712a60f814ac0a781b2b5f93aed55de2 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Fri, 12 Sep 2025 17:12:41 +0900 Subject: [PATCH 12/17] Refactor setup.py.in and win.setup.py.in to improve handling of static and shared UDA libraries --- source/wrappers/python/setup.py.in | 18 ++++++++++++++++-- source/wrappers/python/win.setup.py.in | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index e9b60221b..3818fb02e 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -27,7 +27,7 @@ elif sys.platform.lower() == 'darwin': stalib_ext = 'a' dynlib_ext = 'dylib' # On Mac OS we have to force setting of rpath - extra_link_args.append('-Wl,-rpath,%s' % os.path.join(root, 'lib')) + extra_link_args.append('-Wl,-rpath,{}'.format(os.path.join(root, 'lib'))) uda_lib_names = '@UDA_LIBS@'.split(';') if '@UDA_LIBS@' else [] build_fat = os.environ.get('UDA_FAT_PYTHON', False) @@ -46,6 +46,19 @@ else: extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = [] +uda_static_libs = [os.path.join(root, 'lib', lib + '_static.' + stalib_ext) for lib in uda_libs] +uda_shared_libs = uda_libs + +# Decide whether to build against shared or static UDA libraries +if os.environ.get('UDA_PYTHON_STATIC', True): + print("Building against static UDA libraries") + libraries = ['ssl', 'crypto', 'xml2'] + extra_libs + static_libs = uda_static_libs +else: + print("Building against shared UDA libraries") + libraries = ['ssl', 'crypto', 'xml2'] + extra_libs + uda_shared_libs + static_libs = None + ext = Extension( 'cpyuda', ['pyuda/cpyuda/cpyuda.pyx'], @@ -57,7 +70,7 @@ ext = Extension( numpy.get_include(), '@FMT_INCLUDE_DIR@' ])), - libraries=list(filter(None, ['ssl', 'crypto', 'xml2'] + extra_libs + uda_libs)), + libraries=libraries, library_dirs=list(filter(None, [ '@STDCXX_LIB_DIR@', '@OPENSSL_LIB_DIR@', @@ -74,6 +87,7 @@ ext = Extension( ])), extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, + extra_objects=static_libs, language='c++', define_macros=extra_macros, ) diff --git a/source/wrappers/python/win.setup.py.in b/source/wrappers/python/win.setup.py.in index 343e010b0..2f6037dd2 100644 --- a/source/wrappers/python/win.setup.py.in +++ b/source/wrappers/python/win.setup.py.in @@ -30,6 +30,7 @@ elif sys.platform.lower() == 'darwin': extra_link_args.append('-Wl,-rpath,%s' % os.path.join(root, 'lib')) else: stalib_ext = 'lib' + implib_ext = 'lib' dynlib_ext = 'dll' extra_compile_args = ['/MD'] @@ -49,6 +50,19 @@ else: extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = [] +uda_static_libs = [os.path.join(root, 'lib', lib + '_static.' + stalib_ext) for lib in uda_libs] + +# Decide whether to build against shared or static UDA libraries +if os.environ.get('UDA_PYTHON_STATIC', True): + print("Building against static UDA libraries") + libraries = extra_libs + static_libs = uda_static_libs +else: + print("Building against shared UDA libraries") + libraries = extra_libs + uda_libs + static_libs = None + + ext = Extension( 'cpyuda', ['pyuda/cpyuda/cpyuda.pyx'], @@ -59,7 +73,7 @@ ext = Extension( numpy.get_include(), '@FMT_INCLUDE_DIR@' ])), - libraries=list(filter(None, extra_libs)), + libraries=list(filter(None, libraries)), library_dirs=list(filter(None, [ '@OPENSSL_LIB_DIR@', '@LIBXML_LIB_DIR@', @@ -67,7 +81,7 @@ ext = Extension( '@FMT_LIB_DIR@', os.path.join(root, 'lib') ])), - extra_objects=[os.path.join(root, 'lib', uda_lib) for uda_lib in uda_libs], + extra_objects=static_libs, extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, language='c++', From ad44bef69d2ad26f17fe70f973d98a917254d32b Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 18 Sep 2025 15:43:25 +0200 Subject: [PATCH 13/17] Fix static library path in setup.py.in to include 'lib' prefix --- source/wrappers/python/setup.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 3818fb02e..4a47645f3 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -46,7 +46,7 @@ else: extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = [] -uda_static_libs = [os.path.join(root, 'lib', lib + '_static.' + stalib_ext) for lib in uda_libs] +uda_static_libs = [os.path.join(root, 'lib', 'lib' + lib + '_static.' + stalib_ext) for lib in uda_libs] uda_shared_libs = uda_libs # Decide whether to build against shared or static UDA libraries From a702847917dc4ff552c4ed2c283424b964abda40 Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Thu, 18 Sep 2025 16:34:47 +0200 Subject: [PATCH 14/17] Refactor setup.py.in and win.setup.py.in to improve handling of static and shared UDA libraries --- source/wrappers/python/setup.py.in | 10 +++++----- source/wrappers/python/win.setup.py.in | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 4a47645f3..8d60c8a7f 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -50,14 +50,14 @@ uda_static_libs = [os.path.join(root, 'lib', 'lib' + lib + '_static.' + stalib_e uda_shared_libs = uda_libs # Decide whether to build against shared or static UDA libraries -if os.environ.get('UDA_PYTHON_STATIC', True): - print("Building against static UDA libraries") - libraries = ['ssl', 'crypto', 'xml2'] + extra_libs - static_libs = uda_static_libs -else: +if os.environ.get('UDA_PYTHON_SHARED', False): print("Building against shared UDA libraries") libraries = ['ssl', 'crypto', 'xml2'] + extra_libs + uda_shared_libs static_libs = None +else: + print("Building against static UDA libraries") + libraries = ['ssl', 'crypto', 'xml2'] + extra_libs + static_libs = uda_static_libs ext = Extension( 'cpyuda', diff --git a/source/wrappers/python/win.setup.py.in b/source/wrappers/python/win.setup.py.in index 2f6037dd2..209cdf47b 100644 --- a/source/wrappers/python/win.setup.py.in +++ b/source/wrappers/python/win.setup.py.in @@ -53,14 +53,14 @@ else: uda_static_libs = [os.path.join(root, 'lib', lib + '_static.' + stalib_ext) for lib in uda_libs] # Decide whether to build against shared or static UDA libraries -if os.environ.get('UDA_PYTHON_STATIC', True): - print("Building against static UDA libraries") - libraries = extra_libs - static_libs = uda_static_libs -else: +if os.environ.get('UDA_PYTHON_SHARED', False): print("Building against shared UDA libraries") libraries = extra_libs + uda_libs static_libs = None +else: + print("Building against static UDA libraries") + libraries = extra_libs + static_libs = uda_static_libs ext = Extension( From d881020e9b89c5b5e8aae3bf4149df71e73b3928 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:43:26 +0000 Subject: [PATCH 15/17] Bump actions/download-artifact from 4 to 6 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 6. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index cb7f0539e..5cc43789c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -284,7 +284,7 @@ jobs: permissions: id-token: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v6 with: # unpacks all CIBW artifacts into dist/ pattern: cibw-* From d4a81f4547d04e8e96f245b5b1a76b8a645096ff Mon Sep 17 00:00:00 2001 From: stephen-dixon <68229525+stephen-dixon@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:56:15 +0000 Subject: [PATCH 16/17] Bugfix/repeated bytes calls fail (#99) * fixing multiple-read failures in getBytes plugin * fixing typo in pyuda get_file method --- .gitlab-ci.yml | 2 +- source/plugins/bytes/bytesPlugin.cpp | 94 +++++++++++-------- .../plugins/bytes/readBytesNonOptimally.cpp | 2 +- source/plugins/udaPlugin.cpp | 47 ++++++++++ source/plugins/udaPlugin.h | 6 ++ source/wrappers/python/README.md | 2 +- source/wrappers/python/pyuda/_client.py | 2 +- source/wrappers/python/uda/README.md | 2 +- 8 files changed, 112 insertions(+), 45 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 00ffb78cc..4ba5f3642 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,6 @@ build_idl84: - cp -r install/lib/python${PYTHON_VERSION}/site-packages/*uda* dist - export PYTHONPATH=dist:$PYTHONPATH - # - export LD_LIBRARY_PATH=install/lib:$LD_LIBRARY_PATH - module use install/modulefiles - UDA_MODULE=`ls install/modulefiles | grep uda` - module load $UDA_MODULE @@ -76,6 +75,7 @@ build_idl84: - python3 -m pytest -v mastcodes/uda/python/tests/test_uda_meta.py - python3 -m pytest -v mastcodes/uda/python/tests/test_uda_signals.py - python3 -m pytest -v mastcodes/uda/python/tests/test_uda_xpad.py + - python3 mastcodes/uda/python/tests/test_put.py artifacts: paths: - dist diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 618be3d23..ed9ea7548 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -3,7 +3,9 @@ #include #include #include +#include #include +#include #include #include "readBytesNonOptimally.h" @@ -62,6 +64,7 @@ class BytesPlugin return; } // Free Heap & reset counters + file_map_.clear(); init_ = false; } @@ -82,50 +85,57 @@ class BytesPlugin int bytesPlugin(IDAM_PLUGIN_INTERFACE* plugin_interface) { - static BytesPlugin plugin = {}; + try { + static BytesPlugin plugin = {}; - if (plugin_interface->interfaceVersion > THISPLUGIN_MAX_INTERFACE_VERSION) { - RAISE_PLUGIN_ERROR("Plugin Interface Version Unknown to this plugin: Unable to execute the request!"); - } + if (plugin_interface->interfaceVersion > THISPLUGIN_MAX_INTERFACE_VERSION) { + RAISE_PLUGIN_ERROR("Plugin Interface Version Unknown to this plugin: Unable to execute the request!"); + } - plugin_interface->pluginVersion = THISPLUGIN_VERSION; + plugin_interface->pluginVersion = THISPLUGIN_VERSION; - REQUEST_DATA* request = plugin_interface->request_data; + REQUEST_DATA* request = plugin_interface->request_data; - if (plugin_interface->housekeeping || STR_IEQUALS(request->function, "reset")) { - plugin.reset(plugin_interface); - return 0; - } + if (plugin_interface->housekeeping || STR_IEQUALS(request->function, "reset")) { + plugin.reset(plugin_interface); + return 0; + } - plugin.init(plugin_interface); - if (STR_IEQUALS(request->function, "init") - || STR_IEQUALS(request->function, "initialise")) { - return 0; - } + plugin.init(plugin_interface); + if (STR_IEQUALS(request->function, "init") + || STR_IEQUALS(request->function, "initialise")) { + return 0; + } - //---------------------------------------------------------------------------------------- - // Plugin Functions - //---------------------------------------------------------------------------------------- - - //---------------------------------------------------------------------------------------- - // Standard methods: version, builddate, defaultmethod, maxinterfaceversion - - if (STR_IEQUALS(request->function, "help")) { - return plugin.help(plugin_interface); - } else if (STR_IEQUALS(request->function, "version")) { - return plugin.version(plugin_interface); - } else if (STR_IEQUALS(request->function, "builddate")) { - return plugin.build_date(plugin_interface); - } else if (STR_IEQUALS(request->function, "defaultmethod")) { - return plugin.default_method(plugin_interface); - } else if (STR_IEQUALS(request->function, "maxinterfaceversion")) { - return plugin.max_interface_version(plugin_interface); - } else if (STR_IEQUALS(request->function, "read")) { - return plugin.read(plugin_interface); - } else if (STR_IEQUALS(request->function, "size")) { - return plugin.size(plugin_interface); - } else { - RAISE_PLUGIN_ERROR_AND_EXIT("Unknown function requested!", plugin_interface); + //---------------------------------------------------------------------------------------- + // Plugin Functions + //---------------------------------------------------------------------------------------- + + //---------------------------------------------------------------------------------------- + // Standard methods: version, builddate, defaultmethod, maxinterfaceversion + + if (STR_IEQUALS(request->function, "help")) { + return plugin.help(plugin_interface); + } else if (STR_IEQUALS(request->function, "version")) { + return plugin.version(plugin_interface); + } else if (STR_IEQUALS(request->function, "builddate")) { + return plugin.build_date(plugin_interface); + } else if (STR_IEQUALS(request->function, "defaultmethod")) { + return plugin.default_method(plugin_interface); + } else if (STR_IEQUALS(request->function, "maxinterfaceversion")) { + return plugin.max_interface_version(plugin_interface); + } else if (STR_IEQUALS(request->function, "read")) { + return plugin.read(plugin_interface); + } else if (STR_IEQUALS(request->function, "size")) { + return plugin.size(plugin_interface); + } else { + RAISE_PLUGIN_ERROR_AND_EXIT("Unknown function requested!", plugin_interface); + } + } catch (const std::exception& e) { + std::string err_msg = std::string("Excption raised in bytes plugin:") + e.what(); + RAISE_PLUGIN_ERROR_AND_EXIT(err_msg.c_str(), plugin_interface); + } catch (...) { + RAISE_PLUGIN_ERROR_AND_EXIT("Unknown exception raised by bytes plugin", plugin_interface); } } @@ -227,8 +237,12 @@ int BytesPlugin::read(IDAM_PLUGIN_INTERFACE* plugin_interface) int max_bytes = -1; FIND_INT_VALUE(plugin_interface->request_data->nameValueList, max_bytes); - int offset = -1; - FIND_INT_VALUE(plugin_interface->request_data->nameValueList, offset); + unsigned long offset = 0; + FIND_UNSIGNED_LONG_VALUE(plugin_interface->request_data->nameValueList, offset); + auto file_size = filesystem::file_size(path); + if (offset >= file_size) { + RAISE_PLUGIN_ERROR_AND_EXIT("Offset specified is out of bounds", plugin_interface); + } const char* checksum = nullptr; FIND_STRING_VALUE(plugin_interface->request_data->nameValueList, checksum); diff --git a/source/plugins/bytes/readBytesNonOptimally.cpp b/source/plugins/bytes/readBytesNonOptimally.cpp index 11ff9b901..3c5c9027c 100755 --- a/source/plugins/bytes/readBytesNonOptimally.cpp +++ b/source/plugins/bytes/readBytesNonOptimally.cpp @@ -63,7 +63,7 @@ int readBytes(FILE* fh, DATA_BLOCK* data_block, int offset, int max_bytes, const while (!feof(fh)) { char* newp = (char*)realloc(bp, (size_t)data_block->data_n); if (newp == nullptr) { - free(bp); + if (bp != nullptr) free(bp); err = BYTE_FILE_HEAP_ERROR; addIdamError(UDA_CODE_ERROR_TYPE, "readBytes", err, "Unable to Allocate Heap Memory for the File"); break; diff --git a/source/plugins/udaPlugin.cpp b/source/plugins/udaPlugin.cpp index 79f70bf4d..47de1d698 100644 --- a/source/plugins/udaPlugin.cpp +++ b/source/plugins/udaPlugin.cpp @@ -14,6 +14,7 @@ #include #include #include +#include IDAM_PLUGIN_INTERFACE* udaCreatePluginInterface(const char* request) { @@ -467,6 +468,52 @@ bool findIntValue(const NAMEVALUELIST* namevaluelist, int* value, const char* na return found; } +/** + * Look for an argument with the given name in the provided NAMEVALUELIST and return it's associate value as a long integer. + * + * If the argument is found the value associated with the argument is provided via the value parameter and the function + * returns 1. Otherwise value is not set and the function returns 0. + * @param namevaluelist + * @param value + * @param name + * @return + */ +bool findLongIntValue(const NAMEVALUELIST* namevaluelist, long* value, const char* name) +{ + const char* str; + bool found = findStringValue(namevaluelist, &str, name); + if (found) { + *value = atol(str); + } + return found; +} + +/** + * Look for an argument with the given name in the provided NAMEVALUELIST and return it's associate value as an + * unsigned long integer. + * + * If the argument is found the value associated with the argument is provided via the value parameter and the function + * returns 1. Otherwise value is not set and the function returns 0. + * @param namevaluelist + * @param value + * @param name + * @return + */ +bool findUnsignedLongValue(const NAMEVALUELIST* namevaluelist, unsigned long* value, const char* name) +{ + const char* str; + bool found = findStringValue(namevaluelist, &str, name); + if (found) { + if (std::strchr(str, '-') != nullptr) { + std::string err_msg = std::string("Negative value found when unsigned expected: ") + name + "=" + str; + RAISE_PLUGIN_ERROR(err_msg.c_str()); + return false; + } + *value = std::strtoul(str, nullptr, 10); + } + return found; +} + /** * Look for an argument with the given name in the provided NAMEVALUELIST and return it's associate value as a short. * diff --git a/source/plugins/udaPlugin.h b/source/plugins/udaPlugin.h index 8c23856c3..1490616ea 100755 --- a/source/plugins/udaPlugin.h +++ b/source/plugins/udaPlugin.h @@ -83,6 +83,8 @@ LIBRARY_API int setReturnData(DATA_BLOCK* data_block, void* value, size_t size, LIBRARY_API bool findStringValue(const NAMEVALUELIST* namevaluelist, const char** value, const char* name); LIBRARY_API bool findValue(const NAMEVALUELIST* namevaluelist, const char* name); LIBRARY_API bool findIntValue(const NAMEVALUELIST* namevaluelist, int* value, const char* name); +LIBRARY_API bool findLongIntValue(const NAMEVALUELIST* namevaluelist, long* value, const char* name); +LIBRARY_API bool findUnsignedLongValue(const NAMEVALUELIST* namevaluelist, unsigned long* value, const char* name); LIBRARY_API bool findShortValue(const NAMEVALUELIST* namevaluelist, short* value, const char* name); LIBRARY_API bool findCharValue(const NAMEVALUELIST* namevaluelist, char* value, const char* name); LIBRARY_API bool findFloatValue(const NAMEVALUELIST* namevaluelist, float* values, const char* name); @@ -142,6 +144,8 @@ if (!find##TYPE##Array(&NAME_VALUE_LIST, &VARIABLE, CONCAT(&n, VARIABLE), QUOTE( } #define FIND_REQUIRED_INT_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, Int) +#define FIND_REQUIRED_LONG_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, LongInt) +#define FIND_REQUIRED_UNSIGNED_LONG_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, UnsignedLong) #define FIND_REQUIRED_SHORT_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, Short) #define FIND_REQUIRED_CHAR_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, Char) #define FIND_REQUIRED_FLOAT_VALUE(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_VALUE(NAME_VALUE_LIST, VARIABLE, Float) @@ -152,6 +156,8 @@ if (!find##TYPE##Array(&NAME_VALUE_LIST, &VARIABLE, CONCAT(&n, VARIABLE), QUOTE( #define FIND_REQUIRED_DOUBLE_ARRAY(NAME_VALUE_LIST, VARIABLE) FIND_REQUIRED_ARRAY(NAME_VALUE_LIST, VARIABLE, Double) #define FIND_INT_VALUE(NAME_VALUE_LIST, VARIABLE) findIntValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) +#define FIND_LONG_VALUE(NAME_VALUE_LIST, VARIABLE) findLongIntValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) +#define FIND_UNSIGNED_LONG_VALUE(NAME_VALUE_LIST, VARIABLE) findUnsignedLongValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) #define FIND_SHORT_VALUE(NAME_VALUE_LIST, VARIABLE) findShortValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) #define FIND_CHAR_VALUE(NAME_VALUE_LIST, VARIABLE) findCharValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) #define FIND_FLOAT_VALUE(NAME_VALUE_LIST, VARIABLE) findFloatValue(&NAME_VALUE_LIST, &VARIABLE, QUOTE(VARIABLE)) diff --git a/source/wrappers/python/README.md b/source/wrappers/python/README.md index b581c2587..bcc974aa2 100644 --- a/source/wrappers/python/README.md +++ b/source/wrappers/python/README.md @@ -19,4 +19,4 @@ signal_object = client.get(signal, source) ``` ## Old release versions -Releases 2.7.6-2.8.1 were uploaded to the uda project on pypi [here](https://pypi.org/project/uda). The project moved here under the pyuda name for release 2.8.2. +Releases 2.7.6-2.8.1 were uploaded to the uda project on pypi [here](https://pypi.org/project/uda). The project moved here under the pyuda name for release 2.9.0. diff --git a/source/wrappers/python/pyuda/_client.py b/source/wrappers/python/pyuda/_client.py index 7ae3087e4..d5632f141 100644 --- a/source/wrappers/python/pyuda/_client.py +++ b/source/wrappers/python/pyuda/_client.py @@ -117,7 +117,7 @@ def get_file(self, source_file, output_file=None, chunk_size=1): chunk_size = 0 if chunk_size: - result = cpyuda.get_data("bytes::size(path={path})".format(path=source_file) % source_file, "") + result = cpyuda.get_data("bytes::size(path={path})".format(path=source_file), "") size = result.data() chunk_size = int(chunk_size * 1024 * 1024) count = 0 diff --git a/source/wrappers/python/uda/README.md b/source/wrappers/python/uda/README.md index 51078d671..c49dcb2fc 100644 --- a/source/wrappers/python/uda/README.md +++ b/source/wrappers/python/uda/README.md @@ -7,7 +7,7 @@ Install the new package directly using: pip install pyuda ``` -Previous release versions (2.7.6-2.8.1) are still hosted here. The first release under the new pyuda name is 2.8.2. +Previous release versions (2.7.6-2.8.1) are still hosted here. The first release under the new pyuda name is 2.9.0. ## Pyuda package description From a2f66bb592068cd6608210e5fa8804b838d141ff Mon Sep 17 00:00:00 2001 From: munechika-koyo Date: Sun, 23 Nov 2025 22:29:20 +0100 Subject: [PATCH 17/17] Fix: Update library naming in setup script --- source/wrappers/python/win.setup.py.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/wrappers/python/win.setup.py.in b/source/wrappers/python/win.setup.py.in index 336041cf1..4deb1dfe5 100644 --- a/source/wrappers/python/win.setup.py.in +++ b/source/wrappers/python/win.setup.py.in @@ -45,8 +45,8 @@ if build_fat: extra_macros = [('FATCLIENT', None)] else: uda_libs = [ - '@PROJECT_NAME@_client.' + stalib_ext, - ] + ['@PROJECT_NAME@_' + name + '.' + stalib_ext for name in uda_lib_names] + '@PROJECT_NAME@_client', + ] + ['@PROJECT_NAME@_' + name for name in uda_lib_names] extra_libs = '@EXTRA_LIBS@'.split(';') if '@EXTRA_LIBS@' else [] extra_macros = []