From: Roland Schulz Date: Tue, 23 Jun 2020 21:53:29 +0000 (-0700) Subject: Fix clFFT build without GMX_LOAD_PLUGINS X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=9ce9d140340c313a0cbefaa1c3132134cf55989a;p=alexxy%2Fgromacs.git Fix clFFT build without GMX_LOAD_PLUGINS It only happened to work before 649af69b44d503 because GMX_LOAD_PLUGINS was on by default and it added the required dl library. Also fixes that we reuse the same code for checking for dlopen. --- diff --git a/cmake/gmxManagePluginSupport.cmake b/cmake/gmxManagePluginSupport.cmake index 2516776a33..83babae485 100644 --- a/cmake/gmxManagePluginSupport.cmake +++ b/cmake/gmxManagePluginSupport.cmake @@ -53,9 +53,6 @@ macro(gmx_manage_plugin_support) # Plugins are supported natively on Windows, so nothing to check if WIN32 is set if (NOT WIN32) - # TODO Make a proper find_package for dlopen to find - # dlfcn.h. The CMake variable CMAKE_DL_LIBS works magically - # for the library, however. include(gmxTestdlopen) gmx_test_dlopen(HAVE_DLOPEN) if(NOT HAVE_DLOPEN) diff --git a/cmake/gmxTestdlopen.cmake b/cmake/gmxTestdlopen.cmake index 3a45471178..00aee08091 100644 --- a/cmake/gmxTestdlopen.cmake +++ b/cmake/gmxTestdlopen.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2015, by the GROMACS development team, led by +# Copyright (c) 2012,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -44,6 +44,9 @@ MACRO(GMX_TEST_DLOPEN VARIABLE) MESSAGE(STATUS "Checking for dlopen") set(CMAKE_REQUIRED_INCLUDES "dlfcn.h") + # TODO Make a proper find_package for dlopen to find + # dlfcn.h. The CMake variable CMAKE_DL_LIBS works magically + # for the library, however. set(CMAKE_REQUIRED_LIBRARIES "dl") check_c_source_compiles( "#include diff --git a/src/external/clFFT/src/CMakeLists.txt b/src/external/clFFT/src/CMakeLists.txt index b5bcdd87b5..0a0d57dce6 100644 --- a/src/external/clFFT/src/CMakeLists.txt +++ b/src/external/clFFT/src/CMakeLists.txt @@ -18,8 +18,8 @@ endif() # Windows doesn't need anything special to load the dynamic libraries # that the AMD clFFT implementation uses, but *nix and BSD do. if (NOT WIN32) - include(CheckCXXSymbolExists) - check_cxx_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN) + include(gmxTestdlopen) + gmx_test_dlopen(HAVE_DLOPEN) if (NOT HAVE_DLOPEN) message(FATAL_ERROR "Cannot use clFFT for OpenCL support unless dlopen is available") endif()