Merge lp:~fluidity-core/fluidity/fluidity_zoltan_configure_check into lp:fluidity

Proposed by Rhodri Davies
Status: Merged
Merged at revision: 4031
Proposed branch: lp:~fluidity-core/fluidity/fluidity_zoltan_configure_check
Merge into: lp:fluidity
Diff against target: 273 lines (+110/-60)
2 files modified
aclocal.m4 (+25/-7)
configure (+85/-53)
To merge this branch: bzr merge lp:~fluidity-core/fluidity/fluidity_zoltan_configure_check
Reviewer Review Type Date Requested Status
Jon Hill Approve
Review via email: mp+119988@code.launchpad.net

Description of the change

Add a test for zoltan.mod files during configure. Configure was previously passing even if they didn't exist.

To post a comment you must log in.
Revision history for this message
Jon Hill (jon-hill) wrote :

It looks like a few more changes have been added (petsc?), as well as the zoltan.mod test

It's also missing configure.in

review: Needs Fixing
Revision history for this message
Rhodri Davies (rhodri-davies) wrote :

Hi John,

The change to petsc was simply renaming the test from test.F90 to test_petsc.F90. This is to help differentiate between other tests that exist in configure. When my petsc test previously failed, a file test.F90 was dumped. Dumping this as test_petsc.F90 makes more sense to me.

There are also no changes to configure.in, as all changes are local (i.e. aclocal.m4)...

Rhod

Revision history for this message
Rhodri Davies (rhodri-davies) wrote :

I meant Jon!!

Revision history for this message
Jon Hill (jon-hill) wrote :

Should think so ;-)

OK, happy with that. Merge away!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aclocal.m4'
2--- aclocal.m4 2012-06-15 12:17:04 +0000
3+++ aclocal.m4 2012-08-16 17:22:34 +0000
4@@ -412,8 +412,6 @@
5 AC_MSG_ERROR( [You need to set PETSC_DIR to point at your PETSc installation... exiting] )
6 fi
7
8-
9-
10 PETSC_LINK_LIBS=`make -s -f petsc_makefile getlinklibs`
11 LIBS="$PETSC_LINK_LIBS $LIBS"
12
13@@ -467,7 +465,7 @@
14 # petsc tutorial - using the headers in the same way as we do in the code
15 AC_LINK_IFELSE(
16 [AC_LANG_SOURCE([
17-program test
18+program test_petsc
19 #include "petscversion.h"
20 #ifdef HAVE_PETSC_MODULES
21 use petsc
22@@ -574,13 +572,13 @@
23 call MatDestroy(A,ierr)
24
25 call PetscFinalize(ierr)
26-end program test
27+end program test_petsc
28 ])],
29 [
30 AC_MSG_NOTICE([PETSc program succesfully compiled and linked.])
31 ],
32 [
33-cp conftest.F90 test.F90
34+cp conftest.F90 test_petsc.F90
35 AC_MSG_FAILURE([Failed to compile and link PETSc program.])])
36
37 AC_LANG_RESTORE
38@@ -1006,7 +1004,6 @@
39 echo "note: using $zoltan_INCLUDES_PATH/zoltan.mod"
40 fi
41
42-
43 AC_LANG_SAVE
44 AC_LANG_C
45 AC_CHECK_LIB(
46@@ -1014,7 +1011,28 @@
47 [Zoltan_Initialize],
48 [AC_DEFINE(HAVE_ZOLTAN,1,[Define if you have zoltan library.])],
49 [AC_MSG_ERROR( [Could not link in the zoltan library... exiting] )] )
50-# Save variables...
51+
52+# Small test for zoltan .mod files:
53+AC_LANG(Fortran)
54+ac_ext=F90
55+# In fluidity's makefile we explicitly add CPPFLAGS, temporarily add it to
56+# FCFLAGS here for this zoltan test:
57+tmpFCFLAGS="$FCFLAGS"
58+FCFLAGS="$FCFLAGS $CPPFLAGS"
59+AC_LINK_IFELSE(
60+[AC_LANG_SOURCE([
61+program test_zoltan
62+ use zoltan
63+end program test_zoltan
64+])],
65+[
66+AC_MSG_NOTICE([Great success! Zoltan .mod files exist and are usable])
67+],
68+[
69+cp conftest.F90 test_zoltan.F90
70+AC_MSG_FAILURE([Failed to find zoltan.mod files])])
71+# And now revert FCFLAGS
72+FCFLAGS="$tmpFCFLAGS"
73 AC_LANG_RESTORE
74
75 ZOLTAN="yes"
76
77=== modified file 'configure'
78--- configure 2012-07-20 07:26:35 +0000
79+++ configure 2012-08-16 17:22:34 +0000
80@@ -2137,6 +2137,52 @@
81
82 } # ac_fn_f77_try_link
83
84+# ac_fn_fc_try_link LINENO
85+# ------------------------
86+# Try to link conftest.$ac_ext, and return whether this succeeded.
87+ac_fn_fc_try_link ()
88+{
89+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
90+ rm -f conftest.$ac_objext conftest$ac_exeext
91+ if { { ac_try="$ac_link"
92+case "(($ac_try" in
93+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
94+ *) ac_try_echo=$ac_try;;
95+esac
96+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
97+$as_echo "$ac_try_echo"; } >&5
98+ (eval "$ac_link") 2>conftest.err
99+ ac_status=$?
100+ if test -s conftest.err; then
101+ grep -v '^ *+' conftest.err >conftest.er1
102+ cat conftest.er1 >&5
103+ mv -f conftest.er1 conftest.err
104+ fi
105+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
106+ test $ac_status = 0; } && {
107+ test -z "$ac_fc_werror_flag" ||
108+ test ! -s conftest.err
109+ } && test -s conftest$ac_exeext && {
110+ test "$cross_compiling" = yes ||
111+ $as_test_x conftest$ac_exeext
112+ }; then :
113+ ac_retval=0
114+else
115+ $as_echo "$as_me: failed program was:" >&5
116+sed 's/^/| /' conftest.$ac_ext >&5
117+
118+ ac_retval=1
119+fi
120+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
121+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
122+ # interfere with the next link command; also delete a directory that is
123+ # left behind by Apple's compiler. We do this before executing the actions.
124+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
125+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
126+ as_fn_set_status $ac_retval
127+
128+} # ac_fn_fc_try_link
129+
130 # ac_fn_c_check_func LINENO FUNC VAR
131 # ----------------------------------
132 # Tests whether FUNC exists, setting the cache variable VAR accordingly
133@@ -2220,52 +2266,6 @@
134
135 } # ac_fn_c_check_func
136
137-# ac_fn_fc_try_link LINENO
138-# ------------------------
139-# Try to link conftest.$ac_ext, and return whether this succeeded.
140-ac_fn_fc_try_link ()
141-{
142- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
143- rm -f conftest.$ac_objext conftest$ac_exeext
144- if { { ac_try="$ac_link"
145-case "(($ac_try" in
146- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
147- *) ac_try_echo=$ac_try;;
148-esac
149-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
150-$as_echo "$ac_try_echo"; } >&5
151- (eval "$ac_link") 2>conftest.err
152- ac_status=$?
153- if test -s conftest.err; then
154- grep -v '^ *+' conftest.err >conftest.er1
155- cat conftest.er1 >&5
156- mv -f conftest.er1 conftest.err
157- fi
158- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
159- test $ac_status = 0; } && {
160- test -z "$ac_fc_werror_flag" ||
161- test ! -s conftest.err
162- } && test -s conftest$ac_exeext && {
163- test "$cross_compiling" = yes ||
164- $as_test_x conftest$ac_exeext
165- }; then :
166- ac_retval=0
167-else
168- $as_echo "$as_me: failed program was:" >&5
169-sed 's/^/| /' conftest.$ac_ext >&5
170-
171- ac_retval=1
172-fi
173- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
174- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
175- # interfere with the next link command; also delete a directory that is
176- # left behind by Apple's compiler. We do this before executing the actions.
177- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
178- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
179- as_fn_set_status $ac_retval
180-
181-} # ac_fn_fc_try_link
182-
183 # ac_fn_fc_try_run LINENO
184 # -----------------------
185 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
186@@ -11791,7 +11791,6 @@
187 fi
188
189
190-
191 ac_ext=c
192 ac_cpp='$CPP $CPPFLAGS'
193 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
194@@ -11858,7 +11857,42 @@
195 as_fn_error $? "Could not link in the zoltan library... exiting " "$LINENO" 5
196 fi
197
198-# Save variables...
199+
200+# Small test for zoltan .mod files:
201+ac_ext=${ac_fc_srcext-f}
202+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
203+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
204+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
205+
206+ac_ext=F90
207+# In fluidity's makefile we explicitly add CPPFLAGS, temporarily add it to
208+# FCFLAGS here for this zoltan test:
209+tmpFCFLAGS="$FCFLAGS"
210+FCFLAGS="$FCFLAGS $CPPFLAGS"
211+cat > conftest.$ac_ext <<_ACEOF
212+
213+program test_zoltan
214+ use zoltan
215+end program test_zoltan
216+
217+_ACEOF
218+if ac_fn_fc_try_link "$LINENO"; then :
219+
220+{ $as_echo "$as_me:${as_lineno-$LINENO}: Great success! Zoltan .mod files exist and are usable" >&5
221+$as_echo "$as_me: Great success! Zoltan .mod files exist and are usable" >&6;}
222+
223+else
224+
225+cp conftest.F90 test_zoltan.F90
226+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
227+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
228+as_fn_error $? "Failed to find zoltan.mod files
229+See \`config.log' for more details" "$LINENO" 5; }
230+fi
231+rm -f core conftest.err conftest.$ac_objext \
232+ conftest$ac_exeext conftest.$ac_ext
233+# And now revert FCFLAGS
234+FCFLAGS="$tmpFCFLAGS"
235 ac_ext=c
236 ac_cpp='$CPP $CPPFLAGS'
237 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
238@@ -12901,8 +12935,6 @@
239 as_fn_error $? "You need to set PETSC_DIR to point at your PETSc installation... exiting " "$LINENO" 5
240 fi
241
242-
243-
244 PETSC_LINK_LIBS=`make -s -f petsc_makefile getlinklibs`
245 LIBS="$PETSC_LINK_LIBS $LIBS"
246
247@@ -12972,7 +13004,7 @@
248 # petsc tutorial - using the headers in the same way as we do in the code
249 cat > conftest.$ac_ext <<_ACEOF
250
251-program test
252+program test_petsc
253 #include "petscversion.h"
254 #ifdef HAVE_PETSC_MODULES
255 use petsc
256@@ -13079,7 +13111,7 @@
257 call MatDestroy(A,ierr)
258
259 call PetscFinalize(ierr)
260-end program test
261+end program test_petsc
262
263 _ACEOF
264 if ac_fn_fc_try_link "$LINENO"; then :
265@@ -13089,7 +13121,7 @@
266
267 else
268
269-cp conftest.F90 test.F90
270+cp conftest.F90 test_petsc.F90
271 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
272 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
273 as_fn_error $? "Failed to compile and link PETSc program.