Skip to content

Commit f3f6a78

Browse files
author
Damian Rouson
committed
caf invokes compiler specified by OC-build-time FC (#197)
1 parent 706ea5a commit f3f6a78

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/extensions/caf-foot

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ if [ $# == 0 ]; then
6060
exit 1
6161
fi
6262

63-
# Default to "mpif90" Fortran compiler if environment variable CAFC has zero length:
64-
if [ -z "$CAFC" ]; then
65-
CAFC=mpif90
66-
fi
63+
# Default to "mpif90" Fortran compiler if environment variable CAFC is empty or unset:
64+
CAFC=${CAFC:-mpif90}
6765

6866
# TODO -- improve the syntax of the "set" command below to accepted an unlimited number of arguments
6967
max_arguments=100

src/mpi/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ if(opencoarrays_aware_compiler)
5353
else()
5454
file(APPEND "${compiler_wrapper}" "caf_compiler=false\n")
5555
endif()
56+
57+
if ( DEFINED ENV{FC} )
58+
file(APPEND "${compiler_wrapper}" "CAFC=$ENV{FC}\n")
59+
endif ()
60+
5661
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
5762
file(APPEND "${compiler_wrapper}" "linux=true\n")
5863
endif()

0 commit comments

Comments
 (0)