| 7 |
|
rm -f conftest* |
| 8 |
|
# Intel ifc compiler generates files by the name of work.pc and work.pcl (!) |
| 9 |
|
rm -f work* |
| 10 |
< |
cat >conftest.f <<EOF |
| 10 |
> |
cat >conftest.f90 <<EOF |
| 11 |
|
module conftest |
| 12 |
|
integer n |
| 13 |
|
parameter (n=1) |
| 16 |
|
# SGI and absoft compilers generates module name in upper case! |
| 17 |
|
testname="conftest" |
| 18 |
|
modcase="lower" |
| 19 |
< |
if $F90 -c conftest.f > conftest.out 2>&1 ; then |
| 19 |
> |
if $F90 -c conftest.f90 > conftest.out 2>&1 ; then |
| 20 |
|
MOD=`ls conftest* | grep -v conftest.f | grep -v conftest.o` |
| 21 |
|
MOD=`echo "$MOD" | sed -e 's/conftest\.//g'` |
| 22 |
|
if test -z "$MOD" ; then |
| 58 |
|
# a file, it must contain a the name of a file ending in .pc . Ugh! |
| 59 |
|
# Use the module made above |
| 60 |
|
AC_MSG_CHECKING(for module directory path flag) |
| 61 |
< |
madedir=0 |
| 62 |
< |
if test ! -d conf ; then mkdir conf ; madedir=1; fi |
| 63 |
< |
cp $testname.$MOD conf |
| 64 |
< |
rm -f conftest* CONFTEST* |
| 65 |
< |
cat >conftest1.f <<EOF |
| 61 |
> |
rm -f conftest* |
| 62 |
> |
# Intel ifc compiler generates files by the name of work.pc and work.pcl (!) |
| 63 |
> |
rm -f work* |
| 64 |
> |
cat >conftest.f90 <<EOF |
| 65 |
> |
module conftest |
| 66 |
> |
integer n |
| 67 |
> |
parameter (n=1) |
| 68 |
> |
end module conftest |
| 69 |
> |
EOF |
| 70 |
> |
# SGI and absoft compilers generates module name in upper case! |
| 71 |
> |
testname="conftest" |
| 72 |
> |
if $F90 -c conftest.f90 > conftest.out 2>&1 ; then |
| 73 |
> |
mod=`ls CONFTEST* 2>/dev/null | grep -v CONFTEST.f | grep -v CONFTEST.o` |
| 74 |
> |
mod=`echo "$mod" | sed -e 's/CONFTEST\.//g'` |
| 75 |
> |
if test -n "$mod" ; then |
| 76 |
> |
testname="CONFTEST" |
| 77 |
> |
fi |
| 78 |
> |
madedir=0 |
| 79 |
> |
if test ! -d conf ; then mkdir conf ; madedir=1; fi |
| 80 |
> |
cp $testname.$MOD conf |
| 81 |
> |
rm -f conftest* CONFTEST* |
| 82 |
> |
cat >conftest1.f90 <<EOF |
| 83 |
|
program main |
| 84 |
|
use conftest |
| 85 |
|
print *, n |
| 86 |
|
end |
| 87 |
|
EOF |
| 88 |
< |
F90_WORK_FILES_ARG="" |
| 89 |
< |
F90MODINCSPEC="" |
| 90 |
< |
if $F90 -c -Iconf conftest1.f > conftest.out 2>&1 ; then |
| 91 |
< |
MODDIRFLAG="-I" |
| 92 |
< |
F90MODINCSPEC="-I<dir>" |
| 93 |
< |
AC_MSG_RESULT(-I) |
| 94 |
< |
elif $F90 -c -Mconf conftest1.f >> conftest.out 2>&1 ; then |
| 95 |
< |
MODDIRFLAG="-M" |
| 96 |
< |
F90MODINCSPEC="-M<dir>" |
| 97 |
< |
AC_MSG_RESULT(-M) |
| 98 |
< |
elif $F90 -c -pconf conftest1.f >> conftest.out 2>&1 ; then |
| 99 |
< |
MODDIRFLAG="-p" |
| 100 |
< |
F90MODINCSPEC="-p<dir>" |
| 101 |
< |
AC_MSG_RESULT(-p) |
| 102 |
< |
elif test -s work.pc ; then |
| 103 |
< |
cp work.pc conf/mpimod.pc |
| 104 |
< |
echo "mpimod.pc" > conf/mpimod.pcl |
| 105 |
< |
echo "`pwd`/conf/mpimod.pc" >> conf/mpimod.pcl |
| 106 |
< |
if $F90 -c -cl,conf/mpimod.pcl conftest1.f >>conftest.out 2>&1 ; then |
| 107 |
< |
MODDIRFLAG='-cl,mpimod.pcl' |
| 108 |
< |
AC_MSG_RESULT([-cl,filename where filename contains a list of files and |
| 109 |
< |
directories]) |
| 110 |
< |
F90_WORK_FILES_ARG="-cl,mpimod.pcl" |
| 111 |
< |
F90MODINCSPEC="-cl,<dir>/<file>mod.pcl" |
| 112 |
< |
AC_SUBST(F90_WORK_FILES_ARG) |
| 113 |
< |
else |
| 114 |
< |
# The version of the Intel compiler that I have refuses to let |
| 115 |
< |
# you put the "work catalog" list anywhere but the current directory. |
| 99 |
< |
# For example, you cannot in |
| 88 |
> |
F90_WORK_FILES_ARG="" |
| 89 |
> |
F90MODINCSPEC="" |
| 90 |
> |
if $F90 -c -Iconf conftest1.f90 > conftest.out 2>&1 ; then |
| 91 |
> |
MODDIRFLAG="-I" |
| 92 |
> |
F90MODINCSPEC="-I<dir>" |
| 93 |
> |
AC_MSG_RESULT(-I) |
| 94 |
> |
elif $F90 -c -Mconf conftest1.f90 >> conftest.out 2>&1 ; then |
| 95 |
> |
MODDIRFLAG="-M" |
| 96 |
> |
F90MODINCSPEC="-M<dir>" |
| 97 |
> |
AC_MSG_RESULT(-M) |
| 98 |
> |
elif $F90 -c -pconf conftest1.f90 >> conftest.out 2>&1 ; then |
| 99 |
> |
MODDIRFLAG="-p" |
| 100 |
> |
F90MODINCSPEC="-p<dir>" |
| 101 |
> |
AC_MSG_RESULT(-p) |
| 102 |
> |
elif test -s work.pc ; then |
| 103 |
> |
cp work.pc conf/mpimod.pc |
| 104 |
> |
echo "mpimod.pc" > conf/mpimod.pcl |
| 105 |
> |
echo "`pwd`/conf/mpimod.pc" >> conf/mpimod.pcl |
| 106 |
> |
if $F90 -c -cl,conf/mpimod.pcl conftest1.f >>conftest.out 2>&1 ; then |
| 107 |
> |
MODDIRFLAG='-cl,mpimod.pcl' |
| 108 |
> |
AC_MSG_RESULT([-cl,filename where filename contains a list of files and directories]) |
| 109 |
> |
F90_WORK_FILES_ARG="-cl,mpimod.pcl" |
| 110 |
> |
F90MODINCSPEC="-cl,<dir>/<file>mod.pcl" |
| 111 |
> |
AC_SUBST(F90_WORK_FILES_ARG) |
| 112 |
> |
else |
| 113 |
> |
# The version of the Intel compiler that I have refuses to let |
| 114 |
> |
# you put the "work catalog" list anywhere but the current |
| 115 |
> |
# directory. For example, you cannot in |
| 116 |
|
: |
| 117 |
< |
fi |
| 118 |
< |
fi |
| 119 |
< |
if test -z "MODDIRFLAG" ; then |
| 120 |
< |
AC_MSG_RESULT(unknown) |
| 117 |
> |
fi |
| 118 |
> |
fi |
| 119 |
> |
if test -z "MODDIRFLAG" ; then |
| 120 |
> |
AC_MSG_RESULT(unknown) |
| 121 |
> |
fi |
| 122 |
> |
AC_SUBST(MODDIRFLAG) |
| 123 |
> |
AC_SUBST(F90MODINCSPEC) |
| 124 |
> |
rm -f conftest* conf/conftest* conf/CONFTEST* CONFTEST* conf/mpimod* |
| 125 |
> |
if test $madedir = 1 ; then rmdir conf ; fi |
| 126 |
|
fi |
| 106 |
– |
AC_SUBST(MODDIRFLAG) |
| 107 |
– |
AC_SUBST(F90MODINCSPEC) |
| 108 |
– |
rm -f conftest* conf/conftest* conf/CONFTEST* CONFTEST* conf/mpimod* |
| 109 |
– |
if test $madedir = 1 ; then rmdir conf ; fi |
| 127 |
|
|
| 128 |
|
]) |
| 129 |
|
|