diff --git a/base/modules/psb_config.h.in b/base/modules/psb_config.h.in index 3bf9a645..e0258015 100644 --- a/base/modules/psb_config.h.in +++ b/base/modules/psb_config.h.in @@ -4,6 +4,11 @@ #define PSB_ERR_ERROR -1 #define PSB_ERR_SUCCESS 0 +#define PSB_VERSION_MAJOR @PSBLASMAJOR@ +#define PSB_VERSION_MINOR @PSBLASMINOR@ +#define PSB_VERSION_PATCHLEVEL @PSBLASPATCH@ +#define PSB_VERSION_STRING @PSBLASSTRING@ + @CSERIALMPI@ @PSB_IPKDEF@ diff --git a/config/pac.m4 b/config/pac.m4 index 9a9a1b0f..90340c8d 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -2348,3 +2348,23 @@ fi ] ) +dnl @synopsis PAC_FORTRAN_PSBLAS_VERSION( ) +dnl +dnl Will try to compile, link and run a program using the PSBLAS library. \ +dnl Checks for version major, minor and patchlevel +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 +dnl @author Salvatore Filippone +dnl +AC_DEFUN(PAC_EXTRACT_PSBLAS_VERSION, +[AC_MSG_CHECKING([for version data of PSBLAS]) + pac_const_file="base/modules/psb_const_mod.F90"; + pac_cv_psblas_version_major=`cat $pac_const_file| grep version_major`; + pac_cv_psblas_version_minor=`cat $pac_const_file | grep version_minor `; + pac_cv_psblas_patchlevel=`cat $pac_const_file | grep patchlevel `; + pac_cv_psblas_version_string=`cat $pac_const_file | grep version_string `; +]) diff --git a/configure b/configure index 1a23fa64..ef5867a5 100755 --- a/configure +++ b/configure @@ -690,6 +690,10 @@ CINTMETIS CHAVEMETIS CHAVE_OPENMP CSERIALMPI +PSBLASSTRING +PSBLASPATCH +PSBLASMINOR +PSBLASMAJOR PSB_LPKDEF PSB_IPKDEF FINCLUDES @@ -8745,6 +8749,17 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +###################### +# Extract version data +###################### +#PAC_EXTRACT_PSBLAS_VERSION +CFILE="base/modules/psb_const_mod.F90"; +PSBLASMAJOR=`cat $CFILE| grep version_major | $AWK '{print $6;}'`; +PSBLASMINOR=`cat $CFILE| grep version_minor| $AWK '{print $6;}'`; +PSBLASPATCH=`cat $CFILE| grep patchlevel| $AWK '{print $6;}'`; +PSBLASSTRING=`cat $CFILE | grep version_string | $AWK '{print $6;}'`; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: version $PSBLASSTRING" >&5 +printf "%s\n" " version $PSBLASSTRING" >&6; } ############################################################################### # Additional pathname stuff (yes, it is redundant and confusing...) @@ -11694,6 +11709,10 @@ FDEFINES=$(PSBFDEFINES) + + + + diff --git a/configure.ac b/configure.ac index 3b6aedbd..ad5e573f 100644 --- a/configure.ac +++ b/configure.ac @@ -680,6 +680,16 @@ PAC_FORTRAN_TEST_FLUSH( [FDEFINES="$psblas_cv_define_prepend-DPSB_HAVE_FLUSH_STMT $FDEFINES"], ) +###################### +# Extract version data +###################### +#PAC_EXTRACT_PSBLAS_VERSION +CFILE="base/modules/psb_const_mod.F90"; +PSBLASMAJOR=`cat $CFILE| grep version_major | $AWK '{print $6;}'`; +PSBLASMINOR=`cat $CFILE| grep version_minor| $AWK '{print $6;}'`; +PSBLASPATCH=`cat $CFILE| grep patchlevel| $AWK '{print $6;}'`; +PSBLASSTRING=`cat $CFILE | grep version_string | $AWK '{print $6;}'`; +AC_MSG_RESULT([ version $PSBLASSTRING]) ############################################################################### # Additional pathname stuff (yes, it is redundant and confusing...) @@ -1051,6 +1061,10 @@ FDEFINES=$(PSBFDEFINES) AC_SUBST(PSB_IPKDEF) AC_SUBST(PSB_LPKDEF) +AC_SUBST(PSBLASMAJOR) +AC_SUBST(PSBLASMINOR) +AC_SUBST(PSBLASPATCH) +AC_SUBST(PSBLASSTRING) AC_SUBST(CSERIALMPI) AC_SUBST(CHAVE_OPENMP) AC_SUBST(CHAVEMETIS)