Fix Makefiles for parallel make

master
Salvatore Filippone 3 years ago
parent 636239bdb8
commit bcc85e47fd

@ -1,31 +1,39 @@
include Make.inc include Make.inc
all: libd based precd kryld utild cbindd all: dirs based precd kryld utild cbindd libd
@echo "=====================================" @echo "====================================="
@echo "PSBLAS libraries Compilation Successful." @echo "PSBLAS libraries Compilation Successful."
based: libd dirs:
(if test ! -d lib ; then mkdir lib; fi)
(if test ! -d include ; then mkdir include; fi; $(INSTALL_DATA) Make.inc include/Make.inc.psblas)
(if test ! -d modules ; then mkdir modules; fi;)
precd: based precd: based
utild: based utild: based
kryld: precd kryld: precd
cbindd: precd kryld utild cbindd: based precd kryld utild
libd: libd: based precd kryld utild cbindd
(if test ! -d lib ; then mkdir lib; fi)
(if test ! -d include ; then mkdir include; fi; $(INSTALL_DATA) Make.inc include/Make.inc.psblas)
(if test ! -d modules ; then mkdir modules; fi;)
based:
$(MAKE) -C base lib $(MAKE) -C base lib
precd:
$(MAKE) -C prec lib $(MAKE) -C prec lib
kryld:
$(MAKE) -C krylov lib $(MAKE) -C krylov lib
utild:
$(MAKE) -C util lib $(MAKE) -C util lib
cbindd:
$(MAKE) -C cbind lib $(MAKE) -C cbind lib
based:
$(MAKE) -C base objs
precd:
$(MAKE) -C prec objs
kryld:
$(MAKE) -C krylov objs
utild:
$(MAKE) -C util objs
cbindd:
$(MAKE) -C cbind objs
install: all install: all
mkdir -p $(INSTALL_INCLUDEDIR) &&\ mkdir -p $(INSTALL_INCLUDEDIR) &&\
$(INSTALL_DATA) Make.inc $(INSTALL_INCLUDEDIR)/Make.inc.psblas $(INSTALL_DATA) Make.inc $(INSTALL_INCLUDEDIR)/Make.inc.psblas

@ -6,24 +6,31 @@ INCDIR=../include
MODDIR=../modules MODDIR=../modules
LIBNAME=$(BASELIBNAME) LIBNAME=$(BASELIBNAME)
lib: mods sr cm in pb tl objs: mods sr cm in pb tl
lib: objs
$(MAKE) -C modules lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)"
$(MAKE) -C serial lib LIBNAME=$(BASELIBNAME)
$(MAKE) -C comm lib LIBNAME=$(BASELIBNAME)
$(MAKE) -C internals lib LIBNAME=$(BASELIBNAME)
$(MAKE) -C psblas lib LIBNAME=$(BASELIBNAME)
$(MAKE) -C tools lib LIBNAME=$(BASELIBNAME)
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
sr cm in pb tl: mods sr cm in pb tl: mods
mods: mods:
$(MAKE) -C modules lib LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)" $(MAKE) -C modules objs LIBNAME=$(BASELIBNAME) F90="$(MPF90)" F90COPT="$(F90COPT) $(MPI_OPT)"
sr: sr:
$(MAKE) -C serial lib LIBNAME=$(BASELIBNAME) $(MAKE) -C serial objs LIBNAME=$(BASELIBNAME)
cm: cm:
$(MAKE) -C comm lib LIBNAME=$(BASELIBNAME) $(MAKE) -C comm objs LIBNAME=$(BASELIBNAME)
in: in:
$(MAKE) -C internals lib LIBNAME=$(BASELIBNAME) $(MAKE) -C internals objs LIBNAME=$(BASELIBNAME)
pb: pb:
$(MAKE) -C psblas lib LIBNAME=$(BASELIBNAME) $(MAKE) -C psblas objs LIBNAME=$(BASELIBNAME)
tl: tl:
$(MAKE) -C tools lib LIBNAME=$(BASELIBNAME) $(MAKE) -C tools objs LIBNAME=$(BASELIBNAME)
clean: clean:
($(MAKE) -C modules clean) ($(MAKE) -C modules clean)

@ -27,12 +27,15 @@ INCDIR=..
MODDIR=../modules MODDIR=../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR)
lib: interns mpfobjs $(OBJS) objs: interns mpfobjs $(OBJS)
lib: objs
$(MAKE) -C internals lib LIBNAME=$(LIBNAME)
$(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(OBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)
interns: interns:
$(MAKE) -C internals lib $(MAKE) -C internals objs
mpfobjs: mpfobjs:
$(MAKE) $(MPFOBJS) FC="$(MPFC)" $(MAKE) $(MPFOBJS) FC="$(MPFC)"

@ -31,7 +31,8 @@ MODDIR=../../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR)
CINCLUDES=-I. CINCLUDES=-I.
lib: mpfobjs $(FOBJS) $(MPFOBJS) objs: mpfobjs $(FOBJS) $(MPFOBJS)
lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -16,7 +16,8 @@ MODDIR=../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR)
CINCLUDES=-I. CINCLUDES=-I.
lib: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(MPFOBJS) objs: mpfobjs $(FOBJS) $(FOBJS2) $(COBJS) $(MPFOBJS2) $(MPFOBJS)
lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(MPFOBJS2) $(FOBJS) $(FOBJS2) $(COBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -108,15 +108,18 @@ UTIL_MODS = desc/psb_desc_const_mod.o desc/psb_indx_map_mod.o\
MODULES=$(BASIC_MODS) $(SERIAL_MODS) $(UTIL_MODS) MODULES=$(BASIC_MODS) $(SERIAL_MODS) $(UTIL_MODS)
OBJS = error.o psb_base_mod.o $(EXTRA_COBJS) cutil.o OBJS = error.o psb_base_mod.o $(EXTRA_COBJS) cutil.o
LIBDIR=.. MODDIR=../../modules
LIBDIR=../
CINCLUDES=-I. CINCLUDES=-I.
FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG). FINCLUDES=$(FMFLAG)$(LIBDIR) $(FMFLAG). $(FIFLAG).
lib: $(LIBDIR)/$(LIBNAME) objs: $(MODULES) $(OBJS) $(MPFOBJS)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
$(LIBDIR)/$(LIBNAME): $(MODULES) $(OBJS) $(MPFOBJS) lib: objs $(LIBDIR)/$(LIBNAME)
$(LIBDIR)/$(LIBNAME): objs
$(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MODULES) $(OBJS) $(MPFOBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -24,7 +24,9 @@ MODDIR=../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR)
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -20,18 +20,19 @@ INCDIR=..
MODDIR=../modules MODDIR=../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR)
lib: impld sortd lib1 $(FOBJS)
objs: impld sortd $(FOBJS)
lib: objs
$(MAKE) -C impl lib
$(MAKE) -C sort lib
$(AR) $(LIBDIR)/$(LIBNAME) $(FOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(FOBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)
#cood csrd jadd
lib1: $(FOBJS)
impld: impld:
$(MAKE) -C impl lib $(MAKE) -C impl objs
sortd: sortd:
$(MAKE) -C sort lib $(MAKE) -C sort objs
clean: clean:
/bin/rm -f $(FOBJS) *$(.mod) /bin/rm -f $(FOBJS) *$(.mod)
($(MAKE) -C impl clean) ($(MAKE) -C impl clean)

@ -36,9 +36,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME)
# #
default: lib objs: $(OBJS)
lib: $(OBJS) lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -27,9 +27,9 @@ LIBFILE=$(LIBDIR)/$(LIBNAME)
# #
default: lib objs: $(OBJS)
lib: $(OBJS) lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -40,7 +40,9 @@ INCDIR=..
MODDIR=../modules MODDIR=../modules
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(FIFLAG)$(MODDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(FIFLAG)$(MODDIR)
lib: mpfobjs $(FOBJS) objs: mpfobjs $(FOBJS)
lib: objs
$(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(FOBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(MPFOBJS) $(FOBJS)
$(RANLIB) $(LIBDIR)/$(LIBNAME) $(RANLIB) $(LIBDIR)/$(LIBNAME)

@ -6,20 +6,25 @@ INCDIR=../include
MODDIR=../modules/ MODDIR=../modules/
LIBNAME=$(CBINDLIBNAME) LIBNAME=$(CBINDLIBNAME)
lib: based precd krylovd utild objs: based precd krylovd utild
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *.h $(INCDIR) /bin/cp -p $(CPUPDFLAG) *.h $(INCDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR) /bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
lib: objs
cd base && $(MAKE) lib LIBNAME=$(LIBNAME)
cd prec && $(MAKE) lib LIBNAME=$(LIBNAME)
cd krylov && $(MAKE) lib LIBNAME=$(LIBNAME)
cd util && $(MAKE) lib LIBNAME=$(LIBNAME)
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
based: based:
cd base && $(MAKE) lib LIBNAME=$(LIBNAME) cd base && $(MAKE) objs LIBNAME=$(LIBNAME)
precd: based precd: based
cd prec && $(MAKE) lib LIBNAME=$(LIBNAME) cd prec && $(MAKE) objs LIBNAME=$(LIBNAME)
krylovd: based precd krylovd: based precd
cd krylov && $(MAKE) lib LIBNAME=$(LIBNAME) cd krylov && $(MAKE) objs LIBNAME=$(LIBNAME)
utild: based utild: based
cd util && $(MAKE) lib LIBNAME=$(LIBNAME) cd util && $(MAKE) objs LIBNAME=$(LIBNAME)
clean: clean:
cd base && $(MAKE) clean cd base && $(MAKE) clean

@ -27,10 +27,11 @@ OBJS=$(FOBJS) $(COBJS)
LIBNAME=$(CBINDLIBNAME) LIBNAME=$(CBINDLIBNAME)
lib: $(OBJS) $(CMOD) objs: $(OBJS) $(CMOD)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
$(COBJS): $(CMOD) $(COBJS): $(CMOD)

@ -16,11 +16,12 @@ CMOD=psb_krylov_cbind.h
LIBNAME=$(CKRYLOVLIBNAME) LIBNAME=$(CKRYLOVLIBNAME)
lib: $(OBJS) $(CMOD) objs: $(OBJS) $(CMOD)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
psb_skrylov_cbind_mod.o psb_dkrylov_cbind_mod.o psb_ckrylov_cbind_mod.o psb_zkrylov_cbind_mod.o: psb_base_krylov_cbind_mod.o psb_skrylov_cbind_mod.o psb_dkrylov_cbind_mod.o psb_ckrylov_cbind_mod.o psb_zkrylov_cbind_mod.o: psb_base_krylov_cbind_mod.o
veryclean: clean veryclean: clean

@ -18,11 +18,12 @@ CMOD=psb_prec_cbind.h psb_c_sprec.h psb_c_dprec.h psb_c_cprec.h psb_c_zprec.h
LIBNAME=$(CPRECLIBNAME) LIBNAME=$(CPRECLIBNAME)
lib: $(OBJS) $(CMOD) objs: $(OBJS) $(CMOD)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
psb_prec_cbind_mod.o: psb_sprec_cbind_mod.o psb_dprec_cbind_mod.o psb_cprec_cbind_mod.o psb_zprec_cbind_mod.o psb_prec_cbind_mod.o: psb_sprec_cbind_mod.o psb_dprec_cbind_mod.o psb_cprec_cbind_mod.o psb_zprec_cbind_mod.o
veryclean: clean veryclean: clean

@ -18,11 +18,12 @@ CMOD=psb_util_cbind.h psb_c_cutil.h psb_c_zutil.h psb_c_dutil.h psb_c_sutil.h
LIBNAME=$(CUTILLIBNAME) LIBNAME=$(CUTILLIBNAME)
lib: $(OBJS) $(CMOD) objs: $(OBJS) $(CMOD)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p *$(.mod) $(CMOD) $(HERE)
psb_util_cbind_mod.o: psb_c_util_cbind_mod.o psb_d_util_cbind_mod.o psb_s_util_cbind_mod.o psb_z_util_cbind_mod.o psb_util_cbind_mod.o: psb_c_util_cbind_mod.o psb_d_util_cbind_mod.o psb_s_util_cbind_mod.o psb_z_util_cbind_mod.o
veryclean: clean veryclean: clean

@ -26,11 +26,13 @@ LIBNAME=$(METHDLIBNAME)
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
lib: $(OBJS) objs: $(OBJS)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o psb_d_krylov_conv_mod.o psb_z_krylov_conv_mod.o: psb_base_krylov_conv_mod.o psb_s_krylov_conv_mod.o psb_c_krylov_conv_mod.o psb_d_krylov_conv_mod.o psb_z_krylov_conv_mod.o: psb_base_krylov_conv_mod.o

@ -28,14 +28,16 @@ COBJS=
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS) OBJS=$(F90OBJS) $(COBJS) $(MPFOBJS) $(MODOBJS)
lib: $(OBJS) impld objs: $(OBJS) impld
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
lib: objs
$(MAKE) -C impl lib
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
impld: $(OBJS) impld: $(OBJS)
$(MAKE) -C impl $(MAKE) -C impl objs
$(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod) $(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod)

@ -42,7 +42,8 @@ LIBNAME=$(PRECLIBNAME)
COBJS= COBJS=
FINCLUDES=$(FMFLAG).. $(FMFLAG)$(MODDIR) FINCLUDES=$(FMFLAG).. $(FMFLAG)$(MODDIR)
lib: $(OBJS) objs: $(OBJS)
lib: objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)

@ -29,11 +29,12 @@ LIBNAME=$(UTILLIBNAME)
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR) FINCLUDES=$(FMFLAG). $(FMFLAG)$(MODDIR)
objs: $(OBJS)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
lib: $(HERE)/$(LIBNAME) lib: $(HERE)/$(LIBNAME)
/bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR) /bin/cp -p $(CPUPDFLAG) $(HERE)/$(LIBNAME) $(LIBDIR)
/bin/cp -p $(CPUPDFLAG) *$(.mod) $(MODDIR)
$(HERE)/$(LIBNAME): $(OBJS) $(HERE)/$(LIBNAME): objs
$(AR) $(HERE)/$(LIBNAME) $(OBJS) $(AR) $(HERE)/$(LIBNAME) $(OBJS)
$(RANLIB) $(HERE)/$(LIBNAME) $(RANLIB) $(HERE)/$(LIBNAME)

Loading…
Cancel
Save