libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd configure.in configure


From: Edward Rosten
Subject: [libcvd-members] libcvd configure.in configure
Date: Tue, 11 Jul 2006 17:06:59 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        06/07/11 17:06:59

Modified files:
        .              : configure.in configure 

Log message:
        Modified fortran library testing. Unfortunately, AC_FC_LIBRARY_LDFLAGS 
        seems to be broken on RHEL (or maybe just my machine). The new script 
checks
        if AC_FC_LIBRARY_LDFLAGS breaks compiling, and reverts to the old test 
in
        this case.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.69&r2=1.70

Patches:
Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- configure.in        6 Jul 2006 16:44:58 -0000       1.67
+++ configure.in        11 Jul 2006 17:06:59 -0000      1.68
@@ -511,6 +511,7 @@
        fi
 fi
 
+define([ER_M4_PASTE], [$1$2])
 
 if test "$toon" = yes && test "$lapack" = no
 then
@@ -522,10 +523,41 @@
   # Fortran main is needed (see the Autoconf manual). Currently, no machines
   # we compile on seem to need this.
 
+       save_LIBS="$LIBS"
   LIBS="$LIBS $FCLIBS"
 
-  #NB, the AC_CHECK_LIB function automatically sets up $LIBS so that it 
contains
-  #the library just checked for. Which is quite handy.
+
+       AC_MSG_CHECKING([quality of Ac_FC_LIBRARY_LDFLAGS])
+       AC_LINK_IFELSE([int main(){return 0;}], [fc=good],[fc=b0rked]);
+       AC_MSG_RESULT($fc)
+
+       f2c="Missing"
+       if test $fc == b0rked
+       then
+               AC_MSG_NOTICE(Reverting to old fortran library test.)
+
+               AC_MSG_CHECKING([for C to fortran library])
+
+               #The linking testing function AC_LINK_IFELSE uses LIBS in the 
+               #linking stage, so we communicate our requirements by using this
+               LIBS="$save_LIBS -lf2c"
+               AC_LINK_IFELSE([int main(){return 0;}], [f2c=f2c])
+
+               LIBS="$save_LIBS -lg2c"
+               AC_LINK_IFELSE([int main(){return 0;}], [f2c=g2c])
+
+               AC_MSG_RESULT($f2c)
+
+               if test $f2c != Missing
+               then
+                       dodginess_options="$dodginess_options 
broken_Ac_FC_LIBRARY_LDFLAGS"
+               fi
+       fi
+       
+       if test $fc$f2c != b0rkedMissing
+       then
+               #$LIBS should either havf FCLIBS or -l$f2c present
+
   AC_CHECK_LIB(blas,  dgemm_)
   if test x$ac_cv_lib_blas_dgemm_ != xyes
   then
@@ -540,17 +572,15 @@
       lapack=yes
     fi
   fi
+       fi
 
   if test "$lapack" = no
   then
-    TOON_LIBS=""
+               LIBS="$save_LIBS"
   else
-    TOON_LIBS="-lblas -llapack $FCLIBS"
     AC_SUBST(have_lapack,yes)
     AC_DEFINE(CVD_HAVE_LAPACK)
   fi
-  LIBS="$TOON_LIBS $save_LIBS"
-
 fi
 
 

Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- configure   6 Jul 2006 16:44:58 -0000       1.69
+++ configure   11 Jul 2006 17:06:59 -0000      1.70
@@ -4524,6 +4524,7 @@
 fi
 
 
+
 if test "$toon" = yes && test "$lapack" = no
 then
 
@@ -4621,7 +4622,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:4624:" \
+echo "$as_me:4625:" \
      "checking for Fortran compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -4816,7 +4817,7 @@
 # flags.
 ac_save_FFLAGS=$FCFLAGS
 FCFLAGS="$FCFLAGS $ac_verb"
-(eval echo $as_me:4819: \"$ac_link\") >&5
+(eval echo $as_me:4820: \"$ac_link\") >&5
 ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
 echo "$ac_fc_v_output" >&5
 FCFLAGS=$ac_save_FFLAGS
@@ -4894,7 +4895,7 @@
 # flags.
 ac_save_FFLAGS=$FCFLAGS
 FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v"
-(eval echo $as_me:4897: \"$ac_link\") >&5
+(eval echo $as_me:4898: \"$ac_link\") >&5
 ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
 echo "$ac_fc_v_output" >&5
 FCFLAGS=$ac_save_FFLAGS
@@ -5070,10 +5071,143 @@
   # Fortran main is needed (see the Autoconf manual). Currently, no machines
   # we compile on seem to need this.
 
+       save_LIBS="$LIBS"
   LIBS="$LIBS $FCLIBS"
 
-  #NB, the AC_CHECK_LIB function automatically sets up $LIBS so that it 
contains
-  #the library just checked for. Which is quite handy.
+
+       echo "$as_me:$LINENO: checking quality of Ac_FC_LIBRARY_LDFLAGS" >&5
+echo $ECHO_N "checking quality of Ac_FC_LIBRARY_LDFLAGS... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+int main(){return 0;}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  fc=good
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fc=b0rked
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext;
+       echo "$as_me:$LINENO: result: $fc" >&5
+echo "${ECHO_T}$fc" >&6
+
+       f2c="Missing"
+       if test $fc == b0rked
+       then
+               { echo "$as_me:$LINENO: Reverting to old fortran library test." 
>&5
+echo "$as_me: Reverting to old fortran library test." >&6;}
+
+               echo "$as_me:$LINENO: checking for C to fortran library" >&5
+echo $ECHO_N "checking for C to fortran library... $ECHO_C" >&6
+
+               #The linking testing function AC_LINK_IFELSE uses LIBS in the
+               #linking stage, so we communicate our requirements by using this
+               LIBS="$save_LIBS -lf2c"
+               cat >conftest.$ac_ext <<_ACEOF
+int main(){return 0;}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  f2c=f2c
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+               LIBS="$save_LIBS -lg2c"
+               cat >conftest.$ac_ext <<_ACEOF
+int main(){return 0;}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  f2c=g2c
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+               echo "$as_me:$LINENO: result: $f2c" >&5
+echo "${ECHO_T}$f2c" >&6
+
+               if test $f2c != Missing
+               then
+                       dodginess_options="$dodginess_options 
broken_Ac_FC_LIBRARY_LDFLAGS"
+               fi
+       fi
+
+       if test $fc$f2c != b0rkedMissing
+       then
+               #$LIBS should either havf FCLIBS or -l$f2c present
+
 
 echo "$as_me:$LINENO: checking for dgemm_ in -lblas" >&5
 echo $ECHO_N "checking for dgemm_ in -lblas... $ECHO_C" >&6
@@ -5236,12 +5370,12 @@
       lapack=yes
     fi
   fi
+       fi
 
   if test "$lapack" = no
   then
-    TOON_LIBS=""
+               LIBS="$save_LIBS"
   else
-    TOON_LIBS="-lblas -llapack $FCLIBS"
     have_lapack=yes
 
     cat >>confdefs.h <<\_ACEOF
@@ -5249,8 +5383,6 @@
 _ACEOF
 
   fi
-  LIBS="$TOON_LIBS $save_LIBS"
-
 fi
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]