]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: One more round to get a sane link interface *yay*
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Jul 2013 17:23:17 +0000 (17:23 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Jul 2013 17:23:17 +0000 (17:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@29974 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/modules/FindMETIS.cmake
deal.II/cmake/modules/FindMUMPS.cmake
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindUMFPACK.cmake

index b665897d70faaaadb86129e7303c8652a97fcd94..e193114c9a1486fec2f10ede748e702cf248dfaa 100644 (file)
@@ -66,7 +66,7 @@ INCLUDE(setup_cached_variables)
 #
 # Now, set the project and set up the rest:
 #
-PROJECT(deal.II)
+PROJECT(deal.II CXX C)
 INCLUDE(setup_deal_ii)
 INCLUDE(setup_compiler_flags)
 
index e0c1766d4151ba10803c2a5e0b5a8b405cc687ae..da78dfd05fcc2197766b82ec3a46e5605082d65e 100644 (file)
 #
 
 MACRO(FEATURE_MPI_FIND_EXTERNAL var)
+  #
+  # Enable Fortran support so that MPI_Fortran_LIBRARIES is set up.
+  #
+  IF(NOT CMAKE_Fortran_COMPILER_WORKS)
+    ENABLE_LANGUAGE(Fortran OPTIONAL)
+  ENDIF()
+
   #
   # Obey a manual user override: If MPI_CXX_FOUND is set to true in the
   # cache, we skip the FIND_PACKAGE calls:
index 8829c8b06be23304af68eeb441ad3f229a3e7a6a..be83ff3e89a9a7711ea7afedca46bfb71bec4ee0 100644 (file)
@@ -26,9 +26,11 @@ INCLUDE(FindPackageHandleStandardArgs)
 SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 
 #
-# TODO: Metis is usually pretty self contained. So no external dependencies
+# Metis is usually pretty self contained. So no external dependencies
 # so far... But there could be dependencies on pcre and mpi...
 #
+# Link in MPI unconditionally (if found)
+#
 
 FIND_PATH(METIS_INCLUDE_DIR metis.h
   HINTS
@@ -55,7 +57,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG
 IF(METIS_FOUND)
   SET(METIS_LIBRARIES
     ${METIS_LIBRARY}
-    ${MPI_CXX_LIBRARIES} # for good measure
+    ${MPI_C_LIBRARIES} # for good measure
     )
   SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
 
index 0a3299c54122dc18bb6c70e5a99635f1f9a84618..22ee16a703c914af4142b604c293d104e1ba385a 100644 (file)
@@ -91,7 +91,7 @@ IF(MUMPS_FOUND)
     ${MUMPS_COMMON_LIBRARY}
     ${PORD_LIBRARY}
     ${SCALAPACK_LIBRARIES}
-    ${MPI_CXX_LIBRARIES} # For good measure
+    ${MPI_Fortran_LIBRARIES} # For good measure
     )
   SET(MUMPS_LINKER_FLAGS
     ${SCALAPACK_LINKER_FLAGS}
index 93cf297f70216af3ba034055af4d5ca5127dfaf0..3aad02abdf5a446d958279552c078222bf8c5135 100644 (file)
@@ -92,7 +92,7 @@ IF(P4EST_FOUND)
   SET(P4EST_LIBRARIES
     ${P4EST_LIBRARY}
     ${SC_LIBRARY}
-    ${MPI_CXX_LIBRARIES} # for good measure
+    ${MPI_C_LIBRARIES} # for good measure
     )
   SET(P4EST_INCLUDE_DIRS
     ${P4EST_INCLUDE_DIR}
index a8cb4a487153325f1e2cecb5ba3916e2aa374368..fc512a52f3745898dc50b1a402fcaaafe68e0aee 100644 (file)
@@ -35,6 +35,7 @@ ENDFOREACH()
 # now.
 #
 FIND_PACKAGE(LAPACK)
+FIND_PACKAGE(METIS)
 
 #
 # Two macros to make life easier:
@@ -128,10 +129,17 @@ IF(UMFPACK_FOUND)
     ${CAMD_LIBRARY}
     ${AMD_LIBRARY}
     ${SuiteSparse_config_LIBRARY}
-    ${METIS_LIBRARIES} # for good measure
-    ${LAPACK_LIBRARIES}
     )
 
+  #
+  # For good measure:
+  #
+  IF(METIS_FOUND)
+    LIST(APPEND UMFPACK_LIBRARIES ${METIS_LIBRARIES})
+  ENDIF()
+
+  LIST(APPEND UMFPACK_LIBRARIES ${LAPACK_LIBRARIES})
+
   #
   # Add rt to the link interface as well (for whatever reason,
   # libsuitesparse.so depends on clock_gettime but the shared

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.