Commit 4ca1220e authored by Yves Ineichen's avatar Yves Ineichen
Browse files

Merge branch 'develop' into svn: merging my cmake cleanup with Christofs changes:

    - deleting obsolete find modules
    - using HINT and adding default library and include path
      (CPP_INCLUDE_PATH and LIBRARY_PATH) in GSL, H5hut and HDF5 find modules
parent 7f344c99
......@@ -2,9 +2,7 @@
/CMakeLists.txt -text
CMakeModules/FindGSL.cmake -text
CMakeModules/FindH5Hut.cmake -text
CMakeModules/FindH5Part.cmake -text
CMakeModules/FindHDF5.cmake -text
CMakeModules/FindIPPL.cmake -text
/Doxyfile -text
/README -text
classic/5.0/src/AbsBeamline/AlignWrapper.cpp -text
......
......@@ -6,14 +6,33 @@ SET (OPAL_VERSION_MINOR 1.9)
SET (CMAKE_CXX_COMPILER ${MPI_COMPILER})
IF (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE RelWithDebInfo)
SET (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
ENDIF (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
MESSAGE (STATUS "Build type is: " ${CMAKE_BUILD_TYPE})
# Select flags.
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET (CMAKE_CXX_FLAGS_RELEASE "-O2")
SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
# Resolve all library dependencies
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
FIND_PACKAGE (IPPL REQUIRED HINTS $ENV{IPPL_PREFIX})
MESSAGE (STATUS "Found IPPL library dir: ${IPPL_LIBRARY_DIR}")
MESSAGE (STATUS "Found IPPL include dir: ${IPPL_INCLUDE_DIR}")
FIND_PACKAGE (H5Hut REQUIRED)
FIND_PACKAGE (HDF5 REQUIRED)
FIND_PACKAGE (GSL REQUIRED)
# Handle options
OPTION (ENABLE_ML_SOLVER "Enable iteartive SA-AMG-PCG self field solver" OFF)
OPTION (DBG_SCALARFIELD "Enable dump of scalar field rho_m" OFF)
......@@ -23,15 +42,6 @@ OPTION (BUILD_LIBOPAL "Enable building the OPAL library" OFF)
OPTION (NOCPLUSPLUS11_FOREACH "Disable C++11 foreach support" OFF)
OPTION (NOCPLUSPLUS11_NULLPTR "Disable C++11 nullptr support" OFF)
SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
FIND_PACKAGE (IPPL REQUIRED
PATHS /usr/local/include /usr/include $ENV{IPPL_PREFIX})
MESSAGE (STATUS "Found IPPL library dir: ${IPPL_LIBRARY_DIR}")
MESSAGE (STATUS "Found IPPL include dir: ${IPPL_INCLUDE_DIR}")
FIND_PACKAGE (H5Hut REQUIRED)
FIND_PACKAGE (HDF5 REQUIRED)
FIND_PACKAGE (GSL REQUIRED)
IF (DBG_SCALARFIELD)
MESSAGE (STATUS "\nWrite scalar rho_m field is enabled ")
......@@ -92,9 +102,9 @@ IF (ENABLE_ML_SOLVER)
#SET(CMAKE_CXX_FLAGS "${Trilinos_CXX_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}")
#SET(CMAKE_C_FLAGS "${Trilinos_C_COMPILER_FLAGS} ${CMAKE_C_FLAGS}")
#SET(CMAKE_Fortran_FLAGS "${Trilinos_Fortran_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}")
ENDIF (ENABLE_ML_SOLVER)
# compiler dependent flags
STRING (REGEX REPLACE ".*/([A-Za-z]*)$" "\\1" COMPILER_NAME ${CMAKE_CXX_COMPILER})
MESSAGE (STATUS "Your compiler is: ${COMPILER_NAME}")
......@@ -155,6 +165,7 @@ SET (CMAKE_CXX_FLAGS
MESSAGE (STATUS "Compiling with ${CMAKE_CXX_FLAGS}")
ADD_SUBDIRECTORY (classic/5.0/src)
ADD_SUBDIRECTORY (src)
#
# Find GSL includes and library
#
# GSL
# GSL
# It can be found at:
# http://amas.web.psi.ch/tools/GSL/index.html
#
......@@ -10,29 +10,19 @@
# GSL_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_fft.h
PATHS $ENV{GSL_PREFIX}/include
NO_DEFAULT_PATH
)
FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_fft.h
/usr/include
/usr/local/include
HINTS $ENV{GSL_PREFIX}/include
PATHS ENV CPP_INCLUDE_PATH
)
FIND_LIBRARY(GSL_LIBRARY gsl
PATHS $ENV{GSL_PREFIX}/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(GSL_LIBRARY gsl
/usr/lib
/usr/local/lib
)
FIND_LIBRARY(GSL_LIBRARY_CBLAS gslcblas
PATHS $ENV{GSL_PREFIX}/lib
NO_DEFAULT_PATH
HINTS $ENV{GSL_PREFIX}/lib
PATHS ENV LIBRARY_PATH
)
FIND_LIBRARY(GSL_LIBRARY_CBLAS gslcblas
/usr/lib
/usr/local/lib
FIND_LIBRARY(GSL_LIBRARY_CBLAS gslcblas
HINTS $ENV{GSL_PREFIX}/lib
PATHS ENV LIBRARY_PATH
)
set( GSL_LIBRARY
......@@ -46,7 +36,8 @@ ENDIF(GSL_INCLUDE_DIR AND GSL_LIBRARY)
IF (GSL_FOUND)
IF (NOT GSL_FIND_QUIETLY)
MESSAGE(STATUS "Found GSL: ${GSL_LIBRARY}")
MESSAGE(STATUS "Found GSL library dir: ${GSL_LIBRARY}")
MESSAGE(STATUS "Found GSL include dir: ${GSL_INCLUDE_DIR}")
ENDIF (NOT GSL_FIND_QUIETLY)
ELSE (GSL_FOUND)
IF (GSL_FIND_REQUIRED)
......
......@@ -10,34 +10,20 @@
# H5Hut_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH(H5Hut_INCLUDE_DIR H5hut.h
PATHS $ENV{H5hut}/src $ENV{H5hut}/include
NO_DEFAULT_PATH
)
FIND_PATH(H5Hut_INCLUDE_DIR H5hut.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(H5Hut_LIBRARY H5hut
PATHS $ENV{H5hut}/lib
NO_DEFAULT_PATH
HINTS $ENV{H5hut}/src $ENV{H5hut}/include
PATHS ENV CPP_INCLUDE_PATH
)
FIND_LIBRARY(H5Hut_LIBRARY H5hut
/usr/local/lib
/usr/lib
HINTS $ENV{H5hut}/lib
PATHS ENV LIBRARY_PATH
)
FIND_LIBRARY(H5Hut_LIBRARY_C H5hutC
PATHS $ENV{H5hut}/lib
NO_DEFAULT_PATH
HINTS $ENV{H5hut}/lib
PATHS ENV LIBRARY_PATH
)
FIND_LIBRARY(H5Hut_LIBRARY_C H5hutC
/usr/local/lib
/usr/lib
)
IF(H5Hut_INCLUDE_DIR AND H5Hut_LIBRARY)
SET( H5Hut_FOUND "YES" )
......@@ -45,7 +31,8 @@ ENDIF(H5Hut_INCLUDE_DIR AND H5Hut_LIBRARY)
IF (H5Hut_FOUND)
IF (NOT H5Hut_FIND_QUIETLY)
MESSAGE(STATUS "Found H5Hut: ${H5Hut_LIBRARY}; ${H5Hut_LIBRARY_C}")
MESSAGE(STATUS "Found H5Hut library dir: ${H5Hut_LIBRARY}; ${H5Hut_LIBRARY_C}")
MESSAGE(STATUS "Found H5Hut include dir: ${H5Hut_INCLUDE_DIR}")
ENDIF (NOT H5Hut_FIND_QUIETLY)
ELSE (H5Hut_FOUND)
IF (H5Hut_FIND_REQUIRED)
......
#
# Find H5Part includes and library
#
# H5Part
# It can be found at:
# http://amas.web.psi.ch/tools/H5Part/index.html
#
# H5Part_INCLUDE_DIR - where to find ippl.h
# H5Part_LIBRARY - qualified libraries to link against.
# H5Part_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH(H5Part_INCLUDE_DIR H5Part.h
PATHS $ENV{H5Part}/src $ENV{H5Part}/include
NO_DEFAULT_PATH
)
FIND_PATH(H5Part_INCLUDE_DIR H5Part.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(H5Part_LIBRARY pH5Part
PATHS $ENV{H5Part}/src $ENV{H5Part}/lib
)
FIND_LIBRARY(H5Part_LIBRARY pH5Part
/usr/local/lib
/usr/lib
)
IF(H5Part_INCLUDE_DIR AND H5Part_LIBRARY)
SET( H5Part_FOUND "YES" )
ENDIF(H5Part_INCLUDE_DIR AND H5Part_LIBRARY)
IF (H5Part_FOUND)
IF (NOT H5Part_FIND_QUIETLY)
MESSAGE(STATUS "Found H5Part: ${H5Part_LIBRARY}")
ENDIF (NOT H5Part_FIND_QUIETLY)
ELSE (H5Part_FOUND)
IF (H5Part_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find H5Part!")
ENDIF (H5Part_FIND_REQUIRED)
ENDIF (H5Part_FOUND)
#
# Find HDF5 includes and library
#
# HDF5
# HDF5
# It can be found at:
# http://amas.web.psi.ch/tools/HDF5/index.html
#
......@@ -12,28 +12,15 @@
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
FIND_PATH(HDF5_INCLUDE_DIR hdf5.h
PATHS $ENV{HDF5_INCLUDE_PATH}
NO_DEFAULT_PATH
)
FIND_PATH(HDF5_INCLUDE_DIR hdf5.h
/usr/include
/usr/local/include
)
FIND_LIBRARY(HDF5_LIBRARY libhdf5.a
PATHS $ENV{HDF5_LIBRARY_PATH}
NO_DEFAULT_PATH
HINTS $ENV{HDF5_INCLUDE_PATH}
PATHS ENV CPP_INCLUDE_PATH
)
FIND_LIBRARY(HDF5_LIBRARY libhdf5.a
/usr/lib
/usr/local/lib
HINTS $ENV{HDF5_LIBRARY_PATH}
PATHS ENV LIBRARY_PATH
)
#SET(HDF5_LIBRARY
# $ENV{HDF5_LIBRARY_PATH}/libhdf5.a
#)
IF(HDF5_INCLUDE_DIR AND HDF5_LIBRARY)
SET( HDF5_FOUND "YES" )
......@@ -41,7 +28,8 @@ ENDIF(HDF5_INCLUDE_DIR AND HDF5_LIBRARY)
IF (HDF5_FOUND)
IF (NOT HDF5_FIND_QUIETLY)
MESSAGE(STATUS "Found HDF5: ${HDF5_LIBRARY}")
MESSAGE(STATUS "Found HDF5 library dir: ${HDF5_LIBRARY}")
MESSAGE(STATUS "Found HDF5 include dir: ${HDF5_INCLUDE_DIR}")
ENDIF (NOT HDF5_FIND_QUIETLY)
ELSE (HDF5_FOUND)
IF (HDF5_FIND_REQUIRED)
......
#
# Find IPPL includes and library
#
# IPPL (Independent Parallel Particle Layer) is an object-oriented framework for
# particle based applications in computational science requiring high-performance
# parallel computers. It is a library of C++ classes designed to represent common
# abstractions in these applications. IPPL is based on data-parallel programming
# at the highest abstraction layer. Codes developed on serial workstations port to
# all supported architectures, including parallel processors. The supported
# platforms are: Linux based Beowulf clusters, Cray XT3/4, SGI Ultrix and IBM
# SP3/4.
# It can be found at:
# http://amas.web.psi.ch/tools/IPPL/index.html
#
# IPPL_INCLUDE_DIR - where to find ippl.h
# IPPL_LIBRARY - qualified libraries to link against.
# IPPL_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH(IPPL_INCLUDE_DIR Ippl.h
/usr/local/include
/usr/include
$ENV{IPPL_ROOT}/include
)
FIND_LIBRARY(IPPL_LIBRARY ippl
/usr/local/lib
/usr/lib
$ENV{IPPL_ROOT}/lib
)
IF(IPPL_INCLUDE_DIR AND IPPL_LIBRARY)
SET( IPPL_FOUND "YES" )
ENDIF(IPPL_INCLUDE_DIR AND IPPL_LIBRARY)
IF (IPPL_FOUND)
IF (NOT IPPL_FIND_QUIETLY)
MESSAGE(STATUS "Found IPPL: ${IPPL_LIBRARY}")
ENDIF (NOT IPPL_FIND_QUIETLY)
ELSE (IPPL_FOUND)
IF (IPPL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find IPPL!")
ENDIF (IPPL_FIND_REQUIRED)
ENDIF (IPPL_FOUND)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment