File tree 4 files changed +42
-29
lines changed
4 files changed +42
-29
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,17 @@ enable_language(C)
4
4
set (LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB} -targets)
5
5
6
6
# 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 ()
13
18
if (NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
14
19
message (WARNING "Reverting to pre-defined include/cblas_mangling.h" )
15
20
configure_file (include /cblas_mangling_with_flags.h.in
Original file line number Diff line number Diff line change @@ -362,7 +362,15 @@ endif()
362
362
set (LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE} )
363
363
unset (LAPACK_INSTALL_EXPORT_NAME_CACHE)
364
364
365
- add_subdirectory (LAPACKE)
365
+
366
+ #-------------------------------------
367
+ # LAPACKE
368
+ # Include lapack.h and lapacke_mangling.h even if LAPACKE is not built
369
+ add_subdirectory (LAPACKE/include )
370
+
371
+ if (LAPACKE)
372
+ add_subdirectory (LAPACKE)
373
+ endif ()
366
374
367
375
368
376
#-------------------------------------
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
-
22
1
message (STATUS "LAPACKE enabled" )
23
2
enable_language (C)
24
3
4
+ add_subdirectory (include )
5
+
25
6
set (LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB} -targets)
26
7
27
8
include_directories (include ${LAPACK_BINARY_DIR} /include )
Original file line number Diff line number Diff line change 1
1
set (LAPACKE_INCLUDE lapack.h)
2
-
3
2
IF (LAPACKE)
4
3
list (APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h)
5
4
endif ()
6
5
7
6
file (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