Permalink
Browse files

CMake now knows PCM

  • Loading branch information...
Jakob Kottmann
Jakob Kottmann committed May 15, 2018
1 parent ad3cb80 commit 131376d6fb3d2e57c44fd6a5cbd38088bb2c298c
@@ -60,8 +60,9 @@ option(ENABLE_ACML "Search for AMD Core Math Library (ACML) for BLAS and LAPACK
option(ENABLE_TCMALLOC_MINIMAL "Enable use of tcmalloc_minimal library from Google Performance Tools (gperftools)" OFF)
cmake_dependent_option(ENABLE_GPERFTOOLS "Enable use of Google Performance Tools (gperftools)" ON
"NOT ENABLE_TCMALLOC_MINIMAL" OFF)
option(ENABLE_LIBXC "Enables use of the libxc library of density functionals" ON)
option(ENABLE_PAPI "Enables use of PAPI" OFF)
option(ENABLE_LIBXC "Enables use of the libxc library of density functionals" ON)
option(ENABLE_PCM "Enables use of the polarizable continuum model library" ON)
option(ENABLE_TBB "Enables use of Intel Thread Building Blocks (TBB) as the task scheduler" ON)
option(ENABLE_PARSEC "Enables use of PaRSEC as the task scheduler" OFF)
@@ -515,6 +516,7 @@ include(external/mpi.cmake)
include(external/papi.cmake)
include(external/lapack.cmake)
include(external/libxc.cmake)
include(external/pcm.cmake)
include(external/libunwind.cmake)
include(external/gperftools.cmake)
include(external/tbb.cmake)
@@ -156,6 +156,18 @@ Library of Exchange-Correlation DFT functionals (LIBXC):
* LIBXC_INCLUDE_DIR --- The path to the LIBXC include directory.
* LIBXC_LIBRARY --- The path to the LIBXC library directory.
Polarizable Conitinuum Solver (PCM):
* ENABLE_PCM --- Enables use of PCM
* PCM_ROOT_DIR --- The install prefix for PCM
* PCM_INCLUDE_DIR --- The path to the PCM include directory (should be added automatically when the correct PCM_ROOT_DIR is given)
* PCM_LIBRARY --- The path to the PCM library (should be added automatically when the correct PCM_ROOT_DIR is given)
set either PCM_ROOT_DIR or manually set PCM_INCLUDE_DIR and PCM_LIBRARY
See also
madness/CMakeLists.txt
madness/external/pcm.cmake
madness/modules/FindPCM.cmake
madness/src/apps/chem/CMakeLists.txt
Performance Application Programming Interface (PAPI):
* ENABLE_PAPI --- Enables use of PAPI [default=OFF]
@@ -48,6 +48,7 @@
#cmakedefine HAVE_INTEL_MKL 1
#cmakedefine HAVE_PAPI 1
#cmakedefine MADNESS_HAS_LIBXC 1
#cmakedefine MADNESS_HAS_PCM 1
#cmakedefine MADNESS_HAS_ELEMENTAL 1
#cmakedefine MADNESS_HAS_ELEMENTAL_EMBEDDED 1
#cmakedefine MADNESS_HAS_GOOGLE_PERF_MINIMAL 1
@@ -48,4 +48,4 @@ if(NOT LIBXC_FOUND)
mark_as_advanced(LIBXC_INCLUDE_DIR LIBXC_LIBRARY
LIBXC_INCLUDE_DIRS LIBXC_LIBRARIES)
endif()
endif()
@@ -105,4 +105,4 @@ if(NOT MKL_FOUND)
REQUIRED_VARS MKL_LIBRARIES MKL_INCLUDE_DIRS
HANDLE_COMPONENTS)
endif()
endif()
@@ -0,0 +1,48 @@
# - Try to find PCM
# Input variables:
# PCM_ROOT_DIR - The pcm install directory
# PCM_INCLUDE_DIR - The pcm include directory | optional, else determined from PCM_ROOT_DIR, dont set PCM_ROOT_DIR if you want to use this
# PCM_LIBRARY - The pcm library directory | optional, else determined from PCM_ROOT_DIR, ...
# Output variables:
# PCM_FOUND - System has pcm
# PCM_INCLUDE_DIRS - The pcm include directories
# PCM_LIBRARIES - The libraries needed to use pcm
# PCM_VERSION - The version string for pcm | currently unused
include(FindPackageHandleStandardArgs)
if(NOT PCM_FOUND)
# define include and library directories based on root directory
if(PCM_ROOT_DIR)
set(PCM_INCLUDE_DIR ${PCM_ROOT_DIR}/include/ CACHE PATH "The include directory for PCM")
set(PCM_LIBRARY ${PCM_ROOT_DIR}/lib CACHE PATH "Linker Flags for PCM Library")
endif()
find_path(PCM_INCLUDE_DIRS NAMES PCMSolver/pcmsolver.h
HINTS ${PCM_INCLUDE_DIR})
find_library(PCM_LIBRARIES NAMES pcm
HINTS ${PCM_LIBRARY})
# Get PCM version
# if(PCM_INCLUDE_DIRS)
# file(READ "${PCM_INCLUDE_DIRS}/GitInfo.hpp" _PCM_version_header)
# string(REGEX MATCH "define[ \t]+PCM_VERSION[ \t]+\\\"([0-9\\.]+)\\\""
# PCM_VERSION "${_PCM_version_header}")
# string(REGEX MATCH "([0-9\\.]+)" PCM_VERSION "${PCM_VERSION}")
# unset(_PCM_version_header)
# endif()
# handle the QUIETLY and REQUIRED arguments and set PCM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(PCM
FOUND_VAR PCM_FOUND
VERSION_VAR PCM_VERSION
REQUIRED_VARS PCM_LIBRARIES PCM_INCLUDE_DIRS)
mark_as_advanced(PCM_INCLUDE_DIR PCM_LIBRARY
PCM_INCLUDE_DIRS PCM_LIBRARIES)
endif()
@@ -125,4 +125,4 @@ if(NOT TBB_FOUND)
mark_as_advanced(TBB_INCLUDE_DIR TBB_LIBRARY TBB_INCLUDE_DIRS TBB_LIBRARIES)
endif()
endif()
@@ -7,4 +7,4 @@ if(ENABLE_LIBXC)
set(MADNESS_HAS_LIBXC 1)
endif()
endif()
endif()
@@ -0,0 +1,10 @@
if(ENABLE_PCM)
find_package(PCM COMPONENTS pcm)
# Set the output variables
if(PCM_FOUND)
set(MADNESS_HAS_PCM 1)
endif()
endif()
@@ -33,6 +33,12 @@ if(LIBXC_FOUND)
target_link_libraries(MADchem PUBLIC ${LIBXC_LIBRARIES})
endif()
if(PCM_FOUND)
target_include_directories(MADchem PUBLIC ${PCM_INCLUDE_DIRS})
target_link_libraries(MADchem PUBLIC ${PCM_LIBRARIES})
endif()
# Add executables
add_executable(plotxc plotxc.cc xcfunctional.h)
target_link_libraries(plotxc MADchem)

0 comments on commit 131376d

Please sign in to comment.