Commit d2dbcd24 authored by Dave Moxey's avatar Dave Moxey

Merge branch 'feature/cmake-cleanup' of gitlab.nektar.info:dmoxey/nektar into feature/cmake-cleanup

Conflicts:
	cmake/ThirdPartyFFTW.cmake
	cmake/ThirdPartyMPI.cmake
	library/LibUtilities/CMakeLists.txt
	utilities/CMakeLists.txt
parents 1eb27025 e3680c85
......@@ -40,14 +40,16 @@ IF (NEKTAR_USE_FFTW)
TMP_DIR ${TPBUILD}/fftw-3.2.2-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
)
)
THIRDPARTY_LIBRARY(FFTW_LIBRARY SHARED fftw3
DESCRIPTION "FFTW library")
SET(FFTW_LIBRARY fftw3 CACHE FILEPATH
"FFTW library" FORCE)
SET(FFTW_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"FFTW include" FORCE)
MESSAGE(STATUS "Build FFTW: ${FFTW_LIBRARY}")
LINK_DIRECTORIES(${TPDIST}/lib)
MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIBRARY}.so")
SET(FFTW_CONFIG_INCLUDE_DIR ${TPINC})
ELSE ()
ADD_CUSTOM_TARGET(fftw-3.2.2 ALL)
......
......@@ -20,10 +20,8 @@ IF( NEKTAR_USE_MPI )
CHECK_INCLUDE_FILES (mpi.h HAVE_MPI_H)
CHECK_FUNCTION_EXISTS(MPI_Send HAVE_MPI_SEND)
SET(BUILD_MPI OFF)
SET(MPI_BUILTIN OFF CACHE INTERNAL
"Determines whether MPI is built into the compiler")
IF (NOT "${HAVE_MPI_H}" OR NOT "${HAVE_MPI_SEND}")
# No in-built MPI: try to find it on the system instead.
IF (NOT THIRDPARTY_BUILD_MPI)
......@@ -59,78 +57,38 @@ IF( NEKTAR_USE_MPI )
ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_MPI
"Build MPI library from ThirdParty" ${BUILD_MPI}
"NEKTAR_USE_MPI" OFF)
IF (THIRDPARTY_BUILD_MPI)
INCLUDE(ExternalProject)
IF (THIRDPARTY_BUILD_GSMPI)
EXTERNALPROJECT_ADD(
openmpi-1.10.3
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~dmoxey/openmpi-1.10.3.tar.gz
URL_MD5 7d384d6eb454d3a621f932058a822b14
gsmpi-1.2.1
URL ${TPURL}/gsmpi-1.2.1_1.tar.bz2
URL_MD5 c247ed68134a65b8033c639277e46825
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/openmpi-1.10.3
BINARY_DIR ${TPBUILD}/openmpi-1.10.3
TMP_DIR ${TPBUILD}/openmpi-1.10.3
SOURCE_DIR ${TPSRC}/gsmpi-1.2.1
BINARY_DIR ${TPBUILD}/gsmpi-1.2.1
TMP_DIR ${TPBUILD}/gsmpi-1.2.1-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${TPSRC}/openmpi-1.10.3/configure --prefix=${TPDIST} --disable-mpi-fortran --disable-static --disable-vt
)
SET_TARGET_PROPERTIES(openmpi-1.10.3 PROPERTIES EXCLUDE_FROM_ALL 1)
THIRDPARTY_LIBRARY(MPI_CXX_LIBRARIES SHARED mpi mpi_cxx
DESCRIPTION "MPI C++ libraries")
SET(MPI_CXX_COMPILE_FLAGS "" CACHE STRING "MPI compiler flags" FORCE)
SET(MPI_CXX_INCLUDE_PATH ${TPDIST}/include CACHE FILEPATH "MPI include path" FORCE)
SET(MPI_CXX_COMPILER ${TPDIST}/bin/mpicxx CACHE FILEPATH "MPI C++ compiler" FORCE)
SET(MPI_C_COMPILER ${TPDIST}/bin/mpicc CACHE FILEPATH "MPI C compiler" FORCE)
SET(OMPI_EXES mpiexec mpirun orted orterun)
FOREACH(exe ${OMPI_EXES})
LIST(APPEND OMPI_EXES2 "${TPDIST}/bin/${exe}")
ENDFOREACH()
INSTALL(PROGRAMS ${OMPI_EXES2}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${NEKTAR_BIN_DIR}
COMPONENT ThirdParty)
MESSAGE(STATUS "Build MPI: ${MPI_CXX_LIBRARIES}")
ELSE ()
ADD_CUSTOM_TARGET(openmpi-1.10.3 ALL)
SET(MPI_CONFIG_INCLUDE_DIR ${MPI_CXX_INCLUDE_PATH})
ENDIF()
EXTERNALPROJECT_ADD(
gsmpi-1.2.1
URL ${TPURL}/gsmpi-1.2.1_1.tar.bz2
URL_MD5 c247ed68134a65b8033c639277e46825
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/gsmpi-1.2.1
BINARY_DIR ${TPBUILD}/gsmpi-1.2.1
TMP_DIR ${TPBUILD}/gsmpi-1.2.1-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND
${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/gsmpi-1.2.1
CONFIGURE_COMMAND
${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/gsmpi-1.2.1
)
SET(GSMPI_LIBRARY gsmpi CACHE FILEPATH
"GSMPI path" FORCE)
MARK_AS_ADVANCED(GSMPI_LIBRARY)
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
MARK_AS_ADVANCED(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${TPDIST}/lib/lib${GSMPI_LIBRARY}.a")
MESSAGE(STATUS "Build XXT: ${TPDIST}/lib/lib${XXT_LIBRARY}.a")
ELSE (THIRDPARTY_BUILD_GSMPI)
ADD_CUSTOM_TARGET(gsmpi-1.2.1 ALL)
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
ENDIF (THIRDPARTY_BUILD_GSMPI)
ENDIF( NEKTAR_USE_MPI )
THIRDPARTY_LIBRARY(GSMPI_LIBRARY STATIC gsmpi
DESCRIPTION "GSMPI library")
THIRDPARTY_LIBRARY(XXT_LIBRARY STATIC xxt
DESCRIPTION "XXT library")
MARK_AS_ADVANCED(GSMPI_LIBRARY)
MARK_AS_ADVANCED(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${GSMPI_LIBRARY}")
MESSAGE(STATUS "Build XXT: ${XXT_LIBRARY}")
ADD_DEPENDENCIES(gsmpi-1.2.1 openmpi-1.10.3)
ENDIF(NEKTAR_USE_MPI)
......@@ -469,7 +469,7 @@ ENDIF ( NEKTAR_USE_ACCELERATE_FRAMEWORK )
IF( NEKTAR_USE_WIN32_LAPACK )
TARGET_LINK_LIBRARIES(LibUtilities LINK_PUBLIC ${WIN32_LAPACK} ${WIN32_BLAS})
INSTALL(FILES ${WIN32_LAPACK_DLL} ${WIN32_BLAS_DLL}
DESTINATION ${NEKTAR_BIN_DIR})
DESTINATION ${NEKTAR_BIN_DIR})
ENDIF( NEKTAR_USE_WIN32_LAPACK )
IF( NEKTAR_USE_OPENBLAS AND OPENBLAS_FOUND )
......
......@@ -53,7 +53,9 @@ namespace Nektar
BOOST_AUTO_TEST_CASE(TestDefaultConstructor)
{
SMat m;
double buf[] = {};
boost::shared_ptr<InnerMatrix> in(new InnerMatrix(0, 0, buf));
SMat m(0.0, in);
BOOST_CHECK_EQUAL(0u, m.GetRows());
BOOST_CHECK_EQUAL(0u, m.GetColumns());
BOOST_CHECK(boost::shared_ptr<InnerMatrix>() != m.GetOwnedMatrix());
......
......@@ -38,4 +38,4 @@ ENDIF()
IF (NEKTAR_UTILITY_EXTRAS)
SUBDIRS(Extras)
ENDIF()
\ No newline at end of file
ENDIF()
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