ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/ac-tools/aclocal.m4
(Generate patch)

Comparing trunk/OOPSE/ac-tools/aclocal.m4 (file contents):
Revision 816 by gezelter, Fri Oct 24 17:36:02 2003 UTC vs.
Revision 878 by gezelter, Fri Dec 12 15:42:13 2003 UTC

# Line 1 | Line 1
1 + dnl
2 + dnl AC_CHECK_MODSUFFIX
3 + dnl
4 + AC_DEFUN([AC_CHECK_MODSUFFIX],[
5 +
6 + AC_MSG_CHECKING(for module suffix)
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.f90 <<EOF
11 +        module conftest
12 +        integer n
13 +        parameter (n=1)
14 +        end module conftest
15 + EOF
16 + # SGI and absoft compilers generates module name in upper case!
17 + testname="conftest"
18 + modcase="lower"
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
23 +        MOD=`ls CONFTEST* 2>/dev/null \
24 +                | grep -v CONFTEST.f | grep -v CONFTEST.o`
25 +        MOD=`echo "$MOD" | sed -e 's/CONFTEST\.//g'`
26 +        if test -n "$MOD" ; then
27 +            testname="CONFTEST"
28 +            modcase="upper"
29 +        fi
30 +    fi
31 +    if test -z "$MOD" ; then
32 +        AC_MSG_RESULT(unknown)
33 +        # Use mod if we can't figure it out
34 +        MOD="mod"
35 +    else
36 +        AC_MSG_RESULT($MOD)
37 +    fi
38 +    if test -s work.pcl ; then
39 +        AC_MSG_WARN([Compiler generates auxillery files!])
40 +    fi
41 + else
42 +    AC_MSG_RESULT(unknown)
43 + fi
44 + AC_SUBST(MOD)
45 +
46 + ])
47 +
48 +
49 + dnl
50 + dnl AC_CHECK_MODDIRFLAG
51 + dnl
52 + AC_DEFUN([AC_CHECK_MODDIRFLAG],[
53 +
54 + # Check for module include path (some use -I, some (Solaris) use -M, some
55 + # (absoft) use -p).
56 + # Intel compilers use a wierd system: -cl,filename.pcl .  If no file is
57 + # specified, work.pcl and work.pc are created.  However, if you specify
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 + 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.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)
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
127 +
128 + ])
129 +
130 +
131   dnl
132   dnl AC_CHECK_MPI_F90MOD
133   dnl
# Line 12 | Line 142 | AC_DEFUN([AC_CHECK_MPI_F90MOD],[
142    AC_LANG_SAVE()
143    AC_LANG([Fortran 90])
144    ac_save_F90FLAGS=$F90FLAGS
145 <  AS_IF([test "$mpi_f90_mods"], [F90FLAGS="${F90FLAGS} -I${mpi_f90_mods}"])
145 >
146 >  AS_IF([test "$mpi_f90_mods"], [F90FLAGS="${F90FLAGS} ${MODDIRFLAG}${mpi_f90_mods}"])
147      _AC_COMPILE_IFELSE([
148      AC_LANG_PROGRAM([
149   use mpi
# Line 26 | Line 157 | call MPI_Init(ierr)
157    if test "$HAVE_MPI_MOD" = 1; then
158      AC_MSG_RESULT(yes)
159      AC_DEFINE(MPI_MOD, 1, [have mpi module])
160 <    MPI_F90_MODS="-I${mpi_f90_mods}"
160 >    MPI_F90_MODS="${mpi_f90_mods}"
161      AC_SUBST(MPI_F90_MODS)        
162      # The library name:
163      if test -z "$MPI_LIB" ; then
# Line 40 | Line 171 | call MPI_Init(ierr)
171      AC_SUBST(MPIMODLIBNAME)
172    else
173      AC_MSG_RESULT(no)
174 <    AC_MSG_ERROR([Couldn't locate MPI F90 Modules])
174 >    AC_MSG_WARN([Couldn't locate MPI F90 Modules])
175    fi
176  
177   ])
# Line 165 | Line 296 | AC_ARG_WITH(mkl,
296   [
297      AC_MSG_RESULT(no)
298   ])
299 + ])
300 + dnl
301 +
302 +
303 + dnl
304 + dnl CHECK_MPIFH
305 + dnl
306 + AC_DEFUN([CHECK_MPIFH],
307 +
308 + AC_MSG_CHECKING(for mpif.h include file)
309 +    for dir in $withval $MPI_INC  $MPI_DIR/include; do
310 +        mpifdir="$dir"
311 +        if test -f "$dir/mpif.h"; then
312 +            found_mpif="yes";
313 +            break;
314 +        fi
315 +    done
316 +    if test x_$found_mpif != x_yes; then
317 +        AC_MSG_ERROR(Cannot find mpif.h file)
318 +    else
319 +        printf "mpif.h found in $mpifdir\n";
320 +    fi
321 +
322 +  AC_LANG_SAVE()
323 +  AC_LANG([Fortran 90])
324 +  ac_save_CPPFLAGS=$CPPFLAGS
325 +  CPPFLAGS="${CPPFLAGS} -I${mkldir}/include"
326 +  ac_save_LDFLAGS=$LDFLAGS
327 +  LDFLAGS="${LDFLAGS} -L${mkldir}/lib/32 -lmkl -lvml -lguide"
328 +  AC_CHECK_HEADER(mkl.h, [
329 +    AC_CHECK_LIB(mkl,
330 +                 vslNewStream,
331 +                    [MKL_LIBDIR="${mkldir}/lib/32",
332 +                     MKL_LIB="-lmkl -lvml -lguide",
333 +                     HAVE_MKL="yes"])
334 +    ], [MKL_INC="-I${mkldir}/include"])
335 +  CPPFLAGS=$ac_save_CPPFLAGS
336 +  LDFLAGS=$ac_save_LDFLAGS
337 +  AC_LANG_RESTORE()
338 +  
339 +  if test x_$HAVE_MKL != x_yes; then
340 +        AC_MSG_ERROR(Can't build with MKL)
341 +  fi
342 +  AC_SUBST(MKL_LIBDIR)
343 +  AC_SUBST(MKL_LIB)
344 +  AC_SUBST(MKL_INC)
345 +  AC_SUBST(HAVE_MKL)
346 + ],
347 + [
348 +    AC_MSG_RESULT(no)
349   ])
350   dnl
351 +
352 +
353 +
354  
355   AC_DEFUN(ACX_CHECK_CC_FLAGS,
356   [
# Line 539 | Line 723 | if test x"$F90FLAGS" == x ; then
723   # Try to determine "good" native compiler flags if none specified on command
724   # line
725  
726 < if test x"$F90FLAGS" == x ; then
726 > if test x"$F90FLAGS" = x ; then
727    F90FLAGS=""
728    case "${host_cpu}-${host_os}" in
729  
# Line 631 | Line 815 | if test "$ac_test_PREPFLAG" != "set"; then
815    esac
816  
817    if test -z "$PREPFLAG"; then
818 <        echo ""
635 <        echo "**********************************************************"
636 <        echo "* WARNING: Don't know the best PREPFLAG for this system  *"
637 <        echo "* Use  make PREPFLAG=..., or edit the top level Makefile *"
638 <        echo "* (otherwise, an empty PREPFLAG will be used)            *"
639 <        echo "**********************************************************"
640 <        echo ""
818 >        AC_MSG_WARN("Using empty PREPFLAG")
819          PREPFLAG=""
820    fi
821  
822    AC_MSG_CHECKING(to make sure F90 preprocessor flag works)
823 <  AC_LANG_SAVE()
823 >  AC_LANG_SAVE(
824    AC_LANG([Fortran 90])
825    ac_save_ext=$ac_ext
826    ac_ext=F90
# Line 696 | Line 874 | if test "$ac_test_PREPDEFFLAG" != "set"; then
874    esac
875  
876    if test -z "$PREPDEFFLAG"; then
877 <        echo ""
700 <        echo "*************************************************************"
701 <        echo "* WARNING: Don't know the best PREPDEFFLAG for this system  *"
702 <        echo "* Use  make PREPDEFFLAG=..., or edit the top level Makefile *"
703 <        echo "* (otherwise, an empty PREPDEFFLAG will be used)            *"
704 <        echo "*************************************************************"
705 <        echo ""
877 >        AC_MSG_WARN("Using empty PREPDEFFLAG")
878          PREPDEFFLAG=" "
879    fi
880  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines