|
3 | 3 | ## Description: Ported from portion of OpenBLAS/Makefile.system
|
4 | 4 | ## Sets Fortran related variables.
|
5 | 5 |
|
6 |
| -if (${F_COMPILER} STREQUAL "FLANG") |
| 6 | +if (${F_COMPILER} STREQUAL "FLANG" AND NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang") |
| 7 | + # This is for classic Flang. LLVM Flang is handled with gfortran below. |
7 | 8 | set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_FLANG")
|
8 | 9 | if (BINARY64 AND INTERFACE64)
|
9 | 10 | set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
|
@@ -38,15 +39,17 @@ if (${F_COMPILER} STREQUAL "G95")
|
38 | 39 | endif ()
|
39 | 40 | endif ()
|
40 | 41 |
|
41 |
| -if (${F_COMPILER} STREQUAL "GFORTRAN" OR ${F_COMPILER} STREQUAL "F95") |
| 42 | +if (${F_COMPILER} STREQUAL "GFORTRAN" OR ${F_COMPILER} STREQUAL "F95" OR CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang") |
42 | 43 | set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_GFORT")
|
43 |
| - # ensure reentrancy of lapack codes |
44 |
| - set(FCOMMON_OPT "${FCOMMON_OPT} -Wall -frecursive") |
45 |
| - # work around ABI violation in passing string arguments from C |
46 |
| - set(FCOMMON_OPT "${FCOMMON_OPT} -fno-optimize-sibling-calls") |
47 |
| - #Don't include -lgfortran, when NO_LAPACK=1 or lsbcc |
48 |
| - if (NOT NO_LAPACK) |
49 |
| - set(EXTRALIB "${EXTRALIB} -lgfortran") |
| 44 | + if (NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang") |
| 45 | + # ensure reentrancy of lapack codes |
| 46 | + set(FCOMMON_OPT "${FCOMMON_OPT} -Wall -frecursive") |
| 47 | + # work around ABI violation in passing string arguments from C |
| 48 | + set(FCOMMON_OPT "${FCOMMON_OPT} -fno-optimize-sibling-calls") |
| 49 | + if (NOT NO_LAPACK) |
| 50 | + # Don't include -lgfortran, when NO_LAPACK=1 or lsbcc |
| 51 | + set(EXTRALIB "${EXTRALIB} -lgfortran") |
| 52 | + endif () |
50 | 53 | endif ()
|
51 | 54 | if (NO_BINARY_MODE)
|
52 | 55 | if (MIPS64)
|
|
0 commit comments