From e32a0e70c010282d04a4b49150806d44a83d55c7 Mon Sep 17 00:00:00 2001
From: maier 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
- Manual override
- 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