Skip to content

Commit e2e7f5d

Browse files
author
Damian Rouson
committed
Renaming the environment variable invoked by caf compiler wrapper to prevent infinite recursion when building CAF application codes with CMake.
1 parent fd3e2fd commit e2e7f5d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22

33
#Name project and specify source languages
4-
project(opencoarrays VERSION 1.1.1 LANGUAGES C Fortran)
4+
project(opencoarrays VERSION 1.1.2 LANGUAGES C Fortran)
55

66
#Print an error message on an attempt to build inside the source directory tree:
77
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")

src/extensions/caf-foot

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ usage()
2828
echo " * appear before all other arguments,"
2929
echo " * be the only Fortran source file in the argument list,"
3030
echo " * have a name of the form *.f90, *.F90, *.f, or *.F. "
31-
echo " c. The environment variable 'FC' must be empty or point to a Fortran compiler/linker. "
32-
echo " d. If 'FC' is empty, a default value of 'mpif90' is used. "
31+
echo " c. The environment variable 'CAFC' must be empty or point to a Fortran compiler/linker. "
32+
echo " d. If 'CAFC' is empty, a default value of 'mpif90' is used. "
3333
echo ""
3434
echo " 2. With non-OCA CAF compilers (Intel or Cray),"
3535
echo " a. Observe restrictions 1a-d above."
@@ -60,9 +60,9 @@ if [ $# == 0 ]; then
6060
exit 1
6161
fi
6262

63-
# Default to "mpif90" Fortran compiler if environment variable FC has zero length:
64-
if [ -z "$FC" ]; then
65-
FC=mpif90
63+
# Default to "mpif90" Fortran compiler if environment variable CAFC has zero length:
64+
if [ -z "$CAFC" ]; then
65+
CAFC=mpif90
6666
fi
6767

6868
# TODO -- improve the syntax of the "set" command below to accepted an unlimited number of arguments
@@ -80,14 +80,14 @@ if [[ $1 == '-v' || $1 == '-V' || $1 == '--version' ]]; then
8080
echo "the file named COPYRIGHT-BSD3."
8181
echo ""
8282
elif [[ $1 == '-w' || $1 == '--wrapping' || $1 == '--wraps' ]]; then
83-
echo "caf wraps FC=$FC"
83+
echo "caf wraps CAFC=$CAFC"
8484
elif [[ $1 == '-h' || $1 == '--help' ]]; then
8585
# Print usage information
8686
usage | less
8787
exit 1
8888
elif [ "$caf_compiler" = "true" ]; then
8989
# Nothing to do other than invoke the compiler with all the command-line arguments:
90-
$FC "$@" -L $caf_lib_dir $link_args
90+
$CAFC "$@" -L $caf_lib_dir $link_args
9191
else
9292
# Verify that a file with the .f90, .F90, .f, or .F extension is the first argument:
9393
src_extension=`echo "$1" | cut -f2 -d'.'`
@@ -108,7 +108,7 @@ else
108108
# Replace the file name in command-line argment 1 with the new name beofre invoking the compiler:
109109
set -- "caf-$1" "${@:2:max_arguments}"
110110
# Invoke the compiler along with all command-line arguments:
111-
$FC "$@" -L $caf_lib_dir -I $caf_mod_dir $link_args
111+
$CAFC "$@" -L $caf_lib_dir -I $caf_mod_dir $link_args
112112
else
113113
# Print usage information upon encountering an unknowon CAF source file extension
114114
usage | less

0 commit comments

Comments
 (0)