| 297 |
|
AC_MSG_RESULT(no) |
| 298 |
|
]) |
| 299 |
|
]) |
| 300 |
– |
dnl |
| 301 |
– |
|
| 302 |
– |
|
| 303 |
– |
dnl |
| 304 |
– |
dnl CHECK_MPIFH |
| 300 |
|
dnl |
| 306 |
– |
AC_DEFUN([CHECK_MPIFH], |
| 301 |
|
|
| 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 |
| 302 |
|
|
| 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 |
– |
|
| 303 |
|
AC_DEFUN(ACX_CHECK_CC_FLAGS, |
| 304 |
|
[ |
| 305 |
|
AC_REQUIRE([AC_PROG_CC]) |
| 380 |
|
[ |
| 381 |
|
dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp. |
| 382 |
|
cat > conftest.c <<EOF |
| 383 |
< |
#ifdef __GNUC__ |
| 383 |
> |
#ifdef __GNUC__ && !defined (__INTEL_COMPILER) |
| 384 |
|
# if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2) |
| 385 |
|
yes; |
| 386 |
|
# endif |
| 401 |
|
fi |
| 402 |
|
]) |
| 403 |
|
|
| 404 |
+ |
AC_DEFUN(ACX_PROG_GXX_VERSION, |
| 405 |
+ |
[ |
| 406 |
+ |
AC_REQUIRE([AC_PROG_CXX]) |
| 407 |
+ |
AC_CACHE_CHECK(whether we are using g++ $1.$2 or later, ac_cv_prog_gxx_$1_$2, |
| 408 |
+ |
[ |
| 409 |
+ |
dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp. |
| 410 |
+ |
cat > conftest.cpp <<EOF |
| 411 |
+ |
#ifdef __GNUC__ && !defined (__INTEL_COMPILER) |
| 412 |
+ |
# if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ >= $2) |
| 413 |
+ |
yes; |
| 414 |
+ |
# endif |
| 415 |
+ |
#endif |
| 416 |
+ |
EOF |
| 417 |
+ |
if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then |
| 418 |
+ |
ac_cv_prog_gxx_$1_$2=yes |
| 419 |
+ |
else |
| 420 |
+ |
ac_cv_prog_gxx_$1_$2=no |
| 421 |
+ |
fi |
| 422 |
+ |
]) |
| 423 |
+ |
if test "$ac_cv_prog_gxx_$1_$2" = yes; then |
| 424 |
+ |
: |
| 425 |
+ |
$3 |
| 426 |
+ |
else |
| 427 |
+ |
: |
| 428 |
+ |
$4 |
| 429 |
+ |
fi |
| 430 |
+ |
]) |
| 431 |
|
|
| 432 |
+ |
AC_DEFUN(ACX_PROG_REALLY_GCC, |
| 433 |
+ |
[ |
| 434 |
+ |
AC_REQUIRE([AC_PROG_CC]) |
| 435 |
+ |
AC_CACHE_CHECK(whether we are *really* using gcc, ac_cv_prog_really_gcc, |
| 436 |
+ |
[ |
| 437 |
+ |
dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp. |
| 438 |
+ |
cat > conftest.c <<EOF |
| 439 |
+ |
#ifdef __GNUC__ |
| 440 |
+ |
#ifndef __INTEL_COMPILER |
| 441 |
+ |
yes; |
| 442 |
+ |
#endif |
| 443 |
+ |
#endif |
| 444 |
+ |
EOF |
| 445 |
+ |
if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then |
| 446 |
+ |
ac_cv_prog_really_gcc=yes |
| 447 |
+ |
else |
| 448 |
+ |
ac_cv_prog_really_gcc=no |
| 449 |
+ |
fi |
| 450 |
+ |
]) |
| 451 |
+ |
if test "$ac_cv_prog_really_gcc" = yes; then |
| 452 |
+ |
: |
| 453 |
+ |
$1 |
| 454 |
+ |
else |
| 455 |
+ |
: |
| 456 |
+ |
$2 |
| 457 |
+ |
fi |
| 458 |
+ |
]) |
| 459 |
+ |
|
| 460 |
+ |
AC_DEFUN(ACX_PROG_REALLY_GXX, |
| 461 |
+ |
[ |
| 462 |
+ |
AC_REQUIRE([AC_PROG_CXX]) |
| 463 |
+ |
AC_CACHE_CHECK(whether we are *really* using g++, ac_cv_prog_really_gxx, |
| 464 |
+ |
[ |
| 465 |
+ |
dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp. |
| 466 |
+ |
cat > conftest.cpp <<EOF |
| 467 |
+ |
#ifdef __GNUC__ |
| 468 |
+ |
#ifndef __INTEL_COMPILER |
| 469 |
+ |
yes; |
| 470 |
+ |
#endif |
| 471 |
+ |
#endif |
| 472 |
+ |
EOF |
| 473 |
+ |
if AC_TRY_COMMAND(${CXX-c++} -E conftest.cpp) | egrep yes >/dev/null 2>&1; then |
| 474 |
+ |
ac_cv_prog_really_gxx=yes |
| 475 |
+ |
else |
| 476 |
+ |
ac_cv_prog_really_gxx=no |
| 477 |
+ |
fi |
| 478 |
+ |
]) |
| 479 |
+ |
if test "$ac_cv_prog_really_gxx" = yes; then |
| 480 |
+ |
: |
| 481 |
+ |
$1 |
| 482 |
+ |
else |
| 483 |
+ |
: |
| 484 |
+ |
$2 |
| 485 |
+ |
fi |
| 486 |
+ |
]) |
| 487 |
+ |
|
| 488 |
+ |
|
| 489 |
|
AC_DEFUN(ACX_PROG_CC_MAXOPT, |
| 490 |
|
[ |
| 491 |
|
AC_REQUIRE([AC_PROG_CC]) |
| 492 |
|
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 493 |
|
|
| 494 |
+ |
ACX_PROG_REALLY_GCC |
| 495 |
+ |
|
| 496 |
|
# Try to determine "good" native compiler flags if none specified on command |
| 497 |
|
# line |
| 498 |
|
if test "$ac_test_CFLAGS" != "set"; then |
| 546 |
|
esac |
| 547 |
|
|
| 548 |
|
# use default flags for gcc on all systems |
| 549 |
< |
if test $ac_cv_prog_gcc = yes; then |
| 549 |
> |
if test $ac_cv_prog_really_gcc = yes; then |
| 550 |
|
CFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic" |
| 551 |
|
fi |
| 552 |
|
|
| 553 |
|
# test for gcc-specific flags: |
| 554 |
< |
if test $ac_cv_prog_gcc = yes; then |
| 554 |
> |
if test $ac_cv_prog_really_gcc = yes; then |
| 555 |
|
# -malign-double for x86 systems |
| 556 |
|
ACX_CHECK_CC_FLAGS(-malign-double,align_double, CFLAGS="$CFLAGS -malign-double") |
| 557 |
|
# -fstrict-aliasing for gcc-2.95+ |
| 559 |
|
fi |
| 560 |
|
|
| 561 |
|
CPU_FLAGS="" |
| 562 |
< |
if test "$GCC" = "yes"; then |
| 562 |
> |
if test $ac_cv_prog_really_gcc = yes; then |
| 563 |
|
dnl try to guess correct CPU flags, at least for linux |
| 564 |
|
case "${host_cpu}" in |
| 565 |
|
i586*) ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium, |
| 628 |
|
AC_REQUIRE([AC_PROG_CXX]) |
| 629 |
|
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 630 |
|
|
| 631 |
+ |
ACX_PROG_REALLY_GXX |
| 632 |
+ |
|
| 633 |
|
# Try to determine "good" native compiler flags if none specified on command |
| 634 |
|
# line |
| 635 |
|
if test "$ac_test_CXXFLAGS" != "set"; then |
| 674 |
|
esac |
| 675 |
|
|
| 676 |
|
# use default flags for gcc on all systems |
| 677 |
< |
if test $ac_cv_prog_gcc = yes; then |
| 677 |
> |
if test $ac_cv_prog_really_gxx = yes; then |
| 678 |
|
CXXFLAGS="-O6 -fomit-frame-pointer -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic" |
| 679 |
|
fi |
| 680 |
|
|
| 681 |
|
# test for gcc-specific flags: |
| 682 |
< |
if test $ac_cv_prog_gcc = yes; then |
| 682 |
> |
if test $ac_cv_prog_really_gxx = yes; then |
| 683 |
|
# -malign-double for x86 systems |
| 684 |
|
ACX_CHECK_CXX_FLAGS(-malign-double,align_double, CXXFLAGS="$CXXFLAGS -malign-double") |
| 685 |
|
# -fstrict-aliasing for gcc-2.95+ |
| 687 |
|
fi |
| 688 |
|
|
| 689 |
|
CPU_FLAGS="" |
| 690 |
< |
if test "$GCC" = "yes"; then |
| 690 |
> |
if test $ac_cv_prog_really_gxx = yes; then |
| 691 |
|
dnl try to guess correct CPU flags, at least for linux |
| 692 |
|
case "${host_cpu}" in |
| 693 |
< |
i586*) ACX_CHECK_CC_FLAGS(-mcpu=pentium,cpu_pentium, |
| 693 |
> |
i586*) ACX_CHECK_CXX_FLAGS(-mcpu=pentium,cpu_pentium, |
| 694 |
|
[CPU_FLAGS=-mcpu=pentium], |
| 695 |
|
[ACX_CHECK_CXX_FLAGS(-mpentium,pentium, |
| 696 |
|
[CPU_FLAGS=-mpentium])]) |
| 707 |
|
ACX_CHECK_CXX_FLAGS(-mcpu=$cputype,m_cpu_60x, |
| 708 |
|
CPU_FLAGS=-mcpu=$cputype) |
| 709 |
|
elif test "$cputype" = 750; then |
| 710 |
< |
ACX_PROG_GCC_VERSION(2,95, |
| 710 |
> |
ACX_PROG_GXX_VERSION(2,95, |
| 711 |
|
ACX_CHECK_CXX_FLAGS(-mcpu=750,m_cpu_750, |
| 712 |
|
CPU_FLAGS=-mcpu=750)) |
| 713 |
|
fi |
| 763 |
|
F90FLAGS="" |
| 764 |
|
case "${host_cpu}-${host_os}" in |
| 765 |
|
|
| 766 |
< |
*linux*) if test "$F90" = ifc; then |
| 766 |
> |
*linux*) if test "$F90" = ifc -o "$F90" = ifort; then |
| 767 |
|
F90FLAGS="-O" |
| 768 |
|
fi;; |
| 769 |
|
rs6000*-aix*) if test "$F90" = xlf90 -o "$F90" = f90; then |
| 838 |
|
PREPFLAG="" |
| 839 |
|
case "${host_cpu}-${host_os}" in |
| 840 |
|
|
| 841 |
< |
*linux*) if test "$F90" = ifc; then |
| 841 |
> |
*linux*) if test "$F90" = ifc -o "$F90" = ifort; then |
| 842 |
|
PREPFLAG="-fpp1 " |
| 843 |
|
fi;; |
| 844 |
|
*aix*) if test "$F90" = xlf90 -o "$F90" = f90; then |
| 856 |
|
fi |
| 857 |
|
|
| 858 |
|
AC_MSG_CHECKING(to make sure F90 preprocessor flag works) |
| 859 |
< |
AC_LANG_SAVE( |
| 859 |
> |
AC_LANG_SAVE() |
| 860 |
|
AC_LANG([Fortran 90]) |
| 861 |
|
ac_save_ext=$ac_ext |
| 862 |
|
ac_ext=F90 |
| 873 |
|
ac_ext=$ac_save_ext |
| 874 |
|
AC_LANG_RESTORE() |
| 875 |
|
|
| 840 |
– |
|
| 876 |
|
if test "$prepflagworks" = 1; then |
| 877 |
|
AC_MSG_RESULT(yes) |
| 878 |
|
AC_SUBST(PREPFLAG) |
| 896 |
|
PREPDEFFLAG="" |
| 897 |
|
case "${host_cpu}-${host_os}" in |
| 898 |
|
|
| 899 |
< |
*linux*) if test "$F90" = ifc; then |
| 899 |
> |
*linux*) if test "$F90" = ifc -o "$F90" = ifort; then |
| 900 |
|
PREPDEFFLAG=" " |
| 901 |
|
fi;; |
| 902 |
|
*aix*) if test "$F90" = xlf90 -o "$F90" = f90; then |