Skip to content
Snippets Groups Projects
Commit d7be1c5c authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Revert "[cleanup] Remove enable trick for UMFPack" and GMP

These commits broke compiling / linking if one package was found
but the includes / libraries were not added. We need a different
approach to hide the ENABLE_* trick from the user and keep full
testing capabilities.
This reverts commits 0f12caff
and d75c3a46.
parent 602c2119
Branches
Tags
No related merge requests found
......@@ -5,6 +5,9 @@ function(add_dune_gmp_flags _targets)
if(GMP_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${GMP_LIBRARIES})
set_property(TARGET ${_target}
APPEND_STRING
PROPERTY COMPILE_FLAGS "-DENABLE_GMP=1 ")
foreach(_path ${GMP_INCLUDE_DIRS})
set_property(TARGET ${_target}
APPEND_STRING
......
# module providing convenience methods for compiling
# binaries with UMFPack support
# module providing convenience mehtods for compiling bianries with UMFPack support
#
# Provides the following functions:
#
......@@ -13,7 +12,7 @@ function(add_dune_umfpack_flags _targets)
get_target_property(_props ${_target} COMPILE_FLAGS)
string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
set_target_properties(${_target} PROPERTIES COMPILE_FLAGS
"${_props} ${UMFPACK_DUNE_COMPILE_FLAGS}")
"${_props} ${UMFPACK_DUNE_COMPILE_FLAGS} -DENABLE_UMFPACK")
endforeach(_target ${_targets})
endif(UMFPACK_FOUND)
endfunction(add_dune_umfpack_flags)
endfunction(add_dune_umfpack_flags)
\ No newline at end of file
......@@ -64,6 +64,7 @@ mark_as_advanced(GMP_LIB GMPXX_LIB GMP_INCLUDE_DIR)
if(GMP_FOUND)
set(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR})
set(GMP_LIBRARIES ${GMP_LIB} ${GMPXX_LIB})
set(GMP_COMPILE_FLAGS "-DENABLE_GMP=1")
# log result
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determing location of GMP succeded:\n"
......@@ -83,6 +84,7 @@ set(HAVE_GMP ${GMP_FOUND})
# register all GMP related flags
if(HAVE_GMP)
dune_register_package_flags(LIBRARIES "${GMP_LIB};${GMPXX_LIB}"
dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_GMP=1"
LIBRARIES "${GMP_LIB};${GMPXX_LIB}"
INCLUDE_DIRS "${GMP_INCLUDE_DIR}")
endif()
......@@ -96,7 +96,7 @@ set(HAVE_UMFPACK ${UMFPACK_FOUND})
# register all umfpack related flags
if(UMFPACK_FOUND)
dune_register_package_flags(
LIBRARIES "${UMFPACK_LIBRARIES}"
INCLUDE_DIRS "${UMFPACK_INCLUDE_DIRS}")
dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_UMFPACK=1"
LIBRARIES "${UMFPACK_LIBRARIES}"
INCLUDE_DIRS "${UMFPACK_INCLUDE_DIRS}")
endif()
......@@ -43,8 +43,9 @@
deprecated MPI_CPPFLAGS) */
#cmakedefine HAVE_MPI ENABLE_MPI
/* Define to 1 if you have the GNU GMP library. */
#cmakedefine HAVE_GMP 1
/* Define if you have the GNU GMP library. The value should be ENABLE_GMP
to facilitate activating and deactivating GMP using compile flags. */
#cmakedefine HAVE_GMP ENABLE_GMP
/* Define to 1 if you have the symbol mprotect. */
#cmakedefine HAVE_MPROTECT 1
......@@ -107,8 +108,8 @@
/* does the compiler support the keyword 'final'? */
#cmakedefine HAVE_KEYWORD_FINAL 1
/* Define to 1 if the UMFPack library is available */
#cmakedefine HAVE_UMFPACK 1
/* Define to if the UMFPack library is available */
#cmakedefine HAVE_UMFPACK ENABLE_UMFPACK
/* Define to ENABLE_PARMETIS if you have the Parmetis library.
This is only true if MPI was found
......
......@@ -28,7 +28,7 @@ namespace Dune {
// Specialization for the case of two equal types
// One should think that the generic template should handle this case as well.
// However, the fvectortest.cc unit test fails without it if gmp is used.
// However, the fvectortest.cc unit test fails without it if ENABLE_GMP is set.
template <typename T1>
struct PromotionTraits<T1,T1> { typedef T1 PromotedType; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment