Commit 8d2bb06c authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Fixed library linking logic for NIST, FFTW, Arpack

Removed duplicate definitions
Cleaned up parts of the CMake file.
parent 2e96747a
......@@ -163,7 +163,6 @@ IF( NEKTAR_USE_MKL )
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_MKL TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS)
ENDIF( NEKTAR_USE_MKL )
IF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
......@@ -180,8 +179,7 @@ IF( NEKTAR_USE_ACML )
SET(NEKTAR_USING_BLAS TRUE)
SET(NEKTAR_USING_LAPACK TRUE)
SET(NEKTAR_USING_ACML TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS -DUSE_ACML)
ADD_DEFINITIONS(-DNEKTAR_USING_LAPACK -DNEKTAR_USING_BLAS)
ADD_DEFINITIONS(-DUSE_ACML)
ENDIF( NEKTAR_USE_ACML )
IF( NEKTAR_USE_WIN32_LAPACK )
......
......@@ -5,20 +5,16 @@ MACRO(CHANGE_EXTENSION output var new_ext)
ENDMACRO()
MACRO(SET_LAPACK_LINK_LIBRARIES name)
IF( NEKTAR_USE_BLAS_LAPACK )
# Link FFTW before MKL to ensure FFTW original implementation used.
IF( NEKTAR_USE_FFTW )
TARGET_LINK_LIBRARIES(${name} optimized ${FFTW_LIB} debug ${FFTW_LIB})
ENDIF( NEKTAR_USE_FFTW )
# Link FFTW before MKL to ensure FFTW original implementation used.
IF( NEKTAR_USE_FFTW )
TARGET_LINK_LIBRARIES(${name} optimized ${FFTW_LIB} debug ${FFTW_LIB})
ENDIF( NEKTAR_USE_FFTW )
IF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_MKL AND MKL_FOUND )
TARGET_LINK_LIBRARIES(${name} ${MKL} )
ENDIF( NEKTAR_USE_MKL AND MKL_FOUND )
IF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT AND NIST_SPARSE_BLAS_FOUND )
TARGET_LINK_LIBRARIES(${name} ${NIST_SPARSE_BLAS} )
ENDIF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT AND NIST_SPARSE_BLAS_FOUND )
IF( NEKTAR_USE_ACML AND ACML_FOUND )
TARGET_LINK_LIBRARIES(${name} ${ACML_TARGET_LINK_LIBRARIES} )
ENDIF( NEKTAR_USE_ACML AND ACML_FOUND )
......@@ -38,20 +34,24 @@ MACRO(SET_LAPACK_LINK_LIBRARIES name)
ENDIF( NEKTAR_USE_WIN32_LAPACK )
IF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
TARGET_LINK_LIBRARIES(${name} ${NATIVE_LAPACK} ${NATIVE_BLAS})
TARGET_LINK_LIBRARIES(${name} ${NATIVE_LAPACK} ${NATIVE_BLAS})
ENDIF( NEKTAR_USE_SYSTEM_BLAS_LAPACK )
IF( NEKTAR_USE_METIS )
TARGET_LINK_LIBRARIES(${name} optimized ${METIS_LIB} debug ${METIS_LIB} )
ENDIF( NEKTAR_USE_METIS )
IF( NEKTAR_USE_ARPACK )
TARGET_LINK_LIBRARIES(${name} optimized ${ARPACK_LIB} debug
${ARPACK_LIB} )
ENDIF( NEKTAR_USE_ARPACK )
ENDIF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT AND NIST_SPARSE_BLAS_FOUND )
TARGET_LINK_LIBRARIES(${name} ${NIST_SPARSE_BLAS} )
ENDIF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT AND NIST_SPARSE_BLAS_FOUND )
IF( NEKTAR_USE_METIS )
TARGET_LINK_LIBRARIES(${name} optimized ${METIS_LIB} debug
${METIS_LIB} )
ENDIF( NEKTAR_USE_METIS )
IF( NEKTAR_USE_ARPACK )
TARGET_LINK_LIBRARIES(${name} optimized ${ARPACK_LIB} debug
${ARPACK_LIB} )
ENDIF( NEKTAR_USE_ARPACK )
ENDMACRO(SET_LAPACK_LINK_LIBRARIES name)
MACRO(SET_COMMON_PROPERTIES name)
......@@ -61,32 +61,32 @@ MACRO(SET_COMMON_PROPERTIES name)
SET_TARGET_PROPERTIES(${name} PROPERTIES MINSIZEREL_POSTFIX -ms)
SET_TARGET_PROPERTIES(${name} PROPERTIES RELWITHDEBINFO_POSTFIX -rg)
IF( MSVC )
# Disable the warnings about duplicate copy/assignment methods
# (4521, 4522)
# Disable the warning that arrays are default intialized (4351)
# Disable "forcing value to bool 'true' or 'false' (performance
# warning)" warning (4800)
IF( MSVC )
# Disable the warnings about duplicate copy/assignment methods
# (4521, 4522)
# Disable the warning that arrays are default intialized (4351)
# Disable "forcing value to bool 'true' or 'false' (performance
# warning)" warning (4800)
# 4250 - Inheritance via dominance. Nektar appears to be handling the
# diamond correctly.
# /Za is necessary to prevent temporaries being bound to reference
# parameters.
SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS
"/wd4521 /wd4522 /wd4351 /wd4018 /wd4800 /wd4250")
# /Za is necessary to prevent temporaries being bound to reference
# parameters.
SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS
"/wd4521 /wd4522 /wd4351 /wd4018 /wd4800 /wd4250")
# Enable source level parallel builds.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF( )
# Enable source level parallel builds.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF( MSVC )
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
IF(NEKTAR_ENABLE_PROFILE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg")
SET(LINK_FLAGS "${LINK_FLAGS} -pg")
ENDIF()
ENDIF()
SET(LINK_FLAGS "${LINK_FLAGS} -pg")
ENDIF(NEKTAR_ENABLE_PROFILE)
ENDIF( ${CMAKE_COMPILER_IS_GNUCXX} )
# Prevent including these common flags multiple times.
IF (NOT ${CMAKE_CXX_FLAGS_DEBUG} MATCHES ".*DNEKTAR_DEBUG.*")
......@@ -95,19 +95,19 @@ MACRO(SET_COMMON_PROPERTIES name)
IF ( NEKTAR_FULL_DEBUG )
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_FULLDEBUG")
ENDIF()
ENDIF( NEKTAR_FULL_DEBUG)
IF( NOT MSVC )
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -fpermissive -Wno-deprecated")
SET(CMAKE_CXX_FLAGS_RELEASE
SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated")
ENDIF()
ENDIF( NOT MSVC)
SET(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -DNEKTAR_RELEASE")
ENDIF( )
ENDIF(NOT ${CMAKE_CXX_FLAGS_DEBUG} MATCHES ".*DNEKTAR_DEBUG.*")
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
# The static libraries must be compiled with position independent
......
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