Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ add_subdirectory(src)
set( EXE_FLAG )
set( EXE_EXT )
add_executable( imas_print_version ${EXE_FLAG} tests/imas_print_version.cpp )
target_link_libraries( imas_print_version PRIVATE al stdc++fs )
target_link_libraries( imas_print_version PRIVATE al )
if(NOT WIN32 AND NOT APPLE)
# stdc++fs is only needed on Linux with older GCC
# On macOS, filesystem is part of libc++
# On Windows, filesystem is part of the standard library
target_link_libraries( imas_print_version PRIVATE stdc++fs )
endif()
add_dependencies( imas_print_version al )

# Install
Expand Down
43 changes: 33 additions & 10 deletions common/cmake/ALBuildDataDictionary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,44 @@ endif()

if( NOT AL_DOWNLOAD_DEPENDENCIES AND NOT AL_DEVELOPMENT_LAYOUT )
# The DD easybuild module should be loaded, use that module:
if( "$ENV{IMAS_PREFIX}" STREQUAL "" OR "$ENV{IMAS_VERSION}" STREQUAL "" )
message( FATAL_ERROR
"Environment variables IMAS_PREFIX ('$ENV{IMAS_PREFIX}') or "
"IMAS_VERSION ('$ENV{IMAS_VERSION}') not set."
# Use idsinfo idspath command to get the path to IDSDef.xml or data_dictionary.xml
execute_process(
COMMAND idsinfo idspath
OUTPUT_VARIABLE IDSDEF
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _IDSINFO_EXITCODE
)

if( _IDSINFO_EXITCODE )
message( FATAL_ERROR
"Failed to run 'idsinfo idspath' command. "
"Please ensure IMAS-Data-Dictionary module is loaded."
)
endif()

# Populate IDSDEF filename
set( IDSDEF "$ENV{IMAS_PREFIX}/include/IDSDef.xml" )

if( NOT EXISTS "${IDSDEF}" )
message( FATAL_ERROR "Could not find IDSDef.xml at '${IDSDEF}'." )
message( FATAL_ERROR
"idsinfo idspath returned '${IDSDEF}' but file does not exist. "
"Please ensure IMAS-Data-Dictionary module is properly loaded."
)
endif()

message( STATUS "Found Data Dictionary: ${IDSDEF}" )

# Populate identifier source xmls
file( GLOB DD_IDENTIFIER_FILES "$ENV{IMAS_PREFIX}/include/*/*_identifier.xml" )
# Populate identifier source xmls based on the IDSDEF location
get_filename_component( DD_BASE_DIR "${IDSDEF}" DIRECTORY )

if( DD_BASE_DIR MATCHES "schemas$" )
# DD 4.1.0+ layout: resources/schemas/<ids_name>/*_identifier.xml
file( GLOB DD_IDENTIFIER_FILES "${DD_BASE_DIR}/*/*_identifier.xml" )
else()
# DD 3.x/4.0.0 layout: dd_x.y.z/include/<ids_name>/*_identifier.xml
file( GLOB DD_IDENTIFIER_FILES "${DD_BASE_DIR}/*/*_identifier.xml" )
endif()

if( NOT DD_IDENTIFIER_FILES )
message( WARNING "No identifier XML files found in Data Dictionary at: ${IDSDEF}" )
endif()
else()
# Build the DD from source:
include(FetchContent)
Expand Down
33 changes: 22 additions & 11 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ if(DEFINED ENV{LD_LIBRARY_PATH})
else()
set(LIBRARY_DIRS)
endif()

# Build POST_EXCLUDE_REGEXES list based on platform
set(POST_EXCLUDE_PATTERNS
".*system32/.*\\.dll" # Windows system DLLs
"^/(lib|usr/lib|usr/local/lib)" # Unix system libraries
"iccifort/.*/lib/intel64/lib" # Redundant iccifort
)

# Add Linux-specific exclusions
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND POST_EXCLUDE_PATTERNS
".*/imkl/.*/compiler/.*/linux/compiler/lib" # Intel MKL compiler libraries
".*/intel-compilers/.*/compiler/.*/linux/compiler/lib" # Intel compilers libraries
"^libomp\\.so" # OpenMP libraries
"^libsvml\\.so" # Intel SVML math library
"^libirng\\.so" # Intel RNG library
"^libintlc\\.so" # Intel intlc library
"^libimf\\.so" # Intel IMF library (math functions)
)
endif()

install(
TARGETS al
DESTINATION imas_core.libs
Expand All @@ -25,16 +46,6 @@ install(
PRE_EXCLUDE_REGEXES
"api-ms-" # VC Redistibutable DLLs
"ext-ms-" # Windows extension DLLs
POST_EXCLUDE_REGEXES
".*system32/.*\\.dll" # Windows system DLLs
"^/(lib|usr/lib|usr/local/lib)" # Unix system libraries
"iccifort/.*/lib/intel64/lib" # Redundant iccifort
".*/imkl/.*/compiler/.*/linux/compiler/lib" # Intel MKL compiler libraries
".*/intel-compilers/.*/compiler/.*/linux/compiler/lib" # Intel compilers libraries
"^libomp\\.so" # OpenMP libraries
"^libsvml\\.so" # Intel SVML math library
"^libirng\\.so" # Intel RNG library
"^libintlc\\.so" # Intel intlc library
"^libimf\\.so" # Intel IMF library (math functions)
POST_EXCLUDE_REGEXES ${POST_EXCLUDE_PATTERNS}
)
install(TARGETS _al_lowlevel al_defs DESTINATION imas_core)
Loading