-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Details: * Adding --with-fc as a configure flag * FC and FCFLAGS can be adjusted at configure time Co-authored-by: ItsPitt <[email protected]>
- Loading branch information
1 parent
646ed90
commit f38dd83
Showing
8 changed files
with
457 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
AC_DEFUN([FLA_CHECK_WITH_FC], | ||
[ | ||
dnl Tell the user we're checking whether to enable the option. | ||
AC_MSG_CHECKING([whether user requested a specific Fortran compiler]) | ||
dnl Determine whether the user gave the --enable-<option> or | ||
dnl --disable-<option>. If so, then run the first snippet of code; | ||
dnl otherwise, run the second code block. | ||
AC_ARG_WITH([fc], | ||
AS_HELP_STRING([--with-fc=fc],[Search for and use a Fortran compiler named <fc>. If <fc> is not found, then use the first compiler found from the default search list for the detected build architecture.]), | ||
[ | ||
dnl If any form of the option is given, handle each case. | ||
if test "$withval" = "no" ; then | ||
dnl User provided --with-<option>=no or --without-<option>. | ||
fla_with_specific_fc=without | ||
fla_requested_fc='' | ||
elif test "$withval" = "yes" ; then | ||
dnl User provided --with-<option>=yes or --with-<option>. | ||
fla_with_specific_fc=no | ||
fla_requested_fc='' | ||
else | ||
dnl User provided argument value: --with-<option>=value. | ||
fla_with_specific_fc=yes | ||
fla_requested_fc=$withval | ||
fi | ||
], | ||
[ | ||
dnl User did not specify whether to enable or disable the option. | ||
dnl Default behavior is to disable the option. | ||
fla_with_specific_fc=no | ||
fla_requested_fc='' | ||
] | ||
) | ||
dnl Now act according to whether a specific value was given. | ||
if test "$fla_with_specific_fc" = "yes" ; then | ||
dnl Output the result. | ||
AC_MSG_RESULT([yes ($fla_requested_fc)]) | ||
elif test "$fla_with_specific_fc" = "without" ; then | ||
dnl Output the result. | ||
AC_MSG_RESULT([no]) | ||
dnl The user requested --with-fc=no or --without-fc. Scold him. | ||
AC_MSG_ERROR([[Detected --without-fc. Cannot continue with Fortran compiler disabled!]]) | ||
else | ||
dnl Output the result. | ||
AC_MSG_RESULT([no]) | ||
fi | ||
dnl Check for FC environment variable, which would override everything else. | ||
if test "$FC" != "" ; then | ||
AC_MSG_NOTICE([[FC environment variable is set to $FC, which will override --with-fc option and default search list for Fortran compiler.]]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
AC_DEFUN([FLA_REQUIRE_FC], | ||
[ | ||
AC_REQUIRE([FLA_OBSERVE_HOST_CPU_TYPE]) | ||
dnl Save the value of FFLAGS. This will come in useful later in determining | ||
dnl whether the user provided his own definition of FFLAGS. | ||
fla_userdef_fflags=$FFLAGS | ||
dnl Find a Fortran compiler. | ||
dnl If the FC environment variable is not already set, search for the | ||
dnl compiler defined by fla_requested_fc (which may be empty) and then | ||
dnl continue searching for the compilers in $fla_f_compiler_list, if | ||
dnl necessary. | ||
fla_f_compiler_list="gfortran f77 g77 xlf frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor" | ||
AC_PROG_FC([$fla_requested_fc $fla_f_compiler_list]) | ||
if test "$FC" = "" ; then | ||
AC_MSG_ERROR([Could not locate any of the following Fortran compilers: $FC $fla_requested_fc $fla_f_compiler_list. Cannot continue without a Fortran compiler.],[1]) | ||
fi | ||
dnl Ascertain the compiler "vendor". | ||
dnl FC_VENDOR=$(echo "$FC" | egrep -o 'gfortran|f77|g77|xlf|frt|pgf77|cf77|fort77|fl32|af77|xlf90|f90|pgf90|pghpf|epcf90|g95|xlf95|f95|fort|ifort|ifc|efc|pgfortran|pgf95|lf95|ftn|nagfor' | { read first rest ; echo $first ; }) | ||
dnl AC_MSG_NOTICE([[FC_VENDOR environment variable is set to ${FC_VENDOR}.]]) | ||
dnl Substitute the user-defined FFLAGS into the autoconf output files. | ||
AC_SUBST(fla_userdef_fflags) | ||
dnl AC_SUBST(FC_VENDOR) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.