From e32a0e70c010282d04a4b49150806d44a83d55c7 Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 24 Mar 2013 13:33:57 +0000 Subject: [PATCH] CMake: Improve documentation wrt manual overrides git-svn-id: https://svn.dealii.org/trunk@29013 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/development/Config.sample | 20 +++++++++++++-- deal.II/doc/development/cmake.html | 37 +++++++++++++++++---------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/deal.II/doc/development/Config.sample b/deal.II/doc/development/Config.sample index e683bf2389..dac9a7c2dc 100644 --- a/deal.II/doc/development/Config.sample +++ b/deal.II/doc/development/Config.sample @@ -203,18 +203,34 @@ # -# Lapack: +# BLAS and LAPACK: # # SET(DEAL_II_WITH_LAPACK ON CACHE BOOL # "Build deal.II with support for lapack" # ) # +# # Automatic detection: # -# Specify a hint with CMAKE_PREFIX_PATH. +# You can set the BLAS/LAPACK vendor that should be found with +# +# SET(BLA_VENDOR "Goto" CACHE STRING "") +# Valid vendors: Goto, ATLAS, PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, +# IBMESSL, Intel10_32, Intel10_64lp, Intel10_64lp_seq, ACML, ACML_MP, +# ACML_GPU, Apple, NAS, Generic +# +# BLA_VENDOR will also be recognized by FindLAPACK.cmake. +# +# If your BLAS/LAPACK installation resides at a non system location, specify +# a hint with CMAKE_PREFIX_PATH. +# # # Manual setup: # +# SET(BLAS_FOUND TRUE CACHE BOOL "") +# SET(BLAS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "") +# SET(BLAS_LINKER_FLAGS "..." CACHE STRING "") +# # SET(LAPACK_FOUND TRUE CACHE BOOL "") # SET(LAPACK_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "") # SET(LAPACK_LINKER_FLAGS "..." CACHE STRING "") diff --git a/deal.II/doc/development/cmake.html b/deal.II/doc/development/cmake.html index 9f53eabdcf..f6bde3aaf1 100644 --- a/deal.II/doc/development/cmake.html +++ b/deal.II/doc/development/cmake.html @@ -386,31 +386,42 @@

Manual override

-

Warning:Do not do this unless absolutely necessary!

+

Warning: Do not do this unless absolutely necessary!

It is possible to override the CMake find mechanism for external libraries manually. This is useful if a non standard library (e.g. BLAS or LAPACK) should be used but cannot be found by the - FIND_PACKAGE(...) mechanism of cmake in the default - directories. + FIND_PACKAGE(...) mechanism. + In this case you can set by hand:

 
-    cmake -DLAPACK_FOUND=true \
-          -DLAPACK_LIBRARIES="library;and;complete;link;interface"
+    cmake -D<lib>_FOUND=true \
+          -D<lib>_LIBRARIES="library;and;complete;link;interface" \
+        ( -D<lib>_INCLUDE_DIRS="semicolon;separated;list;of;include;dirs" \
+          -D<lib>_LINK_FLAGS="..." \
+          -D<lib>_<...depending on library...> )
       
- The first of the two defines ensures that cmake doesn't - just take the second as hints but errors out if LAPACK can't - be used with the given library (if you are sure that the path works, you - can then omit the first command). An example of use is to select BLAS - and LAPACK as follows (here, these libraries have been compiled with the - gfortran compiler and need its support library): + + The first define ensures that cmake does not + call the corresponding Find<lib>.cmake module. + Therefore, all information that would be otherwise exported by the + module must be specified by hand. (See the + Config.sample file for a + detailed list of valid variables per feature.) +

+

+ An example of use is to select BLAS and LAPACK manually as follows + (here, these libraries have been compiled with the gfortran compiler + and need its support library):

 
     cmake -DBLAS_FOUND=true \
-          -DBLAS_LIBRARIES="-L/apps/GotoBLAS/lib64 -lgoto -lgfortran" \
+          -DBLAS_LIBRARIES="/apps/GotoBLAS/lib64/libgoto.so" \
+          -DBLAS_LINKER_FLAGS="-lgfortran" \
           -DLAPACK_FOUND=true \
-          -DLAPACK_LIBRARIES="-L/apps/lapack-3.2.1/lib64 -llapack -L/apps/GotoBLAS/lib64 -lgoto -lgfortran"
+          -DLAPACK_LIBRARIES="/apps/lapack-3.2.1/liblapack.so;/apps/GotoBLAS/lib64/libgoto.so" \
+          -DLAPACK_LINKER_FLAGS="-lgfortran"
       
You can set these values on the command line, with ccmake -- 2.39.5