diff --git a/math/blacs/Makefile b/math/blacs/Makefile index 8e696c89704d..f550f55ff9a4 100644 --- a/math/blacs/Makefile +++ b/math/blacs/Makefile @@ -1,126 +1,126 @@ PORTNAME= blacs PORTVERSION= 1.7 -PORTREVISION= 40 +PORTREVISION= 41 CATEGORIES= math MASTER_SITES= NETLIB/blacs DISTNAME= BLACS DISTFILES= mpiblacs.tgz blacstester.tgz mpiblacs-patch03.tgz DIST_SUBDIR= blacs EXTRACT_ONLY= mpiblacs.tgz blacstester.tgz mpiblacs-patch03.tgz MAINTAINER= ports@FreeBSD.org COMMENT= BLACS (Basic Linear Algebra Communication Subprograms) WWW= https://www.netlib.org/blacs/ # See http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01200.html LICENSE= BSD3CLAUSE SUB_FILES= pkg-message USES= fortran gmake localbase USE_LDCONFIG= yes OPTIONS_DEFINE= DOCS OPTIONS_RADIO= MPI OPTIONS_RADIO_MPI= MPICH OPENMPI OPTIONS_DEFAULT= DOCS MPICH DOCS_DISTFILES= blacs_install.ps f77blacsqref.ps lawn94.ps \ cblacsqref.ps mpi_prop.ps mpiblacs_issues.ps OPENMPI_USES= mpi:openmpi OPENMPI_EXTRA_PATCHES= ${FILESDIR}/Bmake.inc-openmpi.diff MPICH_USES= mpi:mpich MPICH_EXTRA_PATCHES= ${FILESDIR}/Bmake.inc-mpich.diff .include F77EXTRAFLAGS= #-w -fno-globals -fugly-complex -.if ${GCC_DEFAULT} >= 10 +.if ${FORTRAN_DEFAULT} == gfortran && ${GCC_DEFAULT} >= 10 # workaround for Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) F77EXTRAFLAGS+= -fallow-argument-mismatch .endif DEBUG_LEVEL= 0 .if ${ARCH} == "amd64" FPIC= -fPIC .else FPIC= -fpic .endif WRKSRC_SHARED=${WRKSRC}_shared CFLAGS_SHARED=${CFLAGS} ${FPIC} FFLAGS_SHARED=${FFLAGS} ${FPIC} SVERSION=1 .if defined(WITH_OPTIMIZED_FLAGS) .if ${ARCH} == "amd64" FFLAGS+= -pipe -O3 -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time CFLAGS+= -pipe -O3 -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time .elif ${ARCH} == "i386" FFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double -mcpu=i686 -march=i686 -mfancy-math-387 -mpreferred-stack-boundary=3 CFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double -mcpu=i686 -march=i686 -mfancy-math-387 -mpreferred-stack-boundary=3 .else FFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -Wno-multichar CFLAGS+= -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -Wno-multichar .endif .endif pre-patch: (${CP} ${WRKSRC}/BMAKES/Bmake.MPI-LINUX ${WRKSRC}/Bmake.inc) post-patch: ${CP} -r ${WRKSRC} ${WRKSRC_SHARED} pre-configure: (${REINPLACE_CMD} -e 's|@WRKSRC@|${WRKSRC}|g ; s|@DEBUG_LEVEL@|${DEBUG_LEVEL}|g ; s|@LOCALBASE@|${LOCALBASE}|g ; s|@CC@|${CC}|g ; s|@CFLAGS@|${CFLAGS}|g ; s|@F77@|${F77}|g ; s|@FFLAGS@|${FFLAGS}|g ; s|@F77EXTRAFLAGS@|${F77EXTRAFLAGS}|g ; s| ARCH *.= ar| ARCMD = ar|' ${WRKSRC}/Bmake.inc) (${REINPLACE_CMD} -e 's|@WRKSRC@|${WRKSRC_SHARED}|g ; s|@DEBUG_LEVEL@|${DEBUG_LEVEL}|g ; s|@LOCALBASE@|${LOCALBASE}|g ; s|@CC@|${CC}|g ; s|@CFLAGS@|${CFLAGS_SHARED}|g ; s|@F77@|${F77}|g ; s|@FFLAGS@|${FFLAGS_SHARED}|g ; s|@F77EXTRAFLAGS@|${F77EXTRAFLAGS}|g ; s| ARCH *.= ar| ARCMD = ar|' ${WRKSRC_SHARED}/Bmake.inc) ${REINPLACE_CMD} -e 's|\$$(ARCH)|$$(ARCMD)|' ${WRKSRC}/SRC/MPI/Makefile ${REINPLACE_CMD} -e 's|\$$(ARCH)|$$(ARCMD)|' ${WRKSRC_SHARED}/SRC/MPI/Makefile do-build: (cd ${WRKSRC}; make mpi; make tester) (cd ${WRKSRC_SHARED}; make mpi; make tester) post-build: ${RM} -r ${WRKDIR}/tmp_shared ${MKDIR} ${WRKDIR}/tmp_shared ${MV} ${WRKSRC_SHARED}/LIB/blacs_MPI-FreeBSD-${DEBUG_LEVEL}.a ${WRKSRC_SHARED}/LIB/libblacsc.a ${MV} ${WRKSRC_SHARED}/LIB/blacsF77init_MPI-FreeBSD-${DEBUG_LEVEL}.a ${WRKSRC_SHARED}/LIB/libblacsf77.a ${MV} ${WRKSRC_SHARED}/LIB/blacsCinit_MPI-FreeBSD-${DEBUG_LEVEL}.a ${WRKSRC_SHARED}/LIB/libblacs.a ${FIND} ${WRKSRC_SHARED} -name "*\.a" -exec ${MV} {} ${WRKDIR}/tmp_shared \; cd ${WRKDIR}/tmp_shared ; for i in `ls *.a | ${SED} 's/\.a//' `; do \ ${LD} -Bshareable -o $${i}.so.${SVERSION} -x -soname $${i}.so.${SVERSION} --whole-archive $${i}.a ;\ ${LN} -s $${i}.so.${SVERSION} $${i}.so ;\ done do-install: ${INSTALL_DATA} ${WRKSRC}/LIB/blacsCinit_MPI-FreeBSD-${DEBUG_LEVEL}.a ${STAGEDIR}${PREFIX}/lib/libblacsc.a ${INSTALL_DATA} ${WRKSRC}/LIB/blacsF77init_MPI-FreeBSD-${DEBUG_LEVEL}.a ${STAGEDIR}${PREFIX}/lib/libblacsf77.a ${INSTALL_DATA} ${WRKSRC}/LIB/blacs_MPI-FreeBSD-${DEBUG_LEVEL}.a ${STAGEDIR}${PREFIX}/lib/libblacs.a .for lib in libblacsc libblacsf77 libblacs ${INSTALL_LIB} ${WRKDIR}/tmp_shared/${lib}.so.${SVERSION} ${STAGEDIR}${PREFIX}/lib/${lib}.so.${SVERSION} ${LN} -s ${lib}.so.${SVERSION} ${STAGEDIR}${PREFIX}/lib/${lib}.so .endfor ${MKDIR} ${STAGEDIR}${PREFIX}/share/BLACS/TESTING ( cd ${WRKSRC_SHARED}/TESTING/EXE ; \ ${INSTALL_PROGRAM} xCbtest_MPI-FreeBSD-${DEBUG_LEVEL} ${STAGEDIR}${PREFIX}/share/BLACS/TESTING/xCbtest_MPI-FreeBSD; \ ${INSTALL_PROGRAM} xFbtest_MPI-FreeBSD-${DEBUG_LEVEL} ${STAGEDIR}${PREFIX}/share/BLACS/TESTING/xFbtest_MPI-FreeBSD; \ ${INSTALL_DATA} bsbr.dat ${STAGEDIR}${PREFIX}/share/BLACS/TESTING; \ ${INSTALL_DATA} bt.dat ${STAGEDIR}${PREFIX}/share/BLACS/TESTING; \ ${INSTALL_DATA} comb.dat ${STAGEDIR}${PREFIX}/share/BLACS/TESTING; \ ${INSTALL_DATA} sdrv.dat ${STAGEDIR}${PREFIX}/share/BLACS/TESTING) .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} ${CAT} ${DISTDIR}/${DIST_SUBDIR}/blacs_install.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/blacs_install.ps.gz ${CAT} ${DISTDIR}/${DIST_SUBDIR}/cblacsqref.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/cblacsqref.ps.gz ${CAT} ${DISTDIR}/${DIST_SUBDIR}/f77blacsqref.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/f77blacsqref.ps.gz ${CAT} ${DISTDIR}/${DIST_SUBDIR}/lawn94.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/lawn94.ps.gz ${CAT} ${DISTDIR}/${DIST_SUBDIR}/mpi_prop.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/mpi_prop.ps.gz ${CAT} ${DISTDIR}/${DIST_SUBDIR}/mpiblacs_issues.ps | ${GZIP_CMD} > ${STAGEDIR}${DOCSDIR}/mpiblacs_issues.ps.gz .endif .include diff --git a/math/blacs/files/Bmake.inc-mpich.diff b/math/blacs/files/Bmake.inc-mpich.diff index 5224616e5cc8..3e30b122de6f 100644 --- a/math/blacs/files/Bmake.inc-mpich.diff +++ b/math/blacs/files/Bmake.inc-mpich.diff @@ -1,74 +1,74 @@ --- Bmake.inc.orig 2000-02-25 01:22:28.000000000 +0100 +++ Bmake.inc 2014-08-22 23:50:32.000000000 +0200 @@ -13,7 +13,7 @@ # ----------------------------- # The top level BLACS directory # ----------------------------- - BTOPdir = $(HOME)/BLACS + BTOPdir = @WRKSRC@ # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. @@ -32,14 +32,14 @@ # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- - PLAT = LINUX + PLAT = FreeBSD # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB - BLACSDBGLVL = 0 + BLACSDBGLVL = @DEBUG_LEVEL@ BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a @@ -47,10 +47,10 @@ # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- - MPIdir = /usr/local/mpich + MPIdir = @LOCALBASE@ MPILIBdir = $(MPIdir)/lib/ MPIINCdir = $(MPIdir)/include - MPILIB = $(MPILIBdir)/libmpich.a -+ MPILIB = -lmpi -lmpifort -pthread ++ MPILIB = -lmpi -lmpifort -pthread -L$(MPILIBdir) # ------------------------------------- # All libraries required by the tester. @@ -93,7 +93,7 @@ # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- - INTFACE = -Df77IsF2C + INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies @@ -195,16 +195,15 @@ # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= - F77 = g77 - F77NO_OPTFLAGS = - F77FLAGS = $(F77NO_OPTFLAGS) -O - F77LOADER = $(F77) - F77LOADFLAGS = - CC = gcc - CCFLAGS = -O4 + F77 = @F77@ + F77NO_OPTFLAGS = @F77EXTRAFLAGS@ + F77FLAGS = @FFLAGS@ + F77LOADER = @F77@ + F77LOADFLAGS = @FFLAGS@ + CC = @CC@ + CCFLAGS = @CFLAGS@ CCLOADER = $(CC) CCLOADFLAGS = - # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. diff --git a/math/blacs/files/patch-SRC_MPI_Bdef.h b/math/blacs/files/patch-SRC_MPI_Bdef.h index 75a6acbe5696..adcdd43918c2 100644 --- a/math/blacs/files/patch-SRC_MPI_Bdef.h +++ b/math/blacs/files/patch-SRC_MPI_Bdef.h @@ -1,14 +1,30 @@ ---- SRC/MPI/Bdef.h.orig 2020-04-21 20:22:36 UTC +--- SRC/MPI/Bdef.h.orig 1998-03-13 20:14:33 UTC +++ SRC/MPI/Bdef.h -@@ -1605,9 +1605,9 @@ int BI_ContxtNum(); +@@ -322,6 +322,15 @@ int BI_ContxtNum(BLACSCONTEXT *ctxt); + void BI_BlacsWarn(int ConTxt, int line, char *file, char *form, ...); + void BI_BlacsErr(int ConTxt, int line, char *file, char *form, ...); + int BI_ContxtNum(BLACSCONTEXT *ctxt); ++void BI_TransDist(BLACSCONTEXT *ctxt, char scope, int m, int n, int *rA, ++ int *cA, int ldrc, BI_DistType *dist, int rdest, int cdest); ++void BI_dmvcopy(int m, int n, double *A, int lda, double *buff); ++void BI_dvmcopy(int m, int n, double *A, int lda, double *buff); ++void BI_imvcopy(int m, int n, int *A, int lda, int *buff); ++void BI_ivmcopy(int m, int n, int *A, int lda, int *buff); ++void BI_smvcopy(int m, int n, float *A, int lda, float *buff); ++void BI_svmcopy(int m, int n, float *A, int lda, float *buff); ++void Cblacs_pinfo(int *mypnum, int *nprocs); + #else + void BI_BlacsWarn(); + void BI_BlacsErr(); +@@ -1605,9 +1614,9 @@ int BI_ContxtNum(); #else #define BI_MPI_Type_struct(count_, lens_, disps_, types_, newtype_, ierr_) \ { \ - (ierr_) = MPI_Type_struct((count_), (lens_), (disps_), (types_), \ + (ierr_) = MPI_Type_create_struct((count_), (lens_), (disps_), (types_), \ (newtype_)); \ - Mmpierror((ierr_), "MPI_Type_struct", NULL, __LINE__, __FILE__); \ + Mmpierror((ierr_), "MPI_Type_create_struct", NULL, __LINE__, __FILE__); \ } #endif diff --git a/math/blacs/files/patch-SRC_MPI_blacs__get__.c b/math/blacs/files/patch-SRC_MPI_blacs__get__.c new file mode 100644 index 000000000000..02f1b33c989e --- /dev/null +++ b/math/blacs/files/patch-SRC_MPI_blacs__get__.c @@ -0,0 +1,11 @@ +--- SRC/MPI/blacs_get_.c.orig 2006-01-18 21:36:03 UTC ++++ SRC/MPI/blacs_get_.c +@@ -12,6 +12,8 @@ F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *va + #else + int comm; + #endif ++ void BI_MPI_C_to_f77_trans_comm(MPI_Comm, int *); ++ void BI_MPI_F77_to_c_trans_comm(int F77comm, MPI_Comm *Ccomm); + BLACSCONTEXT *ctxt; + + switch( Mpval(what) ) diff --git a/math/blacs/files/patch-SRC_MPI_blacs__gridinit__.c b/math/blacs/files/patch-SRC_MPI_blacs__gridinit__.c new file mode 100644 index 000000000000..6c102072a27b --- /dev/null +++ b/math/blacs/files/patch-SRC_MPI_blacs__gridinit__.c @@ -0,0 +1,15 @@ +--- SRC/MPI/blacs_gridinit_.c.orig 2006-01-18 21:36:03 UTC ++++ SRC/MPI/blacs_gridinit_.c +@@ -6,7 +6,12 @@ F_VOID_FUNC blacs_gridinit_(int *ConTxt, F_CHAR order, + F_VOID_FUNC blacs_gridinit_(int *ConTxt, F_CHAR order, int *nprow, int *npcol) + #endif + { ++#if (INTFACE == C_CALL) + void Cblacs_gridmap(int *, int *, int, int, int); ++#else ++ F_VOID_FUNC blacs_gridmap_(int *ConTxt, int *usermap, int *ldup, int *nprow0, ++ int *npcol0); ++#endif + int *tmpgrid, *iptr; + int i, j; + diff --git a/math/blacs/files/patch-SRC_MPI_blacs__pinfo__.c b/math/blacs/files/patch-SRC_MPI_blacs__pinfo__.c new file mode 100644 index 000000000000..5d6f5111549a --- /dev/null +++ b/math/blacs/files/patch-SRC_MPI_blacs__pinfo__.c @@ -0,0 +1,11 @@ +--- SRC/MPI/blacs_pinfo_.c.orig 1998-03-13 20:16:27 UTC ++++ SRC/MPI/blacs_pinfo_.c +@@ -1,5 +1,8 @@ + #include "Bdef.h" + ++void bi_f77_init_(void); ++void bi_f77_get_constants_(int*, int*, int*); ++ + #if (INTFACE == C_CALL) + void Cblacs_pinfo(int *mypnum, int *nprocs) + #else