Commit 2b36098a authored by Dave Moxey's avatar Dave Moxey

Changing cmake to detect built-in MPI

parent f3a147fe
......@@ -4,17 +4,17 @@ options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
PROJECT(Nektar++)
# Helps organize projects in IDEs.
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Extract the version number from the VERSION file and set in CMake
# The format of this file must be X.X.X
FILE(STRINGS "VERSION" NEKVER)
STRING(REPLACE "." ";" NEKVERLIST ${NEKVER})
LIST(GET NEKVERLIST 0 NEKTAR_VERSION_MAJOR)
LIST(GET NEKVERLIST 1 NEKTAR_VERSION_MINOR)
LIST(GET NEKVERLIST 2 NEKTAR_VERSION_PATCH)
# Extract the version number from the VERSION file and set in CMake
# The format of this file must be X.X.X
FILE(STRINGS "VERSION" NEKVER)
STRING(REPLACE "." ";" NEKVERLIST ${NEKVER})
LIST(GET NEKVERLIST 0 NEKTAR_VERSION_MAJOR)
LIST(GET NEKVERLIST 1 NEKTAR_VERSION_MINOR)
LIST(GET NEKVERLIST 2 NEKTAR_VERSION_PATCH)
SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERSION_PATCH})
INCLUDE(CMakeExportBuildSettings)
......@@ -36,7 +36,7 @@ SET(LIB_DIR "lib")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
SET(LIB_DIR "lib64")
ENDIF()
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
SET(NEKTAR_BIN_DIR bin)
SET(NEKTAR_LIB_DIR ${LIB_DIR})
......@@ -71,6 +71,13 @@ OPTION(NEKTAR_BUILD_TIMINGS "Build benchmark timing codes." OFF)
OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." OFF)
MARK_AS_ADVANCED(NEKTAR_FULL_DEBUG)
# Static library support
OPTION(NEKTAR_USE_STATIC "Build using static libraries." OFF)
MARK_AS_ADVANCED(NEKTAR_USE_STATIC)
IF (NEKTAR_USE_STATIC)
SET(NEKTAR_LIBRARY_TYPE "STATIC")
ENDIF (NEKTAR_USE_STATIC)
IF (${CMAKE_COMPILER_IS_GNUCXX})
OPTION(NEKTAR_ENABLE_PROFILE "Uses -pg compiler flag" OFF)
MARK_AS_ADVANCED(NEKTAR_ENABLE_PROFILE)
......@@ -164,7 +171,7 @@ INCLUDE (ThirdPartyFFTW)
INCLUDE (ThirdPartyArpack)
INCLUDE (ThirdPartyMPI)
INCLUDE (ThirdPartyVTK)
INCLUDE (ThirdPartyQT4)
INCLUDE (ThirdPartyQT4)
IF( NEKTAR_USE_MKL )
INCLUDE (FindMKL)
......
......@@ -173,11 +173,13 @@ MACRO(ADD_NEKTAR_EXECUTABLE name component sources)
ADD_DEPENDENCIES(${name} boost tinyxml zlib-1.2.7)
IF( NEKTAR_USE_MPI )
TARGET_LINK_LIBRARIES(${name} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
IF (NOT DEFINED MPI_BUILTIN)
TARGET_LINK_LIBRARIES(${name} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
SET_TARGET_PROPERTIES(${name}
PROPERTIES LINK_FLAGS "${THE_LINK_FLAGS} ${MPI_LINK_FLAGS}")
ENDIF()
SET_TARGET_PROPERTIES(${name}
PROPERTIES COMPILE_FLAGS "${THE_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS}")
SET_TARGET_PROPERTIES(${name}
PROPERTIES LINK_FLAGS "${THE_LINK_FLAGS} ${MPI_LINK_FLAGS}")
ENDIF( NEKTAR_USE_MPI )
IF( ${CMAKE_SYSTEM} MATCHES "Linux.*" )
......
......@@ -29,7 +29,7 @@ IF (THIRDPARTY_BUILD_BOOST)
URL ${TPURL}/boost_1_49_0.tar.bz2
URL_MD5 "0d202cb811f934282dea64856a175698"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ./bootstrap.sh --prefix=${TPSRC}/dist
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPSRC}/dist
BUILD_COMMAND NO_BZIP2=1 ./b2
variant=release
link=shared
......@@ -88,15 +88,18 @@ IF (THIRDPARTY_BUILD_BOOST)
ELSE (THIRDPARTY_BUILD_BOOST)
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
#If the user has not set BOOST_ROOT, look in a couple common places first.
IF( NOT BOOST_ROOT )
SET(TEST_ENV $ENV{BOOST_HOME})
IF (DEFINED TEST_ENV)
SET(Boost_NO_SYSTEM_PATHS ON)
SET(TEST_ENV1 $ENV{BOOST_HOME})
SET(TEST_ENV2 $ENV{BOOST_DIR})
IF (DEFINED TEST_ENV1)
SET(BOOST_ROOT $ENV{BOOST_HOME})
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time
filesystem system program_options regex )
ELSEIF (DEFINED TEST_ENV2)
SET(BOOST_ROOT $ENV{BOOST_DIR})
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time
filesystem system program_options regex )
ELSE ()
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/boost)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
......
......@@ -5,24 +5,40 @@ CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_GSMPI
"NEKTAR_USE_MPI" OFF)
IF( NEKTAR_USE_MPI )
INCLUDE (FindMPI)
MARK_AS_ADVANCED(MPI_LIBRARY)
MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY)
MARK_AS_ADVANCED(file_cmd)
# First check to see if our compiler has MPI built in to avoid linking libraries etc.
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckFunctionExists)
CHECK_INCLUDE_FILES (mpi.h HAVE_MPI_H)
CHECK_FUNCTION_EXISTS(MPI_Send HAVE_MPI_SEND)
IF (NOT "${HAVE_MPI_H}" OR NOT "${HAVE_MPI_SEND}")
INCLUDE (FindMPI)
MARK_AS_ADVANCED(MPI_LIBRARY)
MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY)
MARK_AS_ADVANCED(file_cmd)
INCLUDE_DIRECTORIES( ${MPI_INCLUDE_PATH} )
SET(MPI_BUILTIN OFF BOOL INTERNAL)
MESSAGE(STATUS "Found MPI: ${MPI_LIBRARY}")
ELSE()
SET(MPI_BUILTIN ON BOOL INTERNAL)
MESSAGE(STATUS "Found MPI: built in")
ENDIF()
ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
INCLUDE_DIRECTORIES( ${MPI_INCLUDE_PATH} )
IF (THIRDPARTY_BUILD_GSMPI)
EXTERNALPROJECT_ADD(
gsmpi-1.1
PREFIX ${TPSRC}
URL ${TPURL}/gsmpi-1.1.tar.bz2
URL_MD5 "f2c1f7695f361c6d87365e2ea63aece1"
URL http://ae-nektar.ae.ic.ac.uk/~dmoxey/test/gsmpi-1.1.tar.bz2
URL_MD5 560213b57aa379ebda2d027296eefc07
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND
${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
${TPSRC}/src/gsmpi-1.1
)
SET(GSMPI_LIBRARY gsmpi CACHE FILEPATH
......@@ -37,6 +53,5 @@ IF( NEKTAR_USE_MPI )
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
ENDIF (THIRDPARTY_BUILD_GSMPI)
ENDIF( NEKTAR_USE_MPI )
......@@ -9,7 +9,13 @@ IF (THIRDPARTY_BUILD_METIS)
URL ${TPURL}/modmetis-5.0.2.tar.bz2
URL_MD5 "ffbdc6a50283934389a0b3b0c32b62c0"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC -DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.0.2/GKlib ${TPSRC}/src/modmetis-5.0.2
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
-DCMAKE_C_FLAGS:STRING=-fPIC
-DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.0.2/GKlib
${TPSRC}/src/modmetis-5.0.2
)
SET(METIS_LIB metis CACHE FILEPATH
"METIS library" FORCE)
......
......@@ -9,7 +9,11 @@ IF (THIRDPARTY_BUILD_NIST_SPBLASTK)
URL ${TPURL}/spblastk0.9b.tar.bz2
URL_MD5 "93469940f03554939a4600f431eb4d99"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist ${TPSRC}/src/spblastk0.9b
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
${TPSRC}/src/spblastk0.9b
)
SET(NIST_SPARSE_BLAS sbtk CACHE FILEPATH
"Path to NIST Sparse BLAS." FORCE)
......
......@@ -35,7 +35,11 @@ IF (THIRDPARTY_BUILD_ZLIB)
URL ${TPURL}/zlib-1.2.7.tar.gz
URL_MD5 "4a162e0f643232e7e278d59a0603ceb0"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC ${TPSRC}/src/zlib-1.2.7
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
-DCMAKE_C_FLAGS:STRING=-fPIC
${TPSRC}/src/zlib-1.2.7
)
IF (WIN32)
SET(ZLIB_LIBRARY zlib)
......
......@@ -316,6 +316,7 @@ TARGET_LINK_LIBRARIES(LibUtilities
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_ZLIB_LIBRARY}
${TINYXML_LIB}
)
......
......@@ -50,7 +50,11 @@ TARGET_LINK_LIBRARIES(LocalRegions
optimized StdRegions debug StdRegions-g
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_ZLIB_LIBRARY}
)
SET_LAPACK_LINK_LIBRARIES(LocalRegions)
......
......@@ -119,7 +119,11 @@ TARGET_LINK_LIBRARIES(MultiRegions
optimized StdRegions debug StdRegions-g
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_ZLIB_LIBRARY}
)
SET_LAPACK_LINK_LIBRARIES(MultiRegions)
......
......@@ -70,7 +70,11 @@ TARGET_LINK_LIBRARIES(SolverUtils
optimized LocalRegions debug LocalRegions-g
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
${Boost_THREAD_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_ZLIB_LIBRARY}
)
SET_LAPACK_LINK_LIBRARIES(SolverUtils)
......
......@@ -52,7 +52,11 @@ TARGET_LINK_LIBRARIES(StdRegions
optimized LibUtilities debug LibUtilities-g
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_ZLIB_LIBRARY}
)
SET_LAPACK_LINK_LIBRARIES(StdRegions)
......
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