2142
2142
} # ac_fn_f77_try_link
2144
# ac_fn_fc_try_link LINENO
2145
# ------------------------
2146
# Try to link conftest.$ac_ext, and return whether this succeeded.
2147
ac_fn_fc_try_link ()
2149
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2150
rm -f conftest.$ac_objext conftest$ac_exeext
2151
if { { ac_try="$ac_link"
2153
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2154
*) ac_try_echo=$ac_try;;
2156
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2157
$as_echo "$ac_try_echo"; } >&5
2158
(eval "$ac_link") 2>conftest.err
2160
if test -s conftest.err; then
2161
grep -v '^ *+' conftest.err >conftest.er1
2162
cat conftest.er1 >&5
2163
mv -f conftest.er1 conftest.err
2165
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2166
test $ac_status = 0; } && {
2167
test -z "$ac_fc_werror_flag" ||
2168
test ! -s conftest.err
2169
} && test -s conftest$ac_exeext && {
2170
test "$cross_compiling" = yes ||
2171
$as_test_x conftest$ac_exeext
2175
$as_echo "$as_me: failed program was:" >&5
2176
sed 's/^/| /' conftest.$ac_ext >&5
2180
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2181
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2182
# interfere with the next link command; also delete a directory that is
2183
# left behind by Apple's compiler. We do this before executing the actions.
2184
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2185
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2186
as_fn_set_status $ac_retval
2188
} # ac_fn_fc_try_link
2144
2190
# ac_fn_c_check_func LINENO FUNC VAR
2145
2191
# ----------------------------------
2146
2192
# Tests whether FUNC exists, setting the cache variable VAR accordingly
2225
2271
} # ac_fn_c_check_func
2227
# ac_fn_fc_try_link LINENO
2228
# ------------------------
2229
# Try to link conftest.$ac_ext, and return whether this succeeded.
2230
ac_fn_fc_try_link ()
2232
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2233
rm -f conftest.$ac_objext conftest$ac_exeext
2234
if { { ac_try="$ac_link"
2236
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2237
*) ac_try_echo=$ac_try;;
2239
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2240
$as_echo "$ac_try_echo"; } >&5
2241
(eval "$ac_link") 2>conftest.err
2243
if test -s conftest.err; then
2244
grep -v '^ *+' conftest.err >conftest.er1
2245
cat conftest.er1 >&5
2246
mv -f conftest.er1 conftest.err
2248
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2249
test $ac_status = 0; } && {
2250
test -z "$ac_fc_werror_flag" ||
2251
test ! -s conftest.err
2252
} && test -s conftest$ac_exeext && {
2253
test "$cross_compiling" = yes ||
2254
$as_test_x conftest$ac_exeext
2258
$as_echo "$as_me: failed program was:" >&5
2259
sed 's/^/| /' conftest.$ac_ext >&5
2263
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
2264
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
2265
# interfere with the next link command; also delete a directory that is
2266
# left behind by Apple's compiler. We do this before executing the actions.
2267
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
2268
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2269
as_fn_set_status $ac_retval
2271
} # ac_fn_fc_try_link
2273
2273
# ac_fn_fc_try_run LINENO
2274
2274
# -----------------------
2275
2275
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
11862
11861
as_fn_error $? "Could not link in the zoltan library... exiting " "$LINENO" 5
11865
# Save variables...
11865
# Small test for zoltan .mod files:
11866
ac_ext=${ac_fc_srcext-f}
11867
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
11868
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
11869
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
11872
# In fluidity's makefile we explicitly add CPPFLAGS, temporarily add it to
11873
# FCFLAGS here for this zoltan test:
11874
tmpFCFLAGS="$FCFLAGS"
11875
FCFLAGS="$FCFLAGS $CPPFLAGS"
11876
cat > conftest.$ac_ext <<_ACEOF
11878
program test_zoltan
11880
end program test_zoltan
11883
if ac_fn_fc_try_link "$LINENO"; then :
11885
{ $as_echo "$as_me:${as_lineno-$LINENO}: Great success! Zoltan .mod files exist and are usable" >&5
11886
$as_echo "$as_me: Great success! Zoltan .mod files exist and are usable" >&6;}
11890
cp conftest.F90 test_zoltan.F90
11891
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
11892
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
11893
as_fn_error $? "Failed to find zoltan.mod files
11894
See \`config.log' for more details" "$LINENO" 5; }
11896
rm -f core conftest.err conftest.$ac_objext \
11897
conftest$ac_exeext conftest.$ac_ext
11898
# And now revert FCFLAGS
11899
FCFLAGS="$tmpFCFLAGS"
11867
11901
ac_cpp='$CPP $CPPFLAGS'
11868
11902
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11934
11968
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11935
11969
ac_compiler_gnu=$ac_cv_c_compiler_gnu
11937
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for adj_register_equation in -ladjoint" >&5
11938
$as_echo_n "checking for adj_register_equation in -ladjoint... " >&6; }
11939
if ${ac_cv_lib_adjoint_adj_register_equation+:} false; then :
11971
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for adj_register_forward_source_callback in -ladjoint" >&5
11972
$as_echo_n "checking for adj_register_forward_source_callback in -ladjoint... " >&6; }
11973
if ${ac_cv_lib_adjoint_adj_register_forward_source_callback+:} false; then :
11940
11974
$as_echo_n "(cached) " >&6
11942
11976
ac_check_lib_save_LIBS=$LIBS
11973
return adj_register_equation ();
12007
return adj_register_forward_source_callback ();
11978
12012
if ac_fn_c_try_link "$LINENO"; then :
11979
ac_cv_lib_adjoint_adj_register_equation=yes
12013
ac_cv_lib_adjoint_adj_register_forward_source_callback=yes
11981
ac_cv_lib_adjoint_adj_register_equation=no
12015
ac_cv_lib_adjoint_adj_register_forward_source_callback=no
11983
12017
rm -f core conftest.err conftest.$ac_objext \
11984
12018
conftest$ac_exeext conftest.$ac_ext
11985
12019
LIBS=$ac_check_lib_save_LIBS
11987
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_adjoint_adj_register_equation" >&5
11988
$as_echo "$ac_cv_lib_adjoint_adj_register_equation" >&6; }
11989
if test "x$ac_cv_lib_adjoint_adj_register_equation" = xyes; then :
12021
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_adjoint_adj_register_forward_source_callback" >&5
12022
$as_echo "$ac_cv_lib_adjoint_adj_register_forward_source_callback" >&6; }
12023
if test "x$ac_cv_lib_adjoint_adj_register_forward_source_callback" = xyes; then :
11991
12025
$as_echo "#define HAVE_ADJOINT 1" >>confdefs.h
11992
12026
HAVE_ADJOINT=yes
12976
13008
# petsc tutorial - using the headers in the same way as we do in the code
12977
13009
cat > conftest.$ac_ext <<_ACEOF
12980
13012
#include "petscversion.h"
12981
13013
#ifdef HAVE_PETSC_MODULES
12983
#if PETSC_VERSION_MINOR==0
12990
13016
implicit none
12991
13017
#ifdef HAVE_PETSC_MODULES
12992
#include "finclude/petscvecdef.h"
12993
#include "finclude/petscmatdef.h"
12994
#include "finclude/petsckspdef.h"
12995
#include "finclude/petscpcdef.h"
13018
#include "finclude/petscdef.h"
12997
13020
#include "finclude/petsc.h"
12998
#if PETSC_VERSION_MINOR==0
12999
#include "finclude/petscvec.h"
13000
#include "finclude/petscmat.h"
13001
#include "finclude/petscksp.h"
13002
#include "finclude/petscpc.h"
13005
13022
double precision norm
13006
13023
PetscInt i,j,II,JJ,m,n,its
13007
13024
PetscInt Istart,Iend,ione
13008
13025
PetscErrorCode ierr
13009
#if PETSC_VERSION_MINOR==2
13026
#if PETSC_VERSION_MINOR>=2
13010
13027
PetscBool flg
13012
13029
PetscTruth flg
13096
cp conftest.F90 test.F90
13113
cp conftest.F90 test_petsc.F90
13097
13114
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13098
13115
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13099
13116
as_fn_error $? "Failed to compile and link PETSc program.
13113
13130
if ac_fn_c_compute_int "$LINENO" ""PETSC_VERSION_MAJOR"" "PETSC_VERSION_MAJOR" "#include \"petscversion.h\""; then :
13116
as_fn_error $? "Unknown petsc version" "$LINENO" 5
13133
as_fn_error $? "Unknown petsc major version" "$LINENO" 5
13119
if test "x$PETSC_VERSION_MAJOR" == "x3" ; then
13120
{ $as_echo "$as_me:${as_lineno-$LINENO}: Detected PETSc version 3" >&5
13121
$as_echo "$as_me: Detected PETSc version 3" >&6;}
13136
if ac_fn_c_compute_int "$LINENO" ""PETSC_VERSION_MINOR"" "PETSC_VERSION_MINOR" "#include \"petscversion.h\""; then :
13123
{ $as_echo "$as_me:${as_lineno-$LINENO}: Detected PETSc version \"$PETSC_VERSION_MAJOR\"" >&5
13124
$as_echo "$as_me: Detected PETSc version \"$PETSC_VERSION_MAJOR\"" >&6;}
13125
as_fn_error $? "Fluidity needs PETSc version 3" "$LINENO" 5
13139
as_fn_error $? "Unknown petsc minor version" "$LINENO" 5
13142
{ $as_echo "$as_me:${as_lineno-$LINENO}: Detected PETSc version \"$PETSC_VERSION_MAJOR\".\"$PETSC_VERSION_MINOR\"" >&5
13143
$as_echo "$as_me: Detected PETSc version \"$PETSC_VERSION_MAJOR\".\"$PETSC_VERSION_MINOR\"" >&6;}
13144
# if major<3 or minor<1
13145
if test "0$PETSC_VERSION_MAJOR" -lt 3 -o "0$PETSC_VERSION_MINOR" -lt 1; then
13146
as_fn_error $? "Fluidity needs PETSc version >=3.1" "$LINENO" 5