diff --git a/base/modules/psb_realloc_mod.F90 b/base/modules/psb_realloc_mod.F90 index 6412cadd..05f87d19 100644 --- a/base/modules/psb_realloc_mod.F90 +++ b/base/modules/psb_realloc_mod.F90 @@ -2743,20 +2743,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_smove_alloc1d Subroutine psb_smove_alloc2d(vin,vout,info) @@ -2766,22 +2755,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_smove_alloc2d Subroutine psb_dmove_alloc1d(vin,vout,info) @@ -2791,20 +2767,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_dmove_alloc1d Subroutine psb_dmove_alloc2d(vin,vout,info) @@ -2814,22 +2779,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_dmove_alloc2d Subroutine psb_cmove_alloc1d(vin,vout,info) @@ -2839,20 +2791,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_cmove_alloc1d Subroutine psb_cmove_alloc2d(vin,vout,info) @@ -2862,22 +2803,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_cmove_alloc2d Subroutine psb_zmove_alloc1d(vin,vout,info) @@ -2887,20 +2815,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_zmove_alloc1d Subroutine psb_zmove_alloc2d(vin,vout,info) @@ -2910,22 +2827,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_zmove_alloc2d Subroutine psb_imove_alloc1d(vin,vout,info) @@ -2935,20 +2839,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_imove_alloc1d Subroutine psb_imove_alloc2d(vin,vout,info) @@ -2958,22 +2851,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_imove_alloc2d #if !defined(LONG_INTEGERS) @@ -2984,20 +2864,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i8move_alloc1d Subroutine psb_i8move_alloc2d(vin,vout,info) @@ -3007,22 +2876,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i8move_alloc2d #else @@ -3034,20 +2890,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i4move_alloc1d Subroutine psb_i4move_alloc1d_i8(vin,vout,info) @@ -3057,20 +2902,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i4move_alloc1d_i8 Subroutine psb_i4move_alloc2d(vin,vout,info) @@ -3080,22 +2914,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i4move_alloc2d Subroutine psb_i4move_alloc2d_i8(vin,vout,info) @@ -3105,22 +2926,9 @@ Contains ! ! info=psb_success_ -#ifdef HAVE_MOVE_ALLOC call move_alloc(vin,vout) -#else - if (allocated(vout)) then - deallocate(vout,stat=info) - end if - if (.not.allocated(vin) ) return - - allocate(vout(lbound(vin,1):ubound(vin,1),& - & lbound(vin,2):ubound(vin,2)),stat=info) - if (info /= psb_success_) return - vout = vin - deallocate(vin,stat=info) -#endif end Subroutine psb_i4move_alloc2d_i8 #endif diff --git a/cbind/base/Makefile b/cbind/base/Makefile index 29c5aaee..9d6e9814 100644 --- a/cbind/base/Makefile +++ b/cbind/base/Makefile @@ -4,8 +4,8 @@ LIBDIR=$(TOP)lib INCLUDEDIR=$(TOP)/include HERE=.. -FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCLUDEDIR) -CINCLUDES=-I. -I$(INCLUDEDIR) +FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(INCLUDEDIR) +CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR) FOBJS= psb_objhandle_mod.o psb_base_cbind_mod.o psb_cpenv_mod.o \ psb_base_tools_cbind_mod.o psb_base_string_cbind_mod.o \ diff --git a/cbind/prec/Makefile b/cbind/prec/Makefile index aa88b93a..f463ffcf 100644 --- a/cbind/prec/Makefile +++ b/cbind/prec/Makefile @@ -4,8 +4,8 @@ LIBDIR=$(TOP)/lib INCLUDEDIR=$(TOP)/include HERE=.. -FINCLUDES=$(FMFLAG). $(FMFLAG)$(INCLUDEDIR) -CINCLUDES=-I. -I$(INCLUDEDIR) +FINCLUDES=$(FMFLAG). $(FMFLAG)$(HERE) $(FMFLAG)$(INCLUDEDIR) +CINCLUDES=-I. -I$(HERE) -I$(INCLUDEDIR) OBJS=psb_prec_cbind_mod.o psb_dprec_cbind_mod.o psb_c_dprec.o CMOD=psb_prec_cbind.h psb_c_dprec.h diff --git a/cbind/prec/psb_dprec_cbind_mod.mod b/cbind/prec/psb_dprec_cbind_mod.mod index b153ab91..804053e0 100644 Binary files a/cbind/prec/psb_dprec_cbind_mod.mod and b/cbind/prec/psb_dprec_cbind_mod.mod differ diff --git a/configure b/configure index 29bbd60e..00b83c95 100755 --- a/configure +++ b/configure @@ -8752,7 +8752,7 @@ $as_echo "$ac_try_echo") >&5 } && test -s conftest.$ac_objext; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - FDEFINES="$psblas_cv_define_prepend-DHAVE_ISO_C_BINDING $FDEFINES" + : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 diff --git a/configure.ac b/configure.ac index 5ab61c32..bd4c0452 100755 --- a/configure.ac +++ b/configure.ac @@ -576,7 +576,7 @@ PAC_FORTRAN_HAVE_MOVE_ALLOC( ) PAC_FORTRAN_TEST_ISO_C_BIND( - [FDEFINES="$psblas_cv_define_prepend-DHAVE_ISO_C_BINDING $FDEFINES"], + [], [AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for ISO_C_BINDING. Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])] ) diff --git a/util/psb_c_renum_impl.F90 b/util/psb_c_renum_impl.F90 index b80d491f..4cb63e06 100644 --- a/util/psb_c_renum_impl.F90 +++ b/util/psb_c_renum_impl.F90 @@ -232,7 +232,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -242,7 +242,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -267,7 +267,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_d_renum_impl.F90 b/util/psb_d_renum_impl.F90 index 98345421..56ef2bf9 100644 --- a/util/psb_d_renum_impl.F90 +++ b/util/psb_d_renum_impl.F90 @@ -232,7 +232,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -242,7 +242,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -267,7 +267,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_s_renum_impl.F90 b/util/psb_s_renum_impl.F90 index 149ccb74..cb3c2dd3 100644 --- a/util/psb_s_renum_impl.F90 +++ b/util/psb_s_renum_impl.F90 @@ -233,7 +233,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -243,7 +243,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -268,7 +268,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) info = psb_success_ nr = a%get_nrows() diff --git a/util/psb_z_renum_impl.F90 b/util/psb_z_renum_impl.F90 index 1f529afe..a2904de2 100644 --- a/util/psb_z_renum_impl.F90 +++ b/util/psb_z_renum_impl.F90 @@ -232,7 +232,7 @@ contains subroutine psb_mat_renum_amd(a,info,operm) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) use iso_c_binding #endif use psb_base_mod @@ -242,7 +242,7 @@ contains integer(psb_ipk_), allocatable, optional, intent(out) :: operm(:) ! -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) interface function psb_amd_order(n,ap,ai,p)& & result(res) bind(c,name='psb_amd_order') @@ -267,7 +267,7 @@ contains name = 'mat_renum_amd' call psb_erractionsave(err_act) -#if defined(HAVE_AMD) && defined(HAVE_ISO_C_BINDING) +#if defined(HAVE_AMD) info = psb_success_ nr = a%get_nrows()