Skip to content

Commit 4b48011

Browse files
matthiasdienerevan-charmworks
authored andcommitted
fix cmake fortran check for CMK_FORTRAN_USES_NOSCORE and fix XLC (#3461)
1 parent aa2f72f commit 4b48011

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Cray")
5454
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
5555
set(CMK_COMPILER pgcc)
5656
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
57-
set(CMK_COMPILER xlc)
57+
# FIXME: No support for 32-bit XLC
58+
set(CMK_COMPILER xlc64)
5859
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (CMAKE_CXX_COMPILER_ID STREQUAL "" AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")))
5960
set(CMK_COMPILER msvc)
6061
else()
@@ -90,7 +91,7 @@ if(NOT ARCH STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
9091
message(WARNING "Attempting to cross-compile from ${CMAKE_HOST_SYSTEM_PROCESSOR} to ${ARCH}. This is only supported for x86_64 -> i386 currently.")
9192
set(CMAKE_C_FLAGS -m32)
9293
set(CMAKE_CXX_FLAGS -m32)
93-
set(CMAKE_FORTRAN_FLAGS -m32)
94+
set(CMAKE_Fortran_FLAGS -m32)
9495
else()
9596
message(WARNING "Cross-compiling from ${CMAKE_HOST_SYSTEM_PROCESSOR} to ${ARCH} is not supported currently.")
9697
endif()

cmake/detect-features-fortran.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ set(CMK_FORTRAN_USES_ONESCORE 0)
44
set(CMK_FORTRAN_USES_NOSCORE 0)
55
set(CMK_FORTRAN_USES_ALLCAPS 0)
66

7-
if(${CMK_CAN_LINK_FORTRAN})
8-
if(${FortranCInterface_GLOBAL_SUFFIX} STREQUAL "__")
7+
if(CMK_CAN_LINK_FORTRAN)
8+
if("${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "__")
99
set(CMK_FORTRAN_USES_TWOSCORE 1)
10-
elseif(${FortranCInterface_GLOBAL_SUFFIX} STREQUAL "_")
10+
elseif("${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "_")
1111
set(CMK_FORTRAN_USES_ONESCORE 1)
12-
elseif(${FortranCInterface_GLOBAL_SUFFIX} STREQUAL "")
12+
elseif("${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "")
1313
set(CMK_FORTRAN_USES_NOSCORE 1)
14-
elseif(${FortranCInterface_GLOBAL_CASE} STREQUAL "UPPER")
14+
elseif("${FortranCInterface_GLOBAL_CASE}" STREQUAL "UPPER")
1515
set(CMK_FORTRAN_USES_ALLCAPS 1)
1616
endif()
1717
endif()

src/arch/common/cc-xlc64.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
COMMENT="Enable 64-bit mode (-q64)"
22
CMK_CC='xlc_r -q64 '
33
CMK_CXX='xlC_r -q64 '
4-
CMK_C_OPTIMIZE='-O3 -qstrict -Q! '
5-
CMK_CXX_OPTIMIZE='-O3 -qstrict -Q! '
4+
CMK_C_OPTIMIZE='-O3 -qstrict '
5+
CMK_CXX_OPTIMIZE='-O3 -qstrict '
66
CMK_PIC='-qpic=small'
77

88
CMK_LD="$CMK_CC "

src/arch/multicore-linux-ppc64le/cc-xlc64.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
COMMENT="Enable 64-bit mode (-q64)"
22
CMK_CC='xlc_r -q64 '
33
CMK_CXX='xlC_r -q64 '
4-
CMK_C_OPTIMIZE='-O3 -qstrict -Q! '
5-
CMK_CXX_OPTIMIZE='-O3 -qstrict -Q! '
4+
CMK_C_OPTIMIZE='-O3 -qstrict '
5+
CMK_CXX_OPTIMIZE='-O3 -qstrict '
66
CMK_LD="$CMK_CC "
77
CMK_LDXX="$CMK_CXX "
88

0 commit comments

Comments
 (0)