File tree Expand file tree Collapse file tree 4 files changed +42
-29
lines changed Expand file tree Collapse file tree 4 files changed +42
-29
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,17 @@ enable_language(C)
44set (LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB} -targets)
55
66# Create a header file cblas.h for the routines called in my C programs
7- include (FortranCInterface)
8- ## Ensure that the fortran compiler and c compiler specified are compatible
9- FortranCInterface_VERIFY()
10- FortranCInterface_HEADER(${LAPACK_BINARY_DIR} /include /cblas_mangling.h
11- MACRO_NAMESPACE "F77_"
12- SYMBOL_NAMESPACE "F77_" )
7+ include (CheckLanguage)
8+ check_language(Fortran)
9+ if (CMAKE_Fortran_COMPILER)
10+ enable_language (Fortran)
11+ include (FortranCInterface)
12+ ## Ensure that the fortran compiler and c compiler specified are compatible
13+ FortranCInterface_VERIFY()
14+ FortranCInterface_HEADER(${LAPACK_BINARY_DIR} /include /cblas_mangling.h
15+ MACRO_NAMESPACE "F77_"
16+ SYMBOL_NAMESPACE "F77_" )
17+ endif ()
1318if (NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
1419 message (WARNING "Reverting to pre-defined include/cblas_mangling.h" )
1520 configure_file (include /cblas_mangling_with_flags.h.in
Original file line number Diff line number Diff line change @@ -368,7 +368,15 @@ endif()
368368set (LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE} )
369369unset (LAPACK_INSTALL_EXPORT_NAME_CACHE)
370370
371- add_subdirectory (LAPACKE)
371+
372+ #-------------------------------------
373+ # LAPACKE
374+ # Include lapack.h and lapacke_mangling.h even if LAPACKE is not built
375+ add_subdirectory (LAPACKE/include )
376+
377+ if (LAPACKE)
378+ add_subdirectory (LAPACKE)
379+ endif ()
372380
373381
374382#-------------------------------------
Original file line number Diff line number Diff line change 1- # Create a header file lapacke_mangling.h for the routines called in my C programs
2- include (FortranCInterface)
3- ## Ensure that the fortran compiler and c compiler specified are compatible
4- FortranCInterface_VERIFY()
5- FortranCInterface_HEADER(${LAPACK_BINARY_DIR} /include /lapacke_mangling.h
6- MACRO_NAMESPACE "LAPACK_"
7- SYMBOL_NAMESPACE "LAPACK_" )
8- if (NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
9- message (WARNING "Reverting to pre-defined include/lapacke_mangling.h" )
10- configure_file (include /lapacke_mangling_with_flags.h.in
11- ${LAPACK_BINARY_DIR} /include /lapacke_mangling.h)
12- endif ()
13-
14- add_subdirectory (include )
15-
16-
17- if (NOT LAPACKE)
18- return ()
19- endif ()
20-
21-
221message (STATUS "LAPACKE enabled" )
232enable_language (C)
243
4+ add_subdirectory (include )
5+
256set (LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB} -targets)
267
278include_directories (include ${LAPACK_BINARY_DIR} /include )
Original file line number Diff line number Diff line change 11set (LAPACKE_INCLUDE lapack.h)
2-
32IF (LAPACKE)
43 list (APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h)
54endif ()
65
76file (COPY ${LAPACKE_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR} /include )
7+
8+ # Create a header file lapacke_mangling.h for the routines called in my C programs
9+ include (CheckLanguage)
10+ check_language(Fortran)
11+ check_language(C)
12+ if (CMAKE_Fortran_COMPILER AND CMAKE_C_COMPILER)
13+ enable_language (Fortran)
14+ enable_language (C)
15+ include (FortranCInterface)
16+ ## Ensure that the fortran compiler and c compiler specified are compatible
17+ FortranCInterface_VERIFY()
18+ FortranCInterface_HEADER(${LAPACK_BINARY_DIR} /include /lapacke_mangling.h
19+ MACRO_NAMESPACE "LAPACK_"
20+ SYMBOL_NAMESPACE "LAPACK_" )
21+ endif ()
22+ if (NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
23+ message (WARNING "Reverting to pre-defined include/lapacke_mangling.h" )
24+ configure_file (lapacke_mangling_with_flags.h.in
25+ ${LAPACK_BINARY_DIR} /include /lapacke_mangling.h)
26+ endif ()
You can’t perform that action at this time.
0 commit comments