]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Make the custom overrides more robust. Also try to handle incomplete LAPACK...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 31 Mar 2013 23:14:45 +0000 (23:14 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 31 Mar 2013 23:14:45 +0000 (23:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@29130 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_1_lapack.cmake
deal.II/cmake/macros/macro_find_package.cmake
deal.II/doc/development/cmake.html

index fb4ff6e4af807bfd3abab997a11358f0d9676552..301d1532ecc9c49b076996f736a05adb1cc0f973 100644 (file)
@@ -71,6 +71,17 @@ ENDMACRO()
 MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL)
   ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
   LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${LAPACK_LIBRARIES})
+
+  #
+  # So, well... LAPACK_LINKER_FLAGS and LAPACK_LIBRARIES should contain the
+  # complete link interface. But for invalid user overrides we include
+  # BLAS_LIBRARIES and BLAS_LINKER_FLAGS as well..
+  #
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${BLAS_LIBRARIES})
+  IF(NOT LAPACK_LINKER_FLAGS MATCHES "${BLAS_LINKER_FLAGS}")
+    ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
+  ENDIF()
+
   CHECK_FOR_LAPACK_FUNCTIONS()
 ENDMACRO()
 
index 8f6b623f4033e8e5cd8c272feee8adbe20097548..01adf7a2bcddf23bd9cc3f886f1e6aaa95b20335 100644 (file)
 #
 # A small wrapper around FIND_PACKAGE.
 # We guard the invocation of FIND_PACKAGE(package <...>) by
-# ${package}_FOUND to allow easy custom overrides
+# ${package}_FOUND and ${package}_LIBRARIES to allow easy custom overrides
 #
 
 MACRO(FIND_PACKAGE _package_name)
   STRING(TOUPPER ${_package_name} _package_name_uppercase)
 
-  IF(NOT DEFINED ${_package_name_uppercase}_FOUND)
+  IF( NOT DEFINED ${_package_name_uppercase}_FOUND AND
+      NOT DEFINED ${_package_name_uppercase}_LIBRARIES )
     _FIND_PACKAGE (${_package_name} ${ARGN})
+  ELSE()
+    IF(NOT DEFINED ${_package_name_uppercase}_FOUND)
+      SET(${_package_name_uppercase}_FOUND TRUE)
+    ENDIF()
   ENDIF()
 ENDMACRO()
index 242a3f6e5546c9ea8889cfbf33c7c519e38df308..61b0a0256b0362c6c0ae6d9f390008fdcca435b5 100644 (file)
       detailed list of valid variables per feature.)
     </p>
     <p>
-      An example of use is to select BLAS and LAPACK manually as follows
-      (here, these libraries have been compiled with the gfortran compiler
+      An example of use is to select BLAS and LAPACK manually from a PETSc
+      configuration:
+      (Here, these libraries have been compiled with the gfortran compiler
       and need its support library):
       <pre>
 
-    cmake -DBLAS_FOUND=true \
-          -DBLAS_LIBRARIES="/apps/GotoBLAS/lib64/libgoto.so" \
-          -DBLAS_LINKER_FLAGS="-lgfortran" \
-          -DLAPACK_FOUND=true \
-          -DLAPACK_LIBRARIES="/apps/lapack-3.2.1/liblapack.so;/apps/GotoBLAS/lib64/libgoto.so" \
+    cmake -DLAPACK_FOUND=true \
+          -DLAPACK_LIBRARIES="/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libflapack.a;/tmp/petsc-3.3-p6/arch-linux2-c-debug/lib/libfblas.a" \
           -DLAPACK_LINKER_FLAGS="-lgfortran"
       </pre>
 

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.