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 827 by gezelter, Tue Oct 28 16:02:29 2003 UTC vs.
Revision 948 by gezelter, Thu Jan 15 15:51:17 2004 UTC

# Line 7 | Line 7 | cat >conftest.f <<EOF
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.f <<EOF
10 > cat >conftest.f90 <<EOF
11          module conftest
12          integer n
13          parameter (n=1)
# Line 16 | Line 16 | if $F90 -c conftest.f > conftest.out 2>&1 ; then
16   # SGI and absoft compilers generates module name in upper case!
17   testname="conftest"
18   modcase="lower"
19 < if $F90 -c conftest.f > conftest.out 2>&1 ; then
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
# Line 58 | Line 58 | madedir=0
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 < madedir=0
62 < if test ! -d conf ; then mkdir conf ; madedir=1; fi
63 < cp $testname.$MOD conf
64 < rm -f conftest* CONFTEST*
65 < cat >conftest1.f <<EOF
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.f > conftest.out 2>&1 ; then
91 <    MODDIRFLAG="-I"
92 <    F90MODINCSPEC="-I<dir>"
93 <    AC_MSG_RESULT(-I)
94 < elif $F90 -c -Mconf conftest1.f >> conftest.out 2>&1 ; then
95 <    MODDIRFLAG="-M"
96 <    F90MODINCSPEC="-M<dir>"
97 <    AC_MSG_RESULT(-M)
98 < elif $F90 -c -pconf conftest1.f >> 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
109 < directories])
110 <         F90_WORK_FILES_ARG="-cl,mpimod.pcl"
111 <         F90MODINCSPEC="-cl,<dir>/<file>mod.pcl"
112 <         AC_SUBST(F90_WORK_FILES_ARG)
113 <     else
114 <         # The version of the Intel compiler that I have refuses to let
115 <         # you put the "work catalog" list anywhere but the current directory.
99 <         # For example, you cannot in
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
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
103 if test -z "MODDIRFLAG" ; then
104    AC_MSG_RESULT(unknown)
105 fi
106 AC_SUBST(MODDIRFLAG)
107 AC_SUBST(F90MODINCSPEC)
108 rm -f conftest* conf/conftest* conf/CONFTEST* CONFTEST* conf/mpimod*
109 if test $madedir = 1 ; then rmdir conf ; fi
127  
128   ])
129  
# Line 154 | 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   ])
178  
179  
180 +
181 +
182   dnl
183   dnl AM_PATH_SPRNG
184   dnl
# Line 236 | Line 255 | AC_ARG_WITH(mkl,
255   AC_DEFUN([CHECK_MKL],
256   [AC_MSG_CHECKING(if MKL is wanted)
257   AC_ARG_WITH(mkl,
258 <              [  --with-mkl              Do we want MKL [will check /usr/local/intel/mkl60 /opt/intel/mkl60]],
258 >              [  --with-mkl              Do we want MKL [will check /usr/local/intel/mkl61 /opt/intel/mkl61]],
259   [   AC_MSG_RESULT(yes)
260 <    for dir in $withval /usr/local/intel/mkl60 /opt/intel/mkl60; do
260 >    for dir in $withval /usr/local/intel/mkl61 /opt/intel/mkl61; do
261          mkldir="$dir"
262          if test -f "$dir/include/mkl.h"; then
263              found_mkl="yes";
# Line 282 | Line 301 | AC_DEFUN(ACX_CHECK_CC_FLAGS,
301   ])
302   dnl
303  
304 +
305   AC_DEFUN(ACX_CHECK_CC_FLAGS,
306   [
307   AC_REQUIRE([AC_PROG_CC])
# Line 362 | Line 382 | cat > conftest.c <<EOF
382   [
383   dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
384   cat > conftest.c <<EOF
385 < #ifdef __GNUC__
385 > #ifdef __GNUC__ && !defined (__INTEL_COMPILER)
386   #  if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2)
387       yes;
388   #  endif
# Line 375 | Line 395 | if test "$ac_cv_prog_gcc_$1_$2" = yes; then
395   fi
396   ])
397   if test "$ac_cv_prog_gcc_$1_$2" = yes; then
398 +        :
399 +        $3
400 + else
401 +        :
402 +        $4
403 + fi
404 + ])
405 +
406 + AC_DEFUN(ACX_PROG_GXX_VERSION,
407 + [
408 + AC_REQUIRE([AC_PROG_CXX])
409 + AC_CACHE_CHECK(whether we are using g++ $1.$2 or later, ac_cv_prog_gxx_$1_$2,
410 + [
411 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
412 + cat > conftest.cpp <<EOF
413 + #ifdef __GNUC__ && !defined (__INTEL_COMPILER)
414 + #  if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2)
415 +     yes;
416 + #  endif
417 + #endif
418 + EOF
419 + if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then
420 +  ac_cv_prog_gxx_$1_$2=yes
421 + else
422 +  ac_cv_prog_gxx_$1_$2=no
423 + fi
424 + ])
425 + if test "$ac_cv_prog_gxx_$1_$2" = yes; then
426          :
427          $3
428   else
# Line 383 | Line 431 | fi
431   fi
432   ])
433  
434 + AC_DEFUN(ACX_PROG_REALLY_GCC,
435 + [
436 + AC_REQUIRE([AC_PROG_CC])
437 + AC_CACHE_CHECK(whether we are *really* using GNU cc, ac_cv_prog_really_gcc,
438 + [
439 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
440 + cat > conftest.c <<EOF
441 + #ifdef __GNUC__
442 +  #ifndef __INTEL_COMPILER
443 +     yes;
444 +  #endif
445 + #endif
446 + EOF
447 + if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
448 +  ac_cv_prog_really_gcc=yes
449 + else
450 +  ac_cv_prog_really_gcc=no
451 + fi
452 + ])
453 + if test "$ac_cv_prog_really_gcc" = yes; then
454 +        :
455 +        $1
456 + else
457 +        :
458 +        $2
459 + fi
460 + ])
461  
462 + AC_DEFUN(ACX_PROG_REALLY_GXX,
463 + [
464 + AC_REQUIRE([AC_PROG_CXX])
465 + AC_CACHE_CHECK(whether we are *really* using GNU c++, ac_cv_prog_really_gxx,
466 + [
467 + dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
468 + cat > conftest.cpp <<EOF
469 + #ifdef __GNUC__
470 +  #ifndef __INTEL_COMPILER
471 +     yes;
472 +  #endif
473 + #endif
474 + EOF
475 + if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then
476 +  ac_cv_prog_really_gxx=yes
477 + else
478 +  ac_cv_prog_really_gxx=no
479 + fi
480 + ])
481 + if test "$ac_cv_prog_really_gxx" = yes; then
482 +        :
483 +        $1
484 + else
485 +        :
486 +        $2
487 + fi
488 + ])
489 +
490 +
491   AC_DEFUN(ACX_PROG_CC_MAXOPT,
492   [
493   AC_REQUIRE([AC_PROG_CC])
494   AC_REQUIRE([AC_CANONICAL_HOST])
495  
496 + ACX_PROG_REALLY_GCC
497 +
498   # Try to determine "good" native compiler flags if none specified on command
499   # line
500   if test "$ac_test_CFLAGS" != "set"; then
# Line 428 | Line 534 | if test "$ac_test_CFLAGS" != "set"; then
534          fi;;
535     *darwin*)
536          if test "$CC" = xlc -o "$CC" = cc; then
537 <                CFLAGS="-O3 -qtune=auto -w"
432 <                echo "*******************************************************"
433 <                echo "*  You have Darwin on an unknown powerpc system.      *"
434 <                echo "*  It is recommended that you use                     *"
435 <                echo "*                                                     *"
436 <                echo "*  CFLAGS=-O3 -qarch=ppc -qtune=xxx -qansialias -w    *"
437 <                echo "*                               ^^^                   *"
438 <                echo "*  where xxx is 601, 603, 604, or whatever kind of    *"
439 <                echo "*  PowerPC CPU you have.   For more info, man cc.     *"
440 <                echo "*******************************************************"
537 >                CFLAGS="-qthreaded -O5 -Q=20 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
538          fi;;
539    esac
540  
541    # use default flags for gcc on all systems
542 <  if test $ac_cv_prog_gcc = yes; then
542 >  if test $ac_cv_prog_really_gcc = yes; then
543       CFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
544    fi
545  
546    # test for gcc-specific flags:
547 <  if test $ac_cv_prog_gcc = yes; then
547 >  if test $ac_cv_prog_really_gcc = yes; then
548      # -malign-double for x86 systems
549      ACX_CHECK_CC_FLAGS(-malign-double,align_double, CFLAGS="$CFLAGS -malign-double")
550      # -fstrict-aliasing for gcc-2.95+
# Line 455 | Line 552 | if test "$ac_test_CFLAGS" != "set"; then
552    fi
553  
554    CPU_FLAGS=""
555 <  if test "$GCC" = "yes"; then
555 >  if test $ac_cv_prog_really_gcc = yes; then
556            dnl try to guess correct CPU flags, at least for linux
557            case "${host_cpu}" in
558            i586*)  ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
# Line 524 | Line 621 | AC_REQUIRE([AC_CANONICAL_HOST])
621   AC_REQUIRE([AC_PROG_CXX])
622   AC_REQUIRE([AC_CANONICAL_HOST])
623  
624 + ACX_PROG_REALLY_GXX
625 +
626   # Try to determine "good" native compiler flags if none specified on command
627   # line
628   if test "$ac_test_CXXFLAGS" != "set"; then
# Line 554 | Line 653 | if test "$ac_test_CXXFLAGS" != "set"; then
653          fi;;
654     *darwin*)
655          if test "$CXX" = xlC; then
656 <                CXXFLAGS="-O3 -qtune=auto -qansialias -w"
558 <                echo "*******************************************************"
559 <                echo "*  You have AIX on an unknown powerpc system.  It is  *"
560 <                echo "*  recommended that you use                           *"
561 <                echo "*                                                     *"
562 <                echo "*  CXXFLAGS=-O3 -qarch=ppc -qtune=xxx -qansialias -w  *"
563 <                echo "*                                 ^^^                 *"
564 <                echo "*  where xxx is 601, 603, 604, or whatever kind of    *"
565 <                echo "*  PowerPC CPU you have.   For more info, man cc.     *"
566 <                echo "*******************************************************"
656 >                CXXFLAGS="-qthreaded -O5 -Q=20 -qtune=auto -qarch=auto -qunroll=auto -qaltivec"
657          fi;;
658    esac
659  
660    # use default flags for gcc on all systems
661 <  if test $ac_cv_prog_gcc = yes; then
661 >  if test $ac_cv_prog_really_gxx = yes; then
662       CXXFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic"
663    fi
664  
665    # test for gcc-specific flags:
666 <  if test $ac_cv_prog_gcc = yes; then
666 >  if test $ac_cv_prog_really_gxx = yes; then
667      # -malign-double for x86 systems
668      ACX_CHECK_CXX_FLAGS(-malign-double,align_double, CXXFLAGS="$CXXFLAGS -malign-double")
669      # -fstrict-aliasing for gcc-2.95+
# Line 581 | Line 671 | if test "$ac_test_CXXFLAGS" != "set"; then
671    fi
672  
673    CPU_FLAGS=""
674 <  if test "$GCC" = "yes"; then
674 >  if test $ac_cv_prog_really_gxx = yes; then
675            dnl try to guess correct CPU flags, at least for linux
676            case "${host_cpu}" in
677 <          i586*)  ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium,
677 >          i586*)  ACX_CHECK_CXX_FLAGS(-mcpu=pentium,cpu_pentium,
678                          [CPU_FLAGS=-mcpu=pentium],
679                          [ACX_CHECK_CXX_FLAGS(-mpentium,pentium,
680                                  [CPU_FLAGS=-mpentium])])
# Line 601 | Line 691 | if test "$ac_test_CXXFLAGS" != "set"; then
691                          ACX_CHECK_CXX_FLAGS(-mcpu=$cputype,m_cpu_60x,
692                                  CPU_FLAGS=-mcpu=$cputype)
693                  elif test "$cputype" = 750; then
694 <                        ACX_PROG_GCC_VERSION(2,95,
694 >                        ACX_PROG_GXX_VERSION(2,95,
695                                  ACX_CHECK_CXX_FLAGS(-mcpu=750,m_cpu_750,
696                                          CPU_FLAGS=-mcpu=750))
697                  fi
# Line 657 | Line 747 | if test x"$F90FLAGS" = x ; then
747    F90FLAGS=""
748    case "${host_cpu}-${host_os}" in
749  
750 <  *linux*) if test "$F90" = ifc; then
750 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
751                      F90FLAGS="-O"
752                  fi;;
753     rs6000*-aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 678 | Line 768 | if test x"$F90FLAGS" = x ; then
768          fi;;
769     *darwin*)
770          if test "$F90" = f90 -o "$F90" = xlf90; then
771 <                F90FLAGS="-O3 -qtune=auto -w"
682 <                echo "*********************************************************"
683 <                echo "*  You have Darwin on an unknown powerpc system.  It is *"
684 <                echo "*  recommended that you use                             *"
685 <                echo "*                                                       *"
686 <                echo "*  CXXFLAGS=-O3 -qarch=ppc -qtune=xxx -qansialias -w    *"
687 <                echo "*                                 ^^^                   *"
688 <                echo "*  where xxx is 601, 603, 604, or whatever kind of      *"
689 <                echo "*  PowerPC CPU you have.   For more info, man xlf.      *"
690 <                echo "*********************************************************"
771 >                F90FLAGS="-qthreaded -O5 -qtune=auto -qarch=auto -qunroll=auto"
772          fi;;
773    esac
774  
# Line 732 | Line 813 | if test "$ac_test_PREPFLAG" != "set"; then
813    PREPFLAG=""
814    case "${host_cpu}-${host_os}" in
815  
816 <  *linux*) if test "$F90" = ifc; then
816 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
817                      PREPFLAG="-fpp1 "
818                  fi;;
819    *aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 745 | Line 826 | if test "$ac_test_PREPFLAG" != "set"; then
826    esac
827  
828    if test -z "$PREPFLAG"; then
829 <        echo ""
749 <        echo "**********************************************************"
750 <        echo "* WARNING: Don't know the best PREPFLAG for this system  *"
751 <        echo "* Use  make PREPFLAG=..., or edit the top level Makefile *"
752 <        echo "* (otherwise, an empty PREPFLAG will be used)            *"
753 <        echo "**********************************************************"
754 <        echo ""
829 >        AC_MSG_WARN("Using empty PREPFLAG")
830          PREPFLAG=""
831    fi
832  
# Line 773 | Line 848 | if test "$ac_test_PREPFLAG" != "set"; then
848    ac_ext=$ac_save_ext
849    AC_LANG_RESTORE()
850  
776
851    if test "$prepflagworks" = 1; then
852      AC_MSG_RESULT(yes)
853      AC_SUBST(PREPFLAG)
# Line 797 | Line 871 | if test "$ac_test_PREPDEFFLAG" != "set"; then
871    PREPDEFFLAG=""
872    case "${host_cpu}-${host_os}" in
873  
874 <  *linux*) if test "$F90" = ifc; then
874 >  *linux*) if test "$F90" = ifc -o "$F90" = ifort; then
875                      PREPDEFFLAG=" "
876                  fi;;
877    *aix*)  if test "$F90" = xlf90 -o "$F90" = f90; then
# Line 810 | Line 884 | if test "$ac_test_PREPDEFFLAG" != "set"; then
884    esac
885  
886    if test -z "$PREPDEFFLAG"; then
887 <        echo ""
814 <        echo "*************************************************************"
815 <        echo "* WARNING: Don't know the best PREPDEFFLAG for this system  *"
816 <        echo "* Use  make PREPDEFFLAG=..., or edit the top level Makefile *"
817 <        echo "* (otherwise, an empty PREPDEFFLAG will be used)            *"
818 <        echo "*************************************************************"
819 <        echo ""
887 >        AC_MSG_WARN("Using empty PREPDEFFLAG")
888          PREPDEFFLAG=" "
889    fi
890  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines