Fix clFFT build without GMX_LOAD_PLUGINS
authorRoland Schulz <roland.schulz@intel.com>
Tue, 23 Jun 2020 21:53:29 +0000 (14:53 -0700)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 24 Jun 2020 06:01:06 +0000 (06:01 +0000)
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.

cmake/gmxManagePluginSupport.cmake
cmake/gmxTestdlopen.cmake
src/external/clFFT/src/CMakeLists.txt

index 2516776a33767d8acaf51b4085e074faa536d643..83babae4850b7afb835f4100ec28059c751c805e 100644 (file)
@@ -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)
index 3a454711783c32d6ee33f1cc2b365d1144d59430..00aee08091cba4307e99b68559dc87ae1935c9cf 100644 (file)
@@ -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 <dlfcn.h>
index b5bcdd87b5f679a1f4e6f3c340f326c0a5dbc1e0..0a0d57dce6cce1fd5439d258807a5f595aaceee0 100644 (file)
@@ -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()