From: Matthias Maier Date: Sat, 3 Dec 2022 04:11:13 +0000 (-0600) Subject: CMake: Remove DEAL_II_STATIC_EXECUTABLE configure option X-Git-Tag: v9.5.0-rc1~758^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3d95892c87817fd573f24e841d6ad294c752e7e;p=dealii.git CMake: Remove DEAL_II_STATIC_EXECUTABLE configure option --- diff --git a/cmake/checks/check_02_compiler_features.cmake b/cmake/checks/check_02_compiler_features.cmake index c3a112afe5..39e6c3f52e 100644 --- a/cmake/checks/check_02_compiler_features.cmake +++ b/cmake/checks/check_02_compiler_features.cmake @@ -141,7 +141,7 @@ CHECK_CXX_SOURCE_COMPILES( " DEAL_II_HAVE_GLIBC_STACKTRACE) -if(DEAL_II_HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE) +if(DEAL_II_HAVE_GLIBC_STACKTRACE) enable_if_links(DEAL_II_LINKER_FLAGS "-rdynamic") endif() diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in index 1dca5d105c..352ac3cbdb 100644 --- a/cmake/config/Config.cmake.in +++ b/cmake/config/Config.cmake.in @@ -152,13 +152,6 @@ set(DEAL_II_MPIEXEC_NUMPROC_FLAG "@MPIEXEC_NUMPROC_FLAG@") set(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@") set(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@") -# -# Build a static executable: -# - -set(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@") - - # # Information about include directories and libraries # diff --git a/cmake/macros/macro_deal_ii_setup_target.cmake b/cmake/macros/macro_deal_ii_setup_target.cmake index 89d4014e3e..3b331f3026 100644 --- a/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_setup_target.cmake @@ -144,14 +144,4 @@ macro(deal_ii_setup_target _target) target_link_libraries(${_target} ${DEAL_II_TARGET_${_build}}) endif() - # - # If DEAL_II_STATIC_EXECUTABLE is set, switch the final link type to - # static: - # - if(DEAL_II_STATIC_EXECUTABLE) - set_property(TARGET ${_target} PROPERTY - LINK_SEARCH_END_STATIC TRUE - ) - endif() - endmacro() diff --git a/cmake/macros/macro_switch_library_preference.cmake b/cmake/macros/macro_switch_library_preference.cmake index 9b2dbe9551..4070caca69 100644 --- a/cmake/macros/macro_switch_library_preference.cmake +++ b/cmake/macros/macro_switch_library_preference.cmake @@ -15,15 +15,14 @@ # # This macro toggles the preference for static/shared libraries if -# DEAL_II_PREFER_STATIC_LIBS=TRUE but the final executable will still be -# dynamically linked, i.e. DEAL_II_STATIC_EXECUTABLE=OFF +# DEAL_II_PREFER_STATIC_LIBS=TRUE. # # Usage: # switch_library_preference() # macro(switch_library_preference) - if(DEAL_II_PREFER_STATIC_LIBS AND NOT DEAL_II_STATIC_EXECUTABLE) + if(DEAL_II_PREFER_STATIC_LIBS) # # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS # is set. This will prefer static archives instead of shared libraries: diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index 91a58bd8b6..e3c2a55121 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -37,7 +37,6 @@ # DEAL_II_EARLY_DEPRECATIONS # BUILD_SHARED_LIBS # DEAL_II_PREFER_STATIC_LIBS -# DEAL_II_STATIC_EXECUTABLE # CMAKE_INSTALL_RPATH_USE_LINK_PATH # DEAL_II_CXX_FLAGS *) # DEAL_II_CXX_FLAGS_DEBUG @@ -178,23 +177,6 @@ option(DEAL_II_PREFER_STATIC_LIBS ) mark_as_advanced(DEAL_II_PREFER_STATIC_LIBS) -option(DEAL_II_STATIC_EXECUTABLE - "Provide a link interface that is suitable for static linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON" - OFF - ) -mark_as_advanced(DEAL_II_STATIC_EXECUTABLE) - -if(DEAL_II_STATIC_EXECUTABLE) - set(BUILD_SHARED_LIBS "OFF" CACHE BOOL - "Build a shared library" - FORCE - ) - set(DEAL_II_PREFER_STATIC_LIBS "ON" CACHE BOOL - "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface" - FORCE - ) -endif() - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL "Set the rpath of the library to the external link paths on installation" ) diff --git a/cmake/setup_compiler_flags_gnu.cmake b/cmake/setup_compiler_flags_gnu.cmake index 72b6a2d6c1..08e141fa1e 100644 --- a/cmake/setup_compiler_flags_gnu.cmake +++ b/cmake/setup_compiler_flags_gnu.cmake @@ -168,16 +168,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() -if(DEAL_II_STATIC_EXECUTABLE) - # - # To produce a static executable, we have to statically link libstdc++ - # and gcc's support libraries and glibc: - # - enable_if_supported(DEAL_II_LINKER_FLAGS "-static") - enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread") -endif() - - ############################# # # # For Release target: # diff --git a/cmake/setup_compiler_flags_intel.cmake b/cmake/setup_compiler_flags_intel.cmake index 9b761091b5..0b7d70c4b2 100644 --- a/cmake/setup_compiler_flags_intel.cmake +++ b/cmake/setup_compiler_flags_intel.cmake @@ -147,23 +147,6 @@ enable_if_supported(DEAL_II_CXX_FLAGS "-wd186") enable_if_supported(DEAL_II_CXX_FLAGS "-wd280") -if(DEAL_II_STATIC_EXECUTABLE) - # - # To produce a static executable, we have to statically link intel's - # support libraries: - # - enable_if_supported(DEAL_II_LINKER_FLAGS "-static") - enable_if_supported(DEAL_II_LINKER_FLAGS "-static-intel") - enable_if_supported(DEAL_II_LINKER_FLAGS "-static-gcc") - enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread") -else() - # - # Explicitly link intel support libraries dynamically: - # - enable_if_supported(DEAL_II_LINKER_FLAGS "-shared-intel") -endif() - - ############################# # # # For Release target: # diff --git a/cmake/setup_write_config.cmake b/cmake/setup_write_config.cmake index 379f051279..bf1d3ef422 100644 --- a/cmake/setup_write_config.cmake +++ b/cmake/setup_write_config.cmake @@ -103,12 +103,6 @@ if(CMAKE_CROSSCOMPILING) ) endif() -if(DEAL_II_STATIC_EXECUTABLE) - _both( - "#\n# STATIC LINKAGE!\n" - ) -endif() - _both("#\n") _detailed( diff --git a/doc/users/cmake_dealii.html b/doc/users/cmake_dealii.html index c4120ba691..96f9181342 100644 --- a/doc/users/cmake_dealii.html +++ b/doc/users/cmake_dealii.html @@ -791,14 +791,6 @@ cmake -DLAPACK_FOUND=true \ to true, static archives will be preferred over dynamic libraries when searching for features and corresponding link interface. -
  • - DEAL_II_STATIC_EXECUTABLE (defaults to off): - If set to true, deal.II will be configured in - a way to provide a link interface that is suitable for static - linkage of executables. Enabling this option forces - BUILD_SHARED_LIBS=OFF and - DEAL_II_PREFER_STATIC_LIBS=ON. -
  • CMAKE_INSTALL_RPATH_USE_LINK_PATH: If set (default), the deal.II library will be diff --git a/doc/users/cmake_user.html b/doc/users/cmake_user.html index b6f2fc4374..d847e43f3b 100644 --- a/doc/users/cmake_user.html +++ b/doc/users/cmake_user.html @@ -811,10 +811,6 @@ DEAL_II_MPIEXEC_NUMPROC_FLAG DEAL_II_MPIEXEC_PREFLAGS DEAL_II_MPIEXEC_POSTFLAGS - -DEAL_II_STATIC_EXECUTABLE - true if the link interface is set up to - compile resulting executables statically - # # Information about include directories and libraries # diff --git a/doc/users/config.sample b/doc/users/config.sample index e01d24f8d5..42cf98fca6 100644 --- a/doc/users/config.sample +++ b/doc/users/config.sample @@ -53,7 +53,6 @@ # set(DEAL_II_EARLY_DEPRECATIONS OFF CACHE BOOL "") # set(BUILD_SHARED_LIBS "ON" CACHE BOOL "") # set(DEAL_II_PREFER_STATIC_LIBS "OFF" CACHE BOOL "") -# set(DEAL_II_STATIC_EXECUTABLE "OFF" CACHE BOOL "") # set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL "") #