Skip to content
Merged
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
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,12 @@ endif()
file(GLOB source_files ${LIBSUPERMESH_SOURCE_DIR}/src/*.F90 ${LIBSUPERMESH_SOURCE_DIR}/src/*.c ${LIBSUPERMESH_SOURCE_DIR}/src/*.cpp)
if("${SKBUILD}" STREQUAL 2)
file(GLOB python_source_files ${LIBSUPERMESH_SOURCE_DIR}/src/supermesh/*.py)
# On macOS, the latest clang linker has a bug where some symbols do not
# appear in the dylib. Building a static library resolves this.
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
# There appears to be a bug with gfortran 16.2.1 (observed on macOS and Arch Linux)
# where some symbols do not appear in the shared library. Building a static library
# resolves this. I am pretty confident that the issue is with gfortran because that
# is the only shared component between the systems.
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "16.2.1")
message(STATUS "Building static library to workaround bug in gfortran >=16.2.1")
add_library(supermesh STATIC ${source_files} ${python_source_files})
else()
add_library(supermesh SHARED ${source_files} ${python_source_files})
Expand Down
Loading