~fluidity-core/fluidity/sea-ice-branch

« back to all changes in this revision

Viewing changes to configure

  • Committer: Simon Mouradian
  • Date: 2012-10-19 10:35:59 UTC
  • mfrom: (3520.32.371 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20121019103559-y36qa47phc69q8sc
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
2141
2141
 
2142
2142
} # ac_fn_f77_try_link
2143
2143
 
 
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 ()
 
2148
{
 
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"
 
2152
case "(($ac_try" in
 
2153
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
 
2154
  *) ac_try_echo=$ac_try;;
 
2155
esac
 
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
 
2159
  ac_status=$?
 
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
 
2164
  fi
 
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
 
2172
       }; then :
 
2173
  ac_retval=0
 
2174
else
 
2175
  $as_echo "$as_me: failed program was:" >&5
 
2176
sed 's/^/| /' conftest.$ac_ext >&5
 
2177
 
 
2178
        ac_retval=1
 
2179
fi
 
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
 
2187
 
 
2188
} # ac_fn_fc_try_link
 
2189
 
2144
2190
# ac_fn_c_check_func LINENO FUNC VAR
2145
2191
# ----------------------------------
2146
2192
# Tests whether FUNC exists, setting the cache variable VAR accordingly
2224
2270
 
2225
2271
} # ac_fn_c_check_func
2226
2272
 
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 ()
2231
 
{
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"
2235
 
case "(($ac_try" in
2236
 
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2237
 
  *) ac_try_echo=$ac_try;;
2238
 
esac
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
2242
 
  ac_status=$?
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
2247
 
  fi
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
2255
 
       }; then :
2256
 
  ac_retval=0
2257
 
else
2258
 
  $as_echo "$as_me: failed program was:" >&5
2259
 
sed 's/^/| /' conftest.$ac_ext >&5
2260
 
 
2261
 
        ac_retval=1
2262
 
fi
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
2270
 
 
2271
 
} # ac_fn_fc_try_link
2272
 
 
2273
2273
# ac_fn_fc_try_run LINENO
2274
2274
# -----------------------
2275
2275
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
11795
11795
fi
11796
11796
 
11797
11797
 
11798
 
 
11799
11798
ac_ext=c
11800
11799
ac_cpp='$CPP $CPPFLAGS'
11801
11800
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11862
11861
  as_fn_error $? "Could not link in the zoltan library... exiting " "$LINENO" 5
11863
11862
fi
11864
11863
 
11865
 
# Save variables...
 
11864
 
 
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
 
11870
 
 
11871
ac_ext=F90
 
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
 
11877
 
 
11878
program test_zoltan
 
11879
 use zoltan
 
11880
end program test_zoltan
 
11881
 
 
11882
_ACEOF
 
11883
if ac_fn_fc_try_link "$LINENO"; then :
 
11884
 
 
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;}
 
11887
 
 
11888
else
 
11889
 
 
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; }
 
11895
fi
 
11896
rm -f core conftest.err conftest.$ac_objext \
 
11897
    conftest$ac_exeext conftest.$ac_ext
 
11898
# And now revert FCFLAGS
 
11899
FCFLAGS="$tmpFCFLAGS"
11866
11900
ac_ext=c
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
11936
11970
 
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
11941
11975
else
11942
11976
  ac_check_lib_save_LIBS=$LIBS
11950
11984
#ifdef __cplusplus
11951
11985
extern "C"
11952
11986
#endif
11953
 
char adj_register_equation ();
 
11987
char adj_register_forward_source_callback ();
11954
11988
#ifdef F77_DUMMY_MAIN
11955
11989
 
11956
11990
#  ifdef __cplusplus
11970
12004
int
11971
12005
main ()
11972
12006
{
11973
 
return adj_register_equation ();
 
12007
return adj_register_forward_source_callback ();
11974
12008
  ;
11975
12009
  return 0;
11976
12010
}
11977
12011
_ACEOF
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
11980
12014
else
11981
 
  ac_cv_lib_adjoint_adj_register_equation=no
 
12015
  ac_cv_lib_adjoint_adj_register_forward_source_callback=no
11982
12016
fi
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
11986
12020
fi
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 :
11990
12024
 
11991
12025
$as_echo "#define HAVE_ADJOINT 1" >>confdefs.h
11992
12026
HAVE_ADJOINT=yes
12905
12939
  as_fn_error $? "You need to set PETSC_DIR to point at your PETSc installation... exiting " "$LINENO" 5
12906
12940
fi
12907
12941
 
12908
 
 
12909
 
 
12910
12942
PETSC_LINK_LIBS=`make -s -f petsc_makefile getlinklibs`
12911
12943
LIBS="$PETSC_LINK_LIBS $LIBS"
12912
12944
 
12976
13008
# petsc tutorial - using the headers in the same way as we do in the code
12977
13009
cat > conftest.$ac_ext <<_ACEOF
12978
13010
 
12979
 
program test
 
13011
program test_petsc
12980
13012
#include "petscversion.h"
12981
13013
#ifdef HAVE_PETSC_MODULES
12982
13014
  use petsc
12983
 
#if PETSC_VERSION_MINOR==0
12984
 
  use petscvec
12985
 
  use petscmat
12986
 
  use petscksp
12987
 
  use petscpc
12988
 
#endif
12989
13015
#endif
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"
12996
13019
#else
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"
13003
 
#endif
13004
13021
#endif
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
13011
13028
#else
13012
13029
      PetscTruth  flg
13083
13100
      call MatDestroy(A,ierr)
13084
13101
 
13085
13102
      call PetscFinalize(ierr)
13086
 
end program test
 
13103
end program test_petsc
13087
13104
 
13088
13105
_ACEOF
13089
13106
if ac_fn_fc_try_link "$LINENO"; then :
13093
13110
 
13094
13111
else
13095
13112
 
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 :
13114
13131
 
13115
13132
else
13116
 
  as_fn_error $? "Unknown petsc version" "$LINENO" 5
 
13133
  as_fn_error $? "Unknown petsc major version" "$LINENO" 5
13117
13134
fi
13118
13135
 
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 :
 
13137
 
13122
13138
else
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
 
13140
fi
 
13141
 
 
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
13126
13147
fi
13127
13148
 
13128
13149