mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-18 20:02:27 +00:00
base/Makefile base/comm/psb_cgather.f90 base/comm/psb_chalo.f90 base/comm/psb_covrl.f90 base/comm/psb_dgather.f90 base/comm/psb_dhalo.f90 base/comm/psb_dovrl.f90 base/comm/psb_sgather.f90 base/comm/psb_shalo.f90 base/comm/psb_sovrl.f90 base/comm/psb_zgather.f90 base/comm/psb_zhalo.f90 base/comm/psb_zovrl.f90 base/internals/psi_cswapdata.F90 base/internals/psi_cswaptran.F90 base/internals/psi_dswapdata.F90 base/internals/psi_dswaptran.F90 base/internals/psi_idx_ins_cnv.f90 base/internals/psi_ovrl_restr.f90 base/internals/psi_ovrl_save.f90 base/internals/psi_ovrl_upd.f90 base/internals/psi_sswapdata.F90 base/internals/psi_sswaptran.F90 base/internals/psi_zswapdata.F90 base/internals/psi_zswaptran.F90 base/modules/Makefile base/modules/psb_base_mat_mod.f90 base/modules/psb_base_mod.f90 base/modules/psb_c_base_mat_mod.f90 base/modules/psb_c_base_vect_mod.f90 base/modules/psb_c_comm_mod.f90 base/modules/psb_c_csc_mat_mod.f90 base/modules/psb_c_csr_mat_mod.f90 base/modules/psb_c_linmap_mod.f90 base/modules/psb_c_mat_mod.f90 base/modules/psb_c_psblas_mod.f90 base/modules/psb_c_tools_mod.f90 base/modules/psb_c_vect_mod.f90 base/modules/psb_check_mod.f90 base/modules/psb_comm_mod.f90 base/modules/psb_const_mod.F90 base/modules/psb_d_base_mat_mod.f90 base/modules/psb_d_base_vect_mod.f90 base/modules/psb_d_comm_mod.f90 base/modules/psb_d_csc_mat_mod.f90 base/modules/psb_d_csr_mat_mod.f90 base/modules/psb_d_linmap_mod.f90 base/modules/psb_d_mat_mod.f90 base/modules/psb_d_psblas_mod.f90 base/modules/psb_d_tools_mod.f90 base/modules/psb_d_vect_mod.f90 base/modules/psb_error_impl.F90 base/modules/psb_error_mod.F90 base/modules/psb_i_comm_mod.f90 base/modules/psb_ip_reord_mod.f90 base/modules/psb_linmap_mod.f90 base/modules/psb_linmap_type_mod.f90 base/modules/psb_s_base_mat_mod.f90 base/modules/psb_s_base_vect_mod.f90 base/modules/psb_s_comm_mod.f90 base/modules/psb_s_csc_mat_mod.f90 base/modules/psb_s_csr_mat_mod.f90 base/modules/psb_s_linmap_mod.f90 base/modules/psb_s_mat_mod.f90 base/modules/psb_s_psblas_mod.f90 base/modules/psb_s_tools_mod.f90 base/modules/psb_s_vect_mod.f90 base/modules/psb_serial_mod.f90 base/modules/psb_vect_mod.f90 base/modules/psb_z_base_mat_mod.f90 base/modules/psb_z_base_vect_mod.f90 base/modules/psb_z_comm_mod.f90 base/modules/psb_z_csc_mat_mod.f90 base/modules/psb_z_csr_mat_mod.f90 base/modules/psb_z_linmap_mod.f90 base/modules/psb_z_mat_mod.f90 base/modules/psb_z_psblas_mod.f90 base/modules/psb_z_tools_mod.f90 base/modules/psb_z_vect_mod.f90 base/modules/psi_c_mod.f90 base/modules/psi_d_mod.f90 base/modules/psi_i_mod.f90 base/modules/psi_mod.f90 base/modules/psi_penv_mod.F90 base/modules/psi_s_mod.f90 base/modules/psi_z_mod.f90 base/psblas/psb_camax.f90 base/psblas/psb_casum.f90 base/psblas/psb_caxpby.f90 base/psblas/psb_cdot.f90 base/psblas/psb_cnrm2.f90 base/psblas/psb_cspmm.f90 base/psblas/psb_cspsm.f90 base/psblas/psb_damax.f90 base/psblas/psb_dasum.f90 base/psblas/psb_daxpby.f90 base/psblas/psb_ddot.f90 base/psblas/psb_dnrm2.f90 base/psblas/psb_dnrmi.f90 base/psblas/psb_dspmm.f90 base/psblas/psb_dspnrm1.f90 base/psblas/psb_dspsm.f90 base/psblas/psb_samax.f90 base/psblas/psb_sasum.f90 base/psblas/psb_saxpby.f90 base/psblas/psb_sdot.f90 base/psblas/psb_snrm2.f90 base/psblas/psb_sspmm.f90 base/psblas/psb_sspsm.f90 base/psblas/psb_zamax.f90 base/psblas/psb_zasum.f90 base/psblas/psb_zaxpby.f90 base/psblas/psb_zdot.f90 base/psblas/psb_znrm2.f90 base/psblas/psb_zspmm.f90 base/psblas/psb_zspsm.f90 base/serial/Makefile base/serial/impl/psb_c_base_mat_impl.f90 base/serial/impl/psb_c_coo_impl.f90 base/serial/impl/psb_c_csc_impl.f90 base/serial/impl/psb_c_csr_impl.f90 base/serial/impl/psb_c_mat_impl.F90 base/serial/impl/psb_d_base_mat_impl.f90 base/serial/impl/psb_d_coo_impl.f90 base/serial/impl/psb_d_csc_impl.f90 base/serial/impl/psb_d_csr_impl.f90 base/serial/impl/psb_d_mat_impl.F90 base/serial/impl/psb_s_base_mat_impl.f90 base/serial/impl/psb_s_coo_impl.f90 base/serial/impl/psb_s_csc_impl.f90 base/serial/impl/psb_s_csr_impl.f90 base/serial/impl/psb_s_mat_impl.F90 base/serial/impl/psb_z_base_mat_impl.f90 base/serial/impl/psb_z_coo_impl.f90 base/serial/impl/psb_z_csc_impl.f90 base/serial/impl/psb_z_csr_impl.f90 base/serial/impl/psb_z_mat_impl.F90 base/serial/psb_cgelp.f90 base/serial/psb_dgelp.f90 base/serial/psb_sgelp.f90 base/serial/psb_spdot_srtd.f90 base/serial/psb_zgelp.f90 base/tools/Makefile base/tools/psb_c_map.f90 base/tools/psb_callc.f90 base/tools/psb_casb.f90 base/tools/psb_cdins.f90 base/tools/psb_cfree.f90 base/tools/psb_cins.f90 base/tools/psb_d_map.f90 base/tools/psb_dallc.f90 base/tools/psb_dasb.f90 base/tools/psb_dcdbldext.F90 base/tools/psb_dfree.f90 base/tools/psb_dins.f90 base/tools/psb_dspalloc.f90 base/tools/psb_dspasb.f90 base/tools/psb_dspfree.f90 base/tools/psb_dsphalo.F90 base/tools/psb_dspins.f90 base/tools/psb_dsprn.f90 base/tools/psb_linmap.f90 base/tools/psb_map.f90 base/tools/psb_s_map.f90 base/tools/psb_sallc.f90 base/tools/psb_sasb.f90 base/tools/psb_sfree.f90 base/tools/psb_sins.f90 base/tools/psb_z_map.f90 base/tools/psb_zallc.f90 base/tools/psb_zasb.f90 base/tools/psb_zfree.f90 base/tools/psb_zins.f90 config/pac.m4 configure.ac configure docs/html/footnode.html docs/html/img1.png docs/html/img10.png docs/html/img100.png docs/html/img101.png docs/html/img102.png docs/html/img103.png docs/html/img104.png docs/html/img105.png docs/html/img106.png docs/html/img107.png docs/html/img108.png docs/html/img109.png docs/html/img11.png docs/html/img110.png docs/html/img111.png docs/html/img112.png docs/html/img113.png docs/html/img114.png docs/html/img115.png docs/html/img116.png docs/html/img117.png docs/html/img118.png docs/html/img119.png docs/html/img12.png docs/html/img120.png docs/html/img121.png docs/html/img122.png docs/html/img123.png docs/html/img124.png docs/html/img125.png docs/html/img126.png docs/html/img127.png docs/html/img128.png docs/html/img129.png docs/html/img13.png docs/html/img130.png docs/html/img131.png docs/html/img132.png docs/html/img133.png docs/html/img134.png docs/html/img135.png docs/html/img136.png docs/html/img137.png docs/html/img138.png docs/html/img14.png docs/html/img140.png docs/html/img141.png docs/html/img142.png docs/html/img143.png docs/html/img144.png docs/html/img145.png docs/html/img146.png docs/html/img147.png docs/html/img148.png docs/html/img149.png docs/html/img15.png docs/html/img16.png docs/html/img17.png docs/html/img18.png docs/html/img2.png docs/html/img20.png docs/html/img22.png docs/html/img23.png docs/html/img24.png docs/html/img26.png docs/html/img27.png docs/html/img28.png docs/html/img29.png docs/html/img3.png docs/html/img30.png docs/html/img31.png docs/html/img32.png docs/html/img33.png docs/html/img34.png docs/html/img35.png docs/html/img36.png docs/html/img37.png docs/html/img38.png docs/html/img39.png docs/html/img4.png docs/html/img40.png docs/html/img41.png docs/html/img42.png docs/html/img43.png docs/html/img44.png docs/html/img45.png docs/html/img46.png docs/html/img47.png docs/html/img48.png docs/html/img49.png docs/html/img5.png docs/html/img50.png docs/html/img51.png docs/html/img52.png docs/html/img53.png docs/html/img54.png docs/html/img55.png docs/html/img56.png docs/html/img57.png docs/html/img58.png docs/html/img59.png docs/html/img6.png docs/html/img60.png docs/html/img61.png docs/html/img62.png docs/html/img63.png docs/html/img64.png docs/html/img65.png docs/html/img66.png docs/html/img67.png docs/html/img68.png docs/html/img69.png docs/html/img7.png docs/html/img70.png docs/html/img71.png docs/html/img72.png docs/html/img73.png docs/html/img74.png docs/html/img75.png docs/html/img76.png docs/html/img77.png docs/html/img78.png docs/html/img79.png docs/html/img8.png docs/html/img80.png docs/html/img81.png docs/html/img82.png docs/html/img83.png docs/html/img84.png docs/html/img85.png docs/html/img86.png docs/html/img87.png docs/html/img88.png docs/html/img89.png docs/html/img9.png docs/html/img90.png docs/html/img91.png docs/html/img92.png docs/html/img93.png docs/html/img94.png docs/html/img95.png docs/html/img96.png docs/html/img97.png docs/html/img98.png docs/html/img99.png docs/html/index.html docs/html/node1.html docs/html/node10.html docs/html/node100.html docs/html/node101.html docs/html/node102.html docs/html/node103.html docs/html/node104.html docs/html/node105.html docs/html/node106.html docs/html/node107.html docs/html/node108.html docs/html/node109.html docs/html/node11.html docs/html/node12.html docs/html/node13.html docs/html/node14.html docs/html/node15.html docs/html/node16.html docs/html/node17.html docs/html/node18.html docs/html/node19.html docs/html/node2.html docs/html/node20.html docs/html/node21.html docs/html/node22.html docs/html/node23.html docs/html/node24.html docs/html/node25.html docs/html/node26.html docs/html/node27.html docs/html/node28.html docs/html/node29.html docs/html/node3.html docs/html/node30.html docs/html/node31.html docs/html/node32.html docs/html/node33.html docs/html/node34.html docs/html/node35.html docs/html/node36.html docs/html/node37.html docs/html/node38.html docs/html/node39.html docs/html/node4.html docs/html/node40.html docs/html/node41.html docs/html/node42.html docs/html/node43.html docs/html/node44.html docs/html/node45.html docs/html/node46.html docs/html/node47.html docs/html/node48.html docs/html/node49.html docs/html/node5.html docs/html/node50.html docs/html/node51.html docs/html/node52.html docs/html/node53.html docs/html/node54.html docs/html/node55.html docs/html/node56.html docs/html/node57.html docs/html/node58.html docs/html/node59.html docs/html/node6.html docs/html/node60.html docs/html/node61.html docs/html/node62.html docs/html/node63.html docs/html/node64.html docs/html/node65.html docs/html/node66.html docs/html/node67.html docs/html/node68.html docs/html/node69.html docs/html/node7.html docs/html/node70.html docs/html/node71.html docs/html/node72.html docs/html/node73.html docs/html/node74.html docs/html/node75.html docs/html/node76.html docs/html/node77.html docs/html/node78.html docs/html/node79.html docs/html/node8.html docs/html/node80.html docs/html/node81.html docs/html/node82.html docs/html/node83.html docs/html/node84.html docs/html/node85.html docs/html/node86.html docs/html/node87.html docs/html/node88.html docs/html/node89.html docs/html/node9.html docs/html/node90.html docs/html/node91.html docs/html/node92.html docs/html/node93.html docs/html/node94.html docs/html/node95.html docs/html/node96.html docs/html/node97.html docs/html/node98.html docs/html/node99.html docs/html/userhtml.html docs/psblas-3.0.pdf docs/src/datastruct.tex krylov/Makefile krylov/psb_base_inner_krylov_mod.f90 krylov/psb_c_inner_krylov_mod.f90 krylov/psb_cbicg.f90 krylov/psb_ccg.f90 krylov/psb_ccgs.f90 krylov/psb_ccgstab.f90 krylov/psb_ccgstabl.f90 krylov/psb_ckrylov.f90 krylov/psb_crgmres.f90 krylov/psb_d_inner_krylov_mod.f90 krylov/psb_dbicg.f90 krylov/psb_dcg.F90 krylov/psb_dcgs.f90 krylov/psb_dcgstab.F90 krylov/psb_dcgstabl.f90 krylov/psb_dkrylov.f90 krylov/psb_drgmres.f90 krylov/psb_krylov_mod.f90 krylov/psb_s_inner_krylov_mod.f90 krylov/psb_sbicg.f90 krylov/psb_scg.F90 krylov/psb_scgs.f90 krylov/psb_scgstab.F90 krylov/psb_scgstabl.f90 krylov/psb_skrylov.f90 krylov/psb_srgmres.f90 krylov/psb_z_inner_krylov_mod.f90 krylov/psb_zbicg.f90 krylov/psb_zcg.F90 krylov/psb_zcgs.f90 krylov/psb_zcgstab.f90 krylov/psb_zcgstabl.f90 krylov/psb_zkrylov.f90 krylov/psb_zrgmres.f90 opt/Makefile opt/psb_c_rsb_mat_mod.F90 opt/psb_d_rsb_mat_mod.F90 opt/psb_s_rsb_mat_mod.F90 opt/psb_z_rsb_mat_mod.F90 opt/rsb_c_mod.f90 opt/rsb_d_mod.f90 opt/rsb_s_mod.f90 opt/rsb_z_mod.f90 prec/Makefile prec/psb_c_base_prec_mod.f90 prec/psb_c_bjacprec.f90 prec/psb_c_diagprec.f90 prec/psb_c_nullprec.f90 prec/psb_c_prec_type.f90 prec/psb_cprecbld.f90 prec/psb_d_base_prec_mod.f90 prec/psb_d_bjacprec.f90 prec/psb_d_diagprec.f90 prec/psb_d_nullprec.f90 prec/psb_d_prec_type.f90 prec/psb_dprecbld.f90 prec/psb_s_base_prec_mod.f90 prec/psb_s_bjacprec.f90 prec/psb_s_diagprec.f90 prec/psb_s_nullprec.f90 prec/psb_s_prec_type.f90 prec/psb_sprecbld.f90 prec/psb_z_base_prec_mod.f90 prec/psb_z_bjacprec.f90 prec/psb_z_diagprec.f90 prec/psb_z_nullprec.f90 prec/psb_z_prec_type.f90 prec/psb_zprecbld.f90 test/fileread/cf_sample.f90 test/fileread/df_sample.f90 test/fileread/runs/dfs.inp test/fileread/runs/sfs.inp test/fileread/sf_sample.f90 test/fileread/zf_sample.f90 test/kernel/d_file_spmv.f90 test/kernel/s_file_spmv.f90 test/newfmt/ppde.F90 test/newfmt/spde.f90 test/pargen/ppde.f90 test/pargen/runs/ppde.inp test/pargen/spde.f90 test/serial/Makefile test/serial/d_matgen.F90 test/serial/psb_d_czz_mat_mod.f90 util/Makefile util/psb_c_hbio_impl.f90 util/psb_c_mat_dist_impl.f90 util/psb_c_mmio_impl.f90 util/psb_c_renum_impl.F90 util/psb_d_hbio_impl.f90 util/psb_d_mat_dist_impl.f90 util/psb_d_mmio_impl.f90 util/psb_d_renum_impl.F90 util/psb_hbio_impl.f90 util/psb_mat_dist_mod.f90 util/psb_mmio_impl.f90 util/psb_renum_impl.F90 util/psb_renum_mod.f90 util/psb_s_hbio_impl.f90 util/psb_s_mat_dist_impl.f90 util/psb_s_mmio_impl.f90 util/psb_s_renum_impl.F90 util/psb_z_hbio_impl.f90 util/psb_z_mat_dist_impl.f90 util/psb_z_mmio_impl.f90 util/psb_z_renum_impl.F90 Merged vect-state branch. Now need to: 1. Update MLD 2. Fix documentation 3. Take out older Krylov interfaces.
1464 lines
42 KiB
Plaintext
1464 lines
42 KiB
Plaintext
dnl
|
|
dnl $Id$
|
|
dnl
|
|
dnl 20080206
|
|
dnl M4 macros for the PSBLAS library and useful for packages using PSBLAS.
|
|
dnl
|
|
|
|
dnl @synopsis PAC_CHECK_LIBS
|
|
dnl
|
|
dnl Tries to detect the presence of a specific function among various libraries, using AC_CHECK_LIB
|
|
dnl repeatedly on the specified libraries.
|
|
dnl
|
|
dnl Example use:
|
|
dnl
|
|
dnl PAC_CHECK_LIBS([atlas blas],
|
|
dnl [dgemm],
|
|
dnl [have_dgemm=yes],
|
|
dnl [have_dgemm=no])
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
dnl 20080211 modified slighty from original.
|
|
AC_DEFUN([PAC_CHECK_LIBS],
|
|
[
|
|
pac_check_libs_ok=no
|
|
[for pac_check_libs_f in $2
|
|
do ]
|
|
[for pac_check_libs_l in $1
|
|
do ]
|
|
if test x"$pac_check_libs_ok" == xno ; then
|
|
AC_CHECK_LIB([$pac_check_libs_l],[$pac_check_libs_f], [pac_check_libs_ok=yes; pac_check_libs_LIBS="-l$pac_check_libs_l"],[],[$5])
|
|
fi
|
|
done
|
|
done
|
|
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
|
[ if test x"$pac_check_libs_ok" = xyes ; then
|
|
$3
|
|
else
|
|
pac_check_libs_ok=no
|
|
$4
|
|
fi
|
|
]
|
|
])dnl
|
|
|
|
dnl # How do we determine netlib blacs ? Here it is :
|
|
dnl AC_CHECK_LIB(blacsCinit_MPI-LINUX-0,BI_Asend,
|
|
dnl AC_CHECK_LIB(blacs_MPI-LINUX-0,BI_Asend,
|
|
dnl [acx_cv_blacs_ok=yes; BLACS_LIBS="-lblacsCinit_MPI-LINUX-0"])
|
|
dnl AC_F77_FUNC([BI_Asend])
|
|
dnl AC_CHECK_LIB(blacsCinit_MPI-LINUX-0,[$BI_Asend],
|
|
dnl [acx_cv_blacs_ok=yes; BLACS_LIBS="-lblacsCinit_MPI-LINUX-0"])
|
|
dnl AC_FC_FUNC([BI_Iam])
|
|
dnl AC_CHECK_LIB(blacsCinit_MPI-LINUX-0,[$BI_Asend],
|
|
dnl [acx_cv_blacs_ok=yes; BLACS_LIBS="-lblacsCinit_MPI-LINUX-0"])
|
|
|
|
|
|
dnl @synopsis PAC_FORTRAN_HAVE_MOVE_ALLOC( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program with move_alloc (a Fortran 2003 function).
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN([PAC_FORTRAN_HAVE_MOVE_ALLOC],
|
|
ac_exeext=''
|
|
ac_ext='f'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([for Fortran MOVE_ALLOC intrinsic])
|
|
cat > conftest.$ac_ext <<EOF
|
|
program test_move_alloc
|
|
integer, allocatable :: a(:), b(:)
|
|
allocate(a(3))
|
|
call move_alloc(a, b)
|
|
print *, allocated(a), allocated(b)
|
|
print *, b
|
|
end program test_move_alloc
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
|
|
|
|
dnl @synopsis PAC_CHECK_HAVE_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will check if MPIFC is $FC.
|
|
dnl The check will proceed by compiling a small Fortran program
|
|
dnl containing the __GNUC__ macro, which should be defined in the
|
|
dnl gfortran compiled programs.
|
|
dnl
|
|
dnl On pass, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_CHECK_HAVE_GFORTRAN,
|
|
ac_exeext=''
|
|
ac_ext='F'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[
|
|
cat > conftest.$ac_ext <<EOF
|
|
program main
|
|
#ifdef __GNUC__
|
|
print *, "GCC!"
|
|
#else
|
|
this program will fail
|
|
#endif
|
|
end
|
|
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
|
|
|
|
dnl @synopsis PAC_HAVE_MODERN_GFORTRAN( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will check if the GNU fortran version is suitable for PSBLAS.
|
|
dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl Note : Will use MPIFC; if unset, will use '$FC'.
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_HAVE_MODERN_GFORTRAN,
|
|
ac_exeext=''
|
|
ac_ext='F'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([GNU Fortran version at least 4.6])
|
|
cat > conftest.$ac_ext <<EOF
|
|
program main
|
|
#if ( __GNUC__ >= 4 && __GNUC_MINOR__ >= 6 ) || ( __GNUC__ > 4 )
|
|
print *, "ok"
|
|
#else
|
|
this program will fail
|
|
#endif
|
|
end
|
|
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([ yes.])
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([ no.])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
|
|
dnl @synopsis PAC_FORTRAN_CHECK_HAVE_MPI_MOD( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will determine if the fortran compiler MPIFC needs to include mpi.h or needs
|
|
dnl to use the mpi module.
|
|
dnl
|
|
dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl Modified Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_FORTRAN_CHECK_HAVE_MPI_MOD,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([MPI Fortran interface])
|
|
cat > conftest.$ac_ext <<EOF
|
|
program test
|
|
use mpi
|
|
end program test
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([ use mpi ])
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
AC_MSG_RESULT([ include mpif.h ])
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
|
|
|
|
dnl @synopsis PAC_ARG_WITH_FLAGS(lcase_name, UCASE_NAME)
|
|
dnl
|
|
dnl Test for --with-lcase_name="compiler/loader flags". if defined, prepend
|
|
dnl flags to standard UCASE_NAME definition.
|
|
dnl
|
|
dnl Use this macro to facilitate additional special flags that should be
|
|
dnl passed on to the preprocessor/compilers/loader.
|
|
dnl
|
|
dnl NOTE : Renamed after TAC_ARG_WITH_FLAGS as in the Trilinos-8.0.4 package.
|
|
dnl
|
|
dnl NOTE : This macro works in a way the user should invoke
|
|
dnl --with-flags=...
|
|
dnl only once, otherwise the first one will take effect.
|
|
dnl
|
|
dnl Example use:
|
|
dnl
|
|
dnl PAC_ARG_WITH_FLAGS(cxxflags, CXXFLAGS)
|
|
dnl
|
|
dnl tests for --with-cxxflags and pre-pends to CXXFLAGS
|
|
dnl
|
|
dnl @author Mike Heroux <mheroux@cs.sandia.gov>
|
|
dnl @notes Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN([PAC_ARG_WITH_FLAGS],
|
|
[
|
|
AC_MSG_CHECKING([whether additional [$2] flags should be added (should be invoked only once)])
|
|
dnl AC_MSG_CHECKING([whether additional [$2] flags should be added])
|
|
AC_ARG_WITH($1,
|
|
AC_HELP_STRING([--with-$1],
|
|
[additional [$2] flags to be added: will prepend to [$2]]),
|
|
[
|
|
$2="${withval} ${$2}"
|
|
AC_MSG_RESULT([$2 = ${$2}])
|
|
],
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
])
|
|
|
|
|
|
dnl @synopsis PAC_ARG_WITH_LIBS
|
|
dnl
|
|
dnl Test for --with-libs="name(s)".
|
|
dnl
|
|
dnl Prepends the specified name(s) to the list of libraries to link
|
|
dnl with.
|
|
dnl
|
|
dnl note: Renamed after PAC_ARG_WITH_LIBS as in the Trilinos package.
|
|
dnl
|
|
dnl Example use:
|
|
dnl
|
|
dnl PAC_ARG_WITH_LIBS
|
|
dnl
|
|
dnl tests for --with-libs and pre-pends to LIBS
|
|
dnl
|
|
dnl @author Jim Willenbring <jmwille@sandia.gov>
|
|
dnl
|
|
AC_DEFUN([PAC_ARG_WITH_LIBS],
|
|
[
|
|
AC_MSG_CHECKING([whether additional libraries are needed])
|
|
AC_ARG_WITH(libs,
|
|
AC_HELP_STRING([--with-libs],
|
|
[List additional link flags here. For example, --with-libs=-lspecial_system_lib
|
|
or --with-libs=-L/path/to/libs]),
|
|
[
|
|
LIBS="${withval} ${LIBS}"
|
|
AC_MSG_RESULT([LIBS = ${LIBS}])
|
|
],
|
|
AC_MSG_RESULT(no)
|
|
)
|
|
]
|
|
)
|
|
|
|
|
|
dnl @synopsis PAC_ARG_SERIAL_MPI
|
|
dnl
|
|
dnl Test for --with-serial-mpi={yes|no}
|
|
dnl
|
|
dnl
|
|
dnl
|
|
dnl Example use:
|
|
dnl
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN([PAC_ARG_SERIAL_MPI],
|
|
[
|
|
AC_MSG_CHECKING([whether we want serial (fake) mpi])
|
|
AC_ARG_ENABLE(serial,
|
|
AC_HELP_STRING([--enable-serial],
|
|
[Specify whether to enable a fake mpi library to run in serial mode. ]),
|
|
[
|
|
pac_cv_serial_mpi="yes";
|
|
]
|
|
dnl ,
|
|
dnl [pac_cv_serial_mpi="no";]
|
|
)
|
|
if test x"$pac_cv_serial_mpi" == x"yes" ; then
|
|
AC_MSG_RESULT([yes.])
|
|
else
|
|
pac_cv_serial_mpi="no";
|
|
AC_MSG_RESULT([no.])
|
|
fi
|
|
]
|
|
)
|
|
|
|
dnl @synopsis PAC_FORTRAN_HAVE_PSBLAS( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program using the PSBLAS library
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_FORTRAN_HAVE_PSBLAS,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[cat > conftest.$ac_ext <<EOF
|
|
program test
|
|
use psb_base_mod
|
|
end program test
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_TR15581( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the TR15581 Fortran extension support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_TR15581,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran allocatables TR15581])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
module conftest
|
|
type outer
|
|
integer, allocatable :: v(:)
|
|
end type outer
|
|
|
|
interface foo
|
|
module procedure foov, food
|
|
end interface
|
|
contains
|
|
|
|
subroutine foov(a,b)
|
|
|
|
implicit none
|
|
integer, allocatable, intent(inout) :: a(:)
|
|
integer, allocatable, intent(out) :: b(:)
|
|
|
|
|
|
allocate(b(size(a)))
|
|
|
|
end subroutine foov
|
|
subroutine food(a,b)
|
|
|
|
implicit none
|
|
type(outer), intent(inout) :: a
|
|
type(outer), intent(out) :: b
|
|
|
|
|
|
allocate(b%v(size(a%v)))
|
|
|
|
end subroutine food
|
|
|
|
end module conftest
|
|
|
|
|
|
|
|
program testtr15581
|
|
use conftest
|
|
type(outer) :: da, db
|
|
integer, allocatable :: a(:), b(:)
|
|
|
|
allocate(a(10),da%v(10))
|
|
a = (/ (i,i=1,10) /)
|
|
da%v = (/ (i,i=1,10) /)
|
|
call foo(a,b)
|
|
call foo(da,db)
|
|
write(*,*) b
|
|
write(*,*) db%v
|
|
|
|
end program testtr15581
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_VOLATILE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the VOLATILE Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_VOLATILE,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran VOLATILE])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program conftest
|
|
integer, volatile :: i, j
|
|
end program conftest
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_EXTENDS( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the EXTENDS Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_EXTENDS,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran EXTENDS])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program conftest
|
|
type foo
|
|
integer :: i
|
|
end type foo
|
|
type, extends(foo) :: bar
|
|
integer j
|
|
end type bar
|
|
type(bar) :: barvar
|
|
end program conftest
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_CLASS_TBP( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the TBP Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_CLASS_TBP,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran CLASS TBP])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
module foo_mod
|
|
type foo
|
|
integer :: i
|
|
contains
|
|
procedure, pass(a) :: doit
|
|
procedure, pass(a) :: getit
|
|
end type foo
|
|
|
|
private doit,getit
|
|
contains
|
|
subroutine doit(a)
|
|
class(foo) :: a
|
|
|
|
a%i = 1
|
|
write(*,*) 'FOO%DOIT base version'
|
|
end subroutine doit
|
|
function getit(a) result(res)
|
|
class(foo) :: a
|
|
integer :: res
|
|
|
|
res = a%i
|
|
end function getit
|
|
|
|
end module foo_mod
|
|
program conftest
|
|
use foo_mod
|
|
type(foo) :: foovar
|
|
end program conftest
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_FINAL( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the FINAL Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_FINAL,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran FINAL])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
module foo_mod
|
|
type foo
|
|
integer :: i
|
|
contains
|
|
final :: destroy_foo
|
|
end type foo
|
|
|
|
private destroy_foo
|
|
contains
|
|
subroutine destroy_foo(a)
|
|
type(foo) :: a
|
|
! Just a test
|
|
end subroutine destroy_foo
|
|
end module foo_mod
|
|
program conftest
|
|
use foo_mod
|
|
type(foo) :: foovar
|
|
end program conftest
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_SAME_TYPE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the SAME_TYPE_AS Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_SAME_TYPE,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran SAME_TYPE_AS])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program stt
|
|
type foo
|
|
integer :: i
|
|
end type foo
|
|
type, extends(foo) :: new_foo
|
|
integer :: j
|
|
end type new_foo
|
|
type(foo) :: foov
|
|
type(new_foo) :: nfv1, nfv2
|
|
|
|
|
|
write(*,*) 'foov == nfv1? ', same_type_as(foov,nfv1)
|
|
write(*,*) 'nfv2 == nfv1? ', same_type_as(nfv2,nfv1)
|
|
end program stt
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_EXTENDS_TYPE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the EXTENDS_TYPE_OF Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_EXTENDS_TYPE,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran EXTENDS_TYPE_OF])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program xtt
|
|
type foo
|
|
integer :: i
|
|
end type foo
|
|
type, extends(foo) :: new_foo
|
|
integer :: j
|
|
end type new_foo
|
|
type(foo) :: foov
|
|
type(new_foo) :: nfv1, nfv2
|
|
|
|
write(*,*) 'nfv1 extends foov? ', extends_type_of(nfv1,foov)
|
|
end program xtt
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
|
|
dnl @synopsis PAC_CHECK_BLACS
|
|
dnl
|
|
dnl Will try to find the BLACS
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_CHECK_BLACS,
|
|
[AC_ARG_WITH(blacs, AC_HELP_STRING([--with-blacs=LIB], [Specify BLACSLIBNAME or -lBLACSLIBNAME or the absolute library filename.]),
|
|
[psblas_cv_blacs=$withval],
|
|
[psblas_cv_blacs=''])
|
|
|
|
case $psblas_cv_blacs in
|
|
yes | "") ;;
|
|
-* | */* | *.a | *.so | *.so.* | *.o)
|
|
BLACS_LIBS="$psblas_cv_blacs" ;;
|
|
*) BLACS_LIBS="-l$psblas_cv_blacs" ;;
|
|
esac
|
|
|
|
#
|
|
# Test user-defined BLACS
|
|
#
|
|
if test x"$psblas_cv_blacs" != "x" ; then
|
|
save_LIBS="$LIBS";
|
|
AC_LANG([Fortran])
|
|
LIBS="$BLACS_LIBS $LIBS"
|
|
AC_MSG_CHECKING([for dgesd2d in $BLACS_LIBS])
|
|
AC_TRY_LINK_FUNC(dgesd2d, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
|
|
AC_MSG_RESULT($psblas_cv_blacs_ok)
|
|
|
|
if test x"$psblas_cv_blacs_ok" == x"yes"; then
|
|
AC_MSG_CHECKING([for blacs_pinfo in $BLACS_LIBS])
|
|
AC_TRY_LINK_FUNC(blacs_pinfo, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
|
|
AC_MSG_RESULT($psblas_cv_blacs_ok)
|
|
fi
|
|
LIBS="$save_LIBS";
|
|
fi
|
|
AC_LANG([C])
|
|
|
|
######################################
|
|
# System BLACS with PESSL default names.
|
|
######################################
|
|
if test x"$BLACS_LIBS" == "x" ; then
|
|
AC_LANG([Fortran])
|
|
PAC_CHECK_LIBS([blacssmp blacsp2 blacs],
|
|
[dgesd2d],
|
|
[psblas_cv_blacs_ok=yes; LIBS="$LIBS $pac_check_libs_LIBS " ]
|
|
[BLACS_LIBS="$pac_check_libs_LIBS" ]
|
|
AC_MSG_NOTICE([BLACS libraries detected.]),[]
|
|
)
|
|
if test x"$BLACS_LIBS" != "x"; then
|
|
save_LIBS="$LIBS";
|
|
LIBS="$BLACS_LIBS $LIBS"
|
|
AC_MSG_CHECKING([for blacs_pinfo in $BLACS_LIBS])
|
|
AC_LANG([Fortran])
|
|
AC_TRY_LINK_FUNC(blacs_pinfo, [psblas_cv_blacs_ok=yes], [psblas_cv_blacs_ok=no;BLACS_LIBS=""])
|
|
AC_MSG_RESULT($psblas_cv_blacs_ok)
|
|
LIBS="$save_LIBS";
|
|
fi
|
|
fi
|
|
######################################
|
|
# Maybe we're looking at PESSL BLACS?#
|
|
######################################
|
|
if test x"$BLACS_LIBS" != "x" ; then
|
|
save_LIBS="$LIBS";
|
|
LIBS="$BLACS_LIBS $LIBS"
|
|
AC_MSG_CHECKING([for PESSL BLACS])
|
|
AC_LANG([Fortran])
|
|
AC_TRY_LINK_FUNC(esvemonp, [psblas_cv_pessl_blacs=yes], [psblas_cv_pessl_blacs=no])
|
|
AC_MSG_RESULT($psblas_cv_pessl_blacs)
|
|
LIBS="$save_LIBS";
|
|
fi
|
|
if test "x$psblas_cv_pessl_blacs" == "xyes"; then
|
|
FDEFINES="$psblas_cv_define_prepend-DHAVE_ESSL_BLACS $FDEFINES"
|
|
fi
|
|
|
|
|
|
##############################################################################
|
|
# Netlib BLACS library with default names
|
|
##############################################################################
|
|
|
|
if test x"$BLACS_LIBS" == "x" ; then
|
|
save_LIBS="$LIBS";
|
|
AC_LANG([Fortran])
|
|
PAC_CHECK_LIBS([ blacs_MPI-LINUX-0 blacs_MPI-SP5-0 blacs_MPI-SP4-0 blacs_MPI-SP3-0 blacs_MPI-SP2-0 blacsCinit_MPI-ALPHA-0 blacsCinit_MPI-IRIX64-0 blacsCinit_MPI-RS6K-0 blacsCinit_MPI-SPP-0 blacsCinit_MPI-SUN4-0 blacsCinit_MPI-SUN4SOL2-0 blacsCinit_MPI-T3D-0 blacsCinit_MPI-T3E-0
|
|
],
|
|
[dgesd2d],
|
|
[psblas_cv_blacs_ok=yes; LIBS="$LIBS $pac_check_libs_LIBS "
|
|
psblas_have_netlib_blacs=yes; ]
|
|
[BLACS_LIBS="$pac_check_libs_LIBS" ]
|
|
AC_MSG_NOTICE([BLACS libraries detected.]),[]
|
|
)
|
|
|
|
if test x"$BLACS_LIBS" != "x" ; then
|
|
AC_LANG([Fortran])
|
|
PAC_CHECK_LIBS([ blacsF77init_MPI-LINUX-0 blacsF77init_MPI-SP5-0 blacsF77init_MPI-SP4-0 blacsF77init_MPI-SP3-0 blacsF77init_MPI-SP2-0 blacsF77init_MPI-ALPHA-0 blacsF77init_MPI-IRIX64-0 blacsF77init_MPI-RS6K-0 blacsF77init_MPI-SPP-0 blacsF77init_MPI-SUN4-0 blacsF77init_MPI-SUN4SOL2-0 blacsF77init_MPI-T3D-0 blacsF77init_MPI-T3E-0
|
|
],
|
|
[blacs_pinfo],
|
|
[psblas_cv_blacs_ok=yes; LIBS="$pac_check_libs_LIBS $LIBS" ]
|
|
[BLACS_LIBS="$pac_check_libs_LIBS $BLACS_LIBS" ]
|
|
AC_MSG_NOTICE([Netlib BLACS Fortran initialization libraries detected.]),[]
|
|
)
|
|
fi
|
|
|
|
if test x"$BLACS_LIBS" != "x" ; then
|
|
|
|
AC_LANG([C])
|
|
PAC_CHECK_LIBS([ blacsCinit_MPI-LINUX-0 blacsCinit_MPI-SP5-0 blacsCinit_MPI-SP4-0 blacsCinit_MPI-SP3-0 blacsCinit_MPI-SP2-0 blacsCinit_MPI-ALPHA-0 blacsCinit_MPI-IRIX64-0 blacsCinit_MPI-RS6K-0 blacsCinit_MPI-SPP-0 blacsCinit_MPI-SUN4-0 blacsCinit_MPI-SUN4SOL2-0 blacsCinit_MPI-T3D-0 blacsCinit_MPI-T3E-0
|
|
],
|
|
[Cblacs_pinfo],
|
|
[psblas_cv_blacs_ok=yes; LIBS="$pac_check_libs_LIBS $LIBS" ]
|
|
[BLACS_LIBS="$BLACS_LIBS $pac_check_libs_LIBS" ]
|
|
AC_MSG_NOTICE([Netlib BLACS C initialization libraries detected.]),[]
|
|
)
|
|
fi
|
|
LIBS="$save_LIBS";
|
|
fi
|
|
|
|
if test x"$BLACS_LIBS" == "x" ; then
|
|
AC_MSG_ERROR([
|
|
No BLACS library detected! $PACKAGE_NAME will be unusable.
|
|
Please make sure a BLACS implementation is accessible (ex.: --with-blacs="-lblacsname -L/blacs/dir" )
|
|
])
|
|
else
|
|
save_LIBS="$LIBS";
|
|
LIBS="$BLACS_LIBS $LIBS"
|
|
AC_MSG_CHECKING([for ksendid in $BLACS_LIBS])
|
|
AC_LANG([Fortran])
|
|
AC_TRY_LINK_FUNC(ksendid, [psblas_cv_have_sendid=yes],[psblas_cv_have_sendid=no])
|
|
AC_MSG_RESULT($psblas_cv_have_sendid)
|
|
LIBS="$save_LIBS"
|
|
AC_LANG([C])
|
|
if test "x$psblas_cv_have_sendid" == "xyes"; then
|
|
FDEFINES="$psblas_cv_define_prepend-DHAVE_KSENDID $FDEFINES"
|
|
fi
|
|
fi
|
|
])dnl
|
|
|
|
|
|
dnl @synopsis PAC_MAKE_IS_GNUMAKE
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
dnl
|
|
define(PAC_MAKE_IS_GNUMAKE,[
|
|
AC_MSG_CHECKING(for gnumake)
|
|
MAKE=${MAKE:-make}
|
|
|
|
if $MAKE --version 2>&1 | grep -e"GNU Make" >/dev/null; then
|
|
AC_MSG_RESULT(yes)
|
|
psblas_make_gnumake='yes'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
psblas_make_gnumake='no'
|
|
fi
|
|
])dnl
|
|
|
|
|
|
dnl @synopsis PAC_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
|
dnl modified from ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl This macro looks for a library that implements the BLAS
|
|
dnl linear-algebra interface (see http://www.netlib.org/blas/). On
|
|
dnl success, it sets the BLAS_LIBS output variable to hold the
|
|
dnl requisite library linkages.
|
|
dnl
|
|
dnl To link with BLAS, you should link with:
|
|
dnl
|
|
dnl $BLAS_LIBS $LIBS $FLIBS
|
|
dnl
|
|
dnl in that order. FLIBS is the output variable of the
|
|
dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and
|
|
dnl is sometimes necessary in order to link with F77 libraries. Users
|
|
dnl will also need to use AC_F77_DUMMY_MAIN (see the autoconf manual),
|
|
dnl for the same reason.
|
|
dnl
|
|
dnl Many libraries are searched for, from ATLAS to CXML to ESSL. The
|
|
dnl user may also use --with-blas=<lib> in order to use some specific
|
|
dnl BLAS library <lib>. In order to link successfully, however, be
|
|
dnl aware that you will probably need to use the same Fortran compiler
|
|
dnl (which can be set via the F77 env. var.) as was used to compile the
|
|
dnl BLAS library.
|
|
dnl
|
|
dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS
|
|
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
|
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
|
dnl default action will define HAVE_BLAS.
|
|
dnl
|
|
dnl This macro requires autoconf 2.50 or later.
|
|
dnl
|
|
dnl @category InstalledPackages
|
|
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
|
dnl @version 2001-12-13
|
|
dnl @license GPLWithACException
|
|
dnl modified by salvatore.filippone@uniroma2.it
|
|
dnl shifted check for ESSL as it was generating erroneous results on
|
|
dnl AIX SP5.
|
|
dnl Modified with new name to handle Fortran compilers (such as NAG)
|
|
dnl for which the linking MUST be done with the compiler (i.e.:
|
|
dnl trying to link the Fortran version of the BLAS with the C compiler
|
|
dnl would fail even when linking in the compiler's library)
|
|
|
|
AC_DEFUN([PAC_BLAS], [
|
|
AC_PREREQ(2.50)
|
|
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
|
|
pac_blas_ok=no
|
|
|
|
AC_ARG_WITH(blas,
|
|
[AC_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
|
|
case $with_blas in
|
|
yes | "") ;;
|
|
no) pac_blas_ok=disable ;;
|
|
-* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
|
|
*) BLAS_LIBS="-l$with_blas" ;;
|
|
esac
|
|
|
|
# Get fortran linker names of BLAS functions to check for.
|
|
AC_F77_FUNC(sgemm)
|
|
AC_F77_FUNC(dgemm)
|
|
|
|
pac_blas_save_LIBS="$LIBS"
|
|
LIBS="$LIBS $FLIBS"
|
|
|
|
# First, check BLAS_LIBS environment variable
|
|
if test $pac_blas_ok = no; then
|
|
if test "x$BLAS_LIBS" != x; then
|
|
save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
|
|
AC_LANG([Fortran])
|
|
AC_MSG_CHECKING([for sgemm in $BLAS_LIBS])
|
|
AC_TRY_LINK_FUNC(sgemm, [pac_blas_ok=yes], [BLAS_LIBS=""])
|
|
AC_MSG_RESULT($pac_blas_ok)
|
|
AC_LANG([C])
|
|
LIBS="$save_LIBS"
|
|
fi
|
|
fi
|
|
|
|
|
|
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(atlas, ATL_xerbla,
|
|
[AC_LANG([Fortran])
|
|
AC_CHECK_LIB(f77blas, sgemm,
|
|
[AC_LANG([C])
|
|
AC_CHECK_LIB(cblas, cblas_dgemm,
|
|
[pac_blas_ok=yes
|
|
BLAS_LIBS="-lcblas -lf77blas -latlas"],
|
|
[], [-lf77blas -latlas])],
|
|
[], [-latlas])])
|
|
AC_LANG([C])
|
|
|
|
fi
|
|
|
|
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
|
|
if test $pac_blas_ok = no; then
|
|
AC_LANG([Fortran])
|
|
AC_CHECK_LIB(blas, sgemm,
|
|
[AC_CHECK_LIB(dgemm, dgemm,
|
|
[AC_CHECK_LIB(sgemm, sgemm,
|
|
[pac_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
|
|
[], [-lblas])],
|
|
[], [-lblas])])
|
|
AC_LANG([C])
|
|
fi
|
|
|
|
# BLAS in Alpha CXML library?
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(cxml, $sgemm, [pac_blas_ok=yes;BLAS_LIBS="-lcxml"])
|
|
fi
|
|
|
|
# BLAS in Alpha DXML library? (now called CXML, see above)
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(dxml, $sgemm, [pac_blas_ok=yes;BLAS_LIBS="-ldxml"])
|
|
|
|
fi
|
|
|
|
# BLAS in Sun Performance library?
|
|
if test $pac_blas_ok = no; then
|
|
if test "x$GCC" != xyes; then # only works with Sun CC
|
|
AC_CHECK_LIB(sunmath, acosp,
|
|
[AC_CHECK_LIB(sunperf, $sgemm,
|
|
[BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
|
|
pac_blas_ok=yes],[],[-lsunmath])])
|
|
|
|
fi
|
|
fi
|
|
|
|
# BLAS in SCSL library? (SGI/Cray Scientific Library)
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(scs, $sgemm, [pac_blas_ok=yes; BLAS_LIBS="-lscs"])
|
|
fi
|
|
|
|
# BLAS in SGIMATH library?
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(complib.sgimath, $sgemm,
|
|
[pac_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
|
|
fi
|
|
|
|
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(blas, $sgemm,
|
|
[AC_CHECK_LIB(essl, $sgemm,
|
|
[pac_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
|
|
[], [-lblas $FLIBS])])
|
|
fi
|
|
# BLAS linked to by default? (happens on some supercomputers)
|
|
if test $pac_blas_ok = no; then
|
|
save_LIBS="$LIBS"; LIBS="$LIBS"
|
|
AC_TRY_LINK_FUNC($sgemm, [pac_blas_ok=yes], [BLAS_LIBS=""])
|
|
dnl AC_CHECK_FUNC($sgemm, [pac_blas_ok=yes])
|
|
LIBS="$save_LIBS"
|
|
fi
|
|
|
|
# Generic BLAS library?
|
|
if test $pac_blas_ok = no; then
|
|
AC_LANG([Fortran])
|
|
AC_CHECK_LIB(blas, sgemm, [pac_blas_ok=yes; BLAS_LIBS="-lblas"])
|
|
AC_LANG([C])
|
|
if test $pac_blas_ok = no; then
|
|
AC_CHECK_LIB(blas, $sgemm, [pac_blas_ok=yes; BLAS_LIBS="-lblas"])
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(BLAS_LIBS)
|
|
|
|
LIBS="$pac_blas_save_LIBS"
|
|
|
|
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
|
if test x"$pac_blas_ok" = xyes; then
|
|
ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
|
|
:
|
|
else
|
|
pac_blas_ok=no
|
|
$2
|
|
fi
|
|
])dnl PAC_BLAS
|
|
|
|
|
|
dnl @synopsis PAC_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
|
dnl @synopsis ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl This macro looks for a library that implements the LAPACK
|
|
dnl linear-algebra interface (see http://www.netlib.org/lapack/). On
|
|
dnl success, it sets the LAPACK_LIBS output variable to hold the
|
|
dnl requisite library linkages.
|
|
dnl
|
|
dnl To link with LAPACK, you should link with:
|
|
dnl
|
|
dnl $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS
|
|
dnl
|
|
dnl in that order. BLAS_LIBS is the output variable of the ACX_BLAS
|
|
dnl macro, called automatically. FLIBS is the output variable of the
|
|
dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and
|
|
dnl is sometimes necessary in order to link with F77 libraries. Users
|
|
dnl will also need to use AC_F77_DUMMY_MAIN (see the autoconf manual),
|
|
dnl for the same reason.
|
|
dnl
|
|
dnl The user may also use --with-lapack=<lib> in order to use some
|
|
dnl specific LAPACK library <lib>. In order to link successfully,
|
|
dnl however, be aware that you will probably need to use the same
|
|
dnl Fortran compiler (which can be set via the F77 env. var.) as was
|
|
dnl used to compile the LAPACK and BLAS libraries.
|
|
dnl
|
|
dnl ACTION-IF-FOUND is a list of shell commands to run if a LAPACK
|
|
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
|
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
|
dnl default action will define HAVE_LAPACK.
|
|
dnl
|
|
dnl @category InstalledPackages
|
|
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
|
dnl @version 2002-03-12
|
|
dnl @license GPLWithACException
|
|
dnl modified by salvatore.filippone@uniroma2.it
|
|
dnl shifted check for ESSL as it was generating erroneous results on
|
|
dnl AIX SP5.
|
|
dnl Modified with new name to handle Fortran compilers (such as NAG)
|
|
dnl for which the linking MUST be done with the compiler (i.e.:
|
|
dnl trying to link the Fortran version of the BLAS with the C compiler
|
|
dnl would fail even when linking in the compiler's library)
|
|
|
|
AC_DEFUN([PAC_LAPACK], [
|
|
AC_REQUIRE([PAC_BLAS])
|
|
pac_lapack_ok=no
|
|
|
|
AC_ARG_WITH(lapack,
|
|
[AC_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])])
|
|
case $with_lapack in
|
|
yes | "") ;;
|
|
no) pac_lapack_ok=disable ;;
|
|
-* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;;
|
|
*) LAPACK_LIBS="-l$with_lapack" ;;
|
|
esac
|
|
|
|
# Get fortran linker name of LAPACK function to check for.
|
|
AC_F77_FUNC(cheev)
|
|
|
|
# We cannot use LAPACK if BLAS is not found
|
|
if test "x$pac_blas_ok" != xyes; then
|
|
pac_lapack_ok=noblas
|
|
fi
|
|
|
|
# First, check LAPACK_LIBS environment variable
|
|
if test "x$LAPACK_LIBS" != x; then
|
|
save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
|
|
AC_MSG_CHECKING([for cheev in $LAPACK_LIBS])
|
|
AC_LANG([Fortran])
|
|
dnl Warning : square brackets are EVIL!
|
|
cat > conftest.$ac_ext <<EOF
|
|
program test_cheev
|
|
call cheev
|
|
end
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
pac_lapack_ok=yes
|
|
AC_MSG_RESULT([yes])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
fi
|
|
rm -f conftest*
|
|
LIBS="$save_LIBS"
|
|
if test pac_lapack_ok = no; then
|
|
LAPACK_LIBS=""
|
|
fi
|
|
AC_LANG([C])
|
|
fi
|
|
|
|
# LAPACK linked to by default? (is sometimes included in BLAS lib)
|
|
if test $pac_lapack_ok = no; then
|
|
save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
|
|
AC_MSG_CHECKING([for cheev in default libs])
|
|
AC_LANG([Fortran])
|
|
dnl Warning : square brackets are EVIL!
|
|
cat > conftest.$ac_ext <<EOF
|
|
program test_cheev
|
|
call cheev
|
|
end
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
pac_lapack_ok=yes
|
|
AC_MSG_RESULT([yes])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
fi
|
|
rm -f conftest*
|
|
LIBS="$save_LIBS"
|
|
AC_LANG([C])
|
|
fi
|
|
|
|
# Generic LAPACK library?
|
|
for lapack in lapack lapack_rs6k; do
|
|
if test $pac_lapack_ok = no; then
|
|
save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
|
|
AC_LANG([Fortran])
|
|
AC_CHECK_LIB($lapack, cheev,
|
|
[pac_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS])
|
|
AC_LANG([C])
|
|
LIBS="$save_LIBS"
|
|
fi
|
|
done
|
|
|
|
AC_SUBST(LAPACK_LIBS)
|
|
|
|
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
|
if test x"$pac_lapack_ok" = xyes; then
|
|
ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1])
|
|
:
|
|
else
|
|
pac_lapack_ok=no
|
|
$2
|
|
fi
|
|
])dnl PAC_LAPACK
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_FLUSH( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the FLUSH Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Michele Martone <michele.martone@uniroma2.it>
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_FLUSH,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran FLUSH statement])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program conftest
|
|
integer :: iunit=10
|
|
open(10)
|
|
write(10,*) 'Test '
|
|
flush(10)
|
|
close(10)
|
|
end program conftest
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_ISO_FORTRAN_ENV( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will determine if the fortran compiler MPIFC supports ISO_FORTRAN_ENV
|
|
dnl
|
|
dnl If yes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
dnl
|
|
AC_DEFUN(PAC_FORTRAN_TEST_ISO_FORTRAN_ENV,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for ISO_FORTRAN_ENV])
|
|
cat > conftest.$ac_ext <<EOF
|
|
program test
|
|
use iso_fortran_env
|
|
end program test
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [rm -rf conftest*
|
|
$1])
|
|
else
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
AC_MSG_RESULT([no])
|
|
ifelse([$2], , , [ rm -rf conftest*
|
|
$2
|
|
])dnl
|
|
fi
|
|
rm -f conftest*])
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_MOLD( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the MOLD= Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_MOLD,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran MOLD= allocation])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program xtt
|
|
type foo
|
|
integer :: i
|
|
end type foo
|
|
type, extends(foo) :: new_foo
|
|
integer :: j
|
|
end type new_foo
|
|
class(foo), allocatable :: fooab
|
|
type(new_foo) :: nfv
|
|
integer :: info
|
|
|
|
allocate(fooab, mold=nfv, stat=info)
|
|
|
|
end program xtt
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|
|
|
|
dnl @synopsis PAC_FORTRAN_TEST_SOURCE( [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
dnl
|
|
dnl Will try to compile and link a program checking the SOURCE= Fortran support.
|
|
dnl
|
|
dnl Will use MPIFC, otherwise '$FC'.
|
|
dnl
|
|
dnl If the test passes, will execute ACTION-IF-FOUND. Otherwise, ACTION-IF-NOT-FOUND.
|
|
dnl Note : This file will be likely to induce the compiler to create a module file
|
|
dnl (for a module called conftest).
|
|
dnl Depending on the compiler flags, this could cause a conftest.mod file to appear
|
|
dnl in the present directory, or in another, or with another name. So be warned!
|
|
dnl
|
|
dnl @author Salvatore Filippone <salvatore.filippone@uniroma2.it>
|
|
AC_DEFUN(PAC_FORTRAN_TEST_SOURCE,
|
|
ac_exeext=''
|
|
ac_ext='f90'
|
|
ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
|
dnl Warning : square brackets are EVIL!
|
|
[AC_MSG_CHECKING([support for Fortran SOURCE= allocation])
|
|
i=0
|
|
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
|
i=`expr $i + 1`
|
|
done
|
|
mkdir tmpdir_$i
|
|
cd tmpdir_$i
|
|
cat > conftest.$ac_ext <<EOF
|
|
program xtt
|
|
type foo
|
|
integer :: i
|
|
end type foo
|
|
type, extends(foo) :: new_foo
|
|
integer :: j
|
|
end type new_foo
|
|
class(foo), allocatable :: fooab
|
|
type(new_foo) :: nfv
|
|
integer :: info
|
|
|
|
allocate(fooab, source=nfv, stat=info)
|
|
|
|
end program xtt
|
|
EOF
|
|
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$1], , :, [
|
|
$1])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
echo "configure: failed program was:" >&AC_FD_CC
|
|
cat conftest.$ac_ext >&AC_FD_CC
|
|
ifelse([$2], , , [
|
|
$2
|
|
])dnl
|
|
fi
|
|
cd ..
|
|
rm -fr tmpdir_$i])
|
|
|