diff --git a/math/scalapack/Makefile b/math/scalapack/Makefile index 0a5668a213eb..c9020ac6731d 100644 --- a/math/scalapack/Makefile +++ b/math/scalapack/Makefile @@ -1,98 +1,99 @@ PORTNAME= scalapack PORTVERSION= 2.2.2 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= math MAINTAINER= fortran@FreeBSD.org COMMENT= ScaLAPACK Scalable LAPACK library WWW= https://www.netlib.org/scalapack/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE CONFLICTS= elmer-mathlibs-1* USE_GITHUB= yes GH_ACCOUNT= Reference-ScaLAPACK USES= cmake fortran pathfix USE_LDCONFIG= yes CMAKE_ARGS= -DBUILD_STATIC_LIBS:BOOL=ON ARCH2FIX= PBLAS/SRC PBLAS/SRC/PBBLAS PBLAS/SRC/PTOOLS PBLAS/SRC/PTZBLAS \ REDIST/SRC SRC TOOLS TOOLS/LAPACK DATADIR= ${PREFIX}/share/${PORTNAME:tu} EXAMPLESDIR= ${PREFIX}/share/examples/${PORTNAME:tu} SUB_FILES= pkg-message PLIST_SUB= SVERSION=${SVERSION} PORTVERSION=2.2.1 VER=${PORTVERSION:R} OPTIONS_DEFINE= EXAMPLES OPTIONS_RADIO= LA MPI OPTIONS_RADIO_LA= ATLAS BLAS LA_DESC= Linear Algebra library support BLAS_DESC= LAPACK blass implementation OPTIONS_RADIO_MPI= MPICH OPENMPI OPTIONS_DEFAULT= BLAS EXAMPLES MPICH ATLAS_USES= blaslapack:atlas BLAS_USES= blaslapack:openblas MPICH_USES= mpi:mpich MPICH_CMAKE_ON= -DMPI_BASE_DIR=${LOCALBASE} OPENMPI_USES= mpi:openmpi OPENMPI_CMAKE_ON=-DMPI_BASE_DIR=${LOCALBASE}/mpi/openmpi .include BLAS= ${BLASLIB} LAPACK= ${LAPACKLIB} .if ${ARCH} == "amd64" FPIC= -fPIC .else FPIC= -fpic .endif CFLAGS+= ${FPIC} ${MPI_CFLAGS} FFLAGS+= ${FPIC} LDFLAGS+= ${MPI_LIBS} SVERSION= ${PORTVERSION:R:R} -.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) FFLAGS+= -fallow-argument-mismatch .endif # USES=fortran already forces FC to a supported fortran compiler; # assume mpicc points to a compatible compiler and force that, too. CC= ${MPICC} post-build: ${RM} -r ${WRKSRC}/CMakeFiles ${WRKSRC}/CMakeCache.txt (cd ${WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS:C|BUILD_STATIC_LIBS|BUILD_SHARED_LIBS|} ${CMAKE_SOURCE_PATH}) (cd ${WRKSRC} && ${DO_MAKE_BUILD} ${ALL_TARGET}) post-install: ${INSTALL_LIB} ${WRKSRC}/lib/libscalapack.so ${STAGEDIR}${PREFIX}/lib/libscalapack.so.${PORTVERSION:R} ${LN} -sf libscalapack.so.${PORTVERSION:R} ${STAGEDIR}${PREFIX}/lib/libscalapack.so ${LN} -sf libscalapack.so.${PORTVERSION:R} ${STAGEDIR}${PREFIX}/lib/libscalapack.so.${SVERSION} ${MKDIR} ${STAGEDIR}${PREFIX}/share/SCALAPACK/TESTING (cd ${BUILD_WRKSRC}/TESTING/ ;\ ${INSTALL_PROGRAM} x* ${STAGEDIR}${PREFIX}/share/SCALAPACK/TESTING ;\ ${INSTALL_DATA} *.dat ${STAGEDIR}${PREFIX}/share/SCALAPACK/TESTING) ${INSTALL_DATA} ${FILESDIR}/scalapack.h ${STAGEDIR}${PREFIX}/include ${INSTALL_DATA} ${WRKSRC}/PBLAS/SRC/*.h ${STAGEDIR}${PREFIX}/include post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${PREFIX}/share/examples/SCALAPACK ${INSTALL_DATA} ${FILESDIR}/Makefile ${STAGEDIR}${PREFIX}/share/examples/SCALAPACK ${INSTALL_DATA} ${FILESDIR}/example1.cc ${STAGEDIR}${PREFIX}/share/examples/SCALAPACK ${INSTALL_DATA} ${FILESDIR}/example1.f ${STAGEDIR}${PREFIX}/share/examples/SCALAPACK do-test: (cd ${BUILD_WRKSRC}/TESTING && ${MAKE_CMD} test) .include diff --git a/math/scalapack/files/patch-BLACS_SRC_Bdef.h b/math/scalapack/files/patch-BLACS_SRC_Bdef.h new file mode 100644 index 000000000000..7845091f1e18 --- /dev/null +++ b/math/scalapack/files/patch-BLACS_SRC_Bdef.h @@ -0,0 +1,18 @@ +--- BLACS/SRC/Bdef.h.orig 2024-08-06 11:44:11 UTC ++++ BLACS/SRC/Bdef.h +@@ -129,6 +129,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); + + /* + * If we've got an ANSI standard C compiler, we can use void pointers... diff --git a/math/scalapack/files/patch-BLACS_SRC_blacs__init__.c b/math/scalapack/files/patch-BLACS_SRC_blacs__init__.c new file mode 100644 index 000000000000..642edde152d9 --- /dev/null +++ b/math/scalapack/files/patch-BLACS_SRC_blacs__init__.c @@ -0,0 +1,15 @@ +--- BLACS/SRC/blacs_init_.c.orig 2024-08-06 11:44:11 UTC ++++ BLACS/SRC/blacs_init_.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/scalapack/files/patch-CMakeLists.txt b/math/scalapack/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..133cf6b18859 --- /dev/null +++ b/math/scalapack/files/patch-CMakeLists.txt @@ -0,0 +1,10 @@ +--- CMakeLists.txt.orig 2025-09-05 14:39:41 UTC ++++ CMakeLists.txt +@@ -239,6 +239,7 @@ if (NOT MSVC) + append_subdir_files(src-C "SRC") + + if (NOT MSVC) ++ set_source_files_properties(TOOLS/SL_gridreshape.c PROPERTIES COMPILE_OPTIONS "-Wno-error=implicit-function-declaration") + add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C}) + set_target_properties(scalapack PROPERTIES + VERSION ${SCALAPACK_VERSION} diff --git a/math/scalapack/files/patch-gridmap b/math/scalapack/files/patch-gridmap new file mode 100644 index 000000000000..f442271f2045 --- /dev/null +++ b/math/scalapack/files/patch-gridmap @@ -0,0 +1,120 @@ +--- REDIST/SRC/pcgemr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pcgemr.c +@@ -194,6 +194,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pctrmr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pctrmr.c +@@ -209,6 +209,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pdgemr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pdgemr.c +@@ -191,6 +191,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pdtrmr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pdtrmr.c +@@ -206,6 +206,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pigemr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pigemr.c +@@ -191,6 +191,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pitrmr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pitrmr.c +@@ -206,6 +206,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/psgemr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/psgemr.c +@@ -191,6 +191,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pstrmr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pstrmr.c +@@ -206,6 +206,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pzgemr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pzgemr.c +@@ -194,6 +194,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- REDIST/SRC/pztrmr.c.orig 2024-08-06 11:44:11 UTC ++++ REDIST/SRC/pztrmr.c +@@ -209,6 +209,7 @@ extern void Cblacs_gridinit(); + extern void Cblacs_pinfo(); + extern void Cblacs_gridinfo(); + extern void Cblacs_gridinit(); ++extern void Cblacs_gridmap(); + extern void Cblacs_exit(); + extern void Cblacs_gridexit(); + extern void Cblacs_setup(); +--- SRC/pcrot.c.orig 2024-08-06 11:44:11 UTC ++++ SRC/pcrot.c +@@ -190,6 +190,7 @@ void pcrot_( Int *n, complex X[], Int *ix, Int *jx, In + F_INTG_FCT pbctrnv_(); + F_INTG_FCT crot_(); + F_INTG_FCT ilcm_(); ++ Int numroc_( Int*, Int*, Int*, Int*, Int* ); + /* .. + * .. Executable Statements .. + * +--- SRC/pzrot.c.orig 2024-08-06 11:44:11 UTC ++++ SRC/pzrot.c +@@ -190,6 +190,7 @@ void pzrot_( Int *n, complex16 X[], Int *ix, Int *jx, + F_INTG_FCT pbztrnv_(); + F_INTG_FCT zrot_(); + F_INTG_FCT ilcm_(); ++ Int numroc_( Int*, Int*, Int*, Int*, Int* ); + /* .. + * .. Executable Statements .. + *