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()
#
# 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()
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>