File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,22 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL Compaq)
207207 endif ()
208208endif ()
209209
210+ # Add option to enable flat namespace for symbol resolution on macOS
211+ if (APPLE )
212+ option (USE_FLAT_NAMESPACE "Use flat namespaces for symbol resolution during build and runtime." OFF )
213+
214+ if (USE_FLAT_NAMESPACE)
215+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-flat_namespace" )
216+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace" )
217+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-flat_namespace" )
218+ else ()
219+ if (BUILD_SHARED_LIBS AND BUILD_TESTING)
220+ message (WARNING
221+ "LAPACK test suite might fail with shared libraries and the default two-level namespace. "
222+ "Disable shared libraries or enable flat namespace for symbol resolution via -DUSE_FLAT_NAMESPACE=ON." )
223+ endif ()
224+ endif ()
225+ endif ()
210226
211227# --------------------------------------------------
212228set (LAPACK_INSTALL_EXPORT_NAME ${LAPACKLIB} -targets)
You can’t perform that action at this time.
0 commit comments