git: 7f9cd79566fd - main - math/sundials: Multiple changes

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 29 Jun 2022 06:11:20 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f9cd79566fd1f8d159b25ee9bf4678af1fadc39

commit 7f9cd79566fd1f8d159b25ee9bf4678af1fadc39
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-06-29 06:05:06 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-06-29 06:11:17 +0000

    math/sundials: Multiple changes
    
    - add -DCMAKE_C_STANDARD=99 to CMAKE_ARGS; this fixes the LAPACK option
    - remove -DSUNDIALS_INDEX_TYPE:STRING=int64_t, since this is
      automatically determined based on SUNDIALS_INDEX_SIZE which defaults
      to 64 bits. SUNDIALS_INDEX_TYPE has been deprecated with release 3.2.0
    - make LAPACK default
    - remove LAPACK_BROKEN
    - remove {BLAS,LAPACK}_CMAKE_ON, since CMake warns during configuring
      that FREEBSD_GCC_DIR is not used
    - reenable OPENMP option
    - replace BLAS_ENABLE with ENABLE_BLAS; this silences a warning
    - switch the MPI option to CMAKE_BOOL
    - add HYPRE_BROKEN, since configure errors out when trying to build with hypre support
    
    PR:             260771
    Original patch submitted by:     Philipp Ost <bsd@philippost.de>
---
 math/sundials/Makefile  | 19 ++++++++++---------
 math/sundials/pkg-plist | 10 ++++++----
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/math/sundials/Makefile b/math/sundials/Makefile
index 2649cccb2c2d..44916c08392b 100644
--- a/math/sundials/Makefile
+++ b/math/sundials/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	sundials
 DISTVERSION=	6.2.0
+PORTREVISION=	1
 CATEGORIES=	math
 MASTER_SITES=	https://github.com/LLNL/sundials/releases/download/v${DISTVERSION}/
 
@@ -13,24 +14,24 @@ USES=		cmake:testing fortran localbase:ldflags python:build
 USE_LDCONFIG=	yes
 
 CMAKE_ARGS=		-DENABLE_PTHREAD:BOOL=ON \
-			-DBUILD_STATIC_LIBS:BOOL=OFF
+			-DBUILD_STATIC_LIBS:BOOL=OFF \
+			-DCMAKE_C_STANDARD=99
 CMAKE_OFF=		EXAMPLES_ENABLE_C EXAMPLES_ENABLE_CXX EXAMPLES_ENABLE_F77 EXAMPLES_ENABLE_F90
 CMAKE_TESTING_ON=	SUNDIALS_TEST_UNITTESTS \
 			EXAMPLES_ENABLE_C EXAMPLES_ENABLE_CXX EXAMPLES_ENABLE_F77 EXAMPLES_ENABLE_F90
 
 FCFLAGS:=	${FFLAGS} # project checks that these flags are equal
 
-OPTIONS_DEFINE=		BLAS LAPACK MPI # OPENMP detection is broken in cmake: https://gitlab.kitware.com/cmake/cmake/issues/17474; EXAMPLES are broken on some systems due to CLOCK_MONOTONIC
-#OPTIONS_DEFAULT=	LAPACK # LAPACK is broken
+OPTIONS_DEFINE=		BLAS EXAMPLES LAPACK MPI OPENMP
+OPTIONS_DEFAULT=	LAPACK
 OPTIONS_GROUP=		VECTORS
 OPTIONS_GROUP_VECTORS=	HYPRE PETSC
 VECTORS_DESC=		Alternative vector libraries
 OPTIONS_SUB=		yes
 
 BLAS_DESC=		Enable BLAS support
-BLAS_CMAKE_BOOL=	BLAS_ENABLE
+BLAS_CMAKE_BOOL=	ENABLE_BLAS
 BLAS_USES=		blaslapack:openblas
-BLAS_CMAKE_ON=		-DFREEBSD_GCC_DIR:STRING=${LOCALBASE}/lib/gcc${GCC_DEFAULT:S/.//} # assumes that fortran:gcc is used
 
 #EXAMPLES_CMAKE_BOOL=	EXAMPLES_ENABLE_C EXAMPLES_ENABLE_CXX EXAMPLES_ENABLE_F77 EXAMPLES_ENABLE_F90
 #EXAMPLES_CMAKE_ON=	-DEXAMPLES_INSTALL_PATH=${EXAMPLESDIR}
@@ -43,17 +44,17 @@ HYPRE_CMAKE_ON=		-DHYPRE_INCLUDE_DIR=${LOCALBASE}/include \
 HYPRE_LIB_DEPENDS=	libHYPRE.so:science/hypre # maybe is broken due to https://github.com/hypre-space/hypre/issues/464
 HYPRE_IMPLIES=		MPI
 HYPRE_PREVENTS=		LAPACK  # error: Incompatible sunindextype for LAPACK; disable LAPACK and rebuild
+HYPRE_BROKEN=		ERROR: SUNDIALS interface to HYPRE is not functional.
 
 LAPACK_DESC=		Use Lapack linear algebra (sets SUNDIALS_INDEX_TYPE=int32)
 LAPACK_USES=		blaslapack:openblas
 LAPACK_CMAKE_BOOL=	ENABLE_LAPACK
-LAPACK_CMAKE_ON=	-DSUNDIALS_INDEX_TYPE:STRING=int64_t \
-			-DFREEBSD_GCC_DIR:STRING=${LOCALBASE}/lib/gcc${GCC_DEFAULT:S/.//} # assumes that fortran:gcc is used
-LAPACK_BROKEN=		Ignores LDFLAGS and fails to find lapack: https://github.com/LLNL/sundials/issues/74
 
-MPI_CMAKE_ON=		-DMPI_ENABLE:BOOL=ON
+MPI_CMAKE_BOOL=		ENABLE_MPI
 MPI_LIB_DEPENDS=	libmpich.so:net/mpich
 
+OPENMP_CMAKE_BOOL=	ENABLE_OPENMP
+
 PETSC_DESC=		PETSc vectors support (also enables MPI)
 PETSC_CMAKE_BOOL=	ENABLE_PETSC
 PETSC_CMAKE_ON=		-DPETSC_DIR=${LOCALBASE} \
diff --git a/math/sundials/pkg-plist b/math/sundials/pkg-plist
index 87960a1f948c..0d167a1df2d1 100644
--- a/math/sundials/pkg-plist
+++ b/math/sundials/pkg-plist
@@ -42,6 +42,7 @@ include/kinsol/kinsol_spils.h
 include/nvector/nvector_manyvector.h
 %%MPI%%include/nvector/nvector_mpimanyvector.h
 %%MPI%%include/nvector/nvector_mpiplusx.h
+%%OPENMP%%include/nvector/nvector_openmp.h
 %%MPI%%include/nvector/nvector_parallel.h
 %%HYPRE%%include/nvector/nvector_parhyp.h
 %%PETSC%%include/nvector/nvector_petsc.h
@@ -116,6 +117,9 @@ lib/libsundials_nvecmanyvector.so.6.2.0
 %%MPI%%lib/libsundials_nvecmpiplusx.so
 %%MPI%%lib/libsundials_nvecmpiplusx.so.6
 %%MPI%%lib/libsundials_nvecmpiplusx.so.6.2.0
+%%OPENMP%%lib/libsundials_nvecopenmp.so
+%%OPENMP%%lib/libsundials_nvecopenmp.so.6
+%%OPENMP%%lib/libsundials_nvecopenmp.so.6.2.0
 %%MPI%%lib/libsundials_nvecparallel.so
 %%MPI%%lib/libsundials_nvecparallel.so.6
 %%MPI%%lib/libsundials_nvecparallel.so.6.2.0
@@ -136,11 +140,9 @@ lib/libsundials_sunlinsolband.so.4.2.0
 lib/libsundials_sunlinsoldense.so
 lib/libsundials_sunlinsoldense.so.4.2.0
 %%LAPACK%%lib/libsundials_sunlinsollapackband.so
-%%LAPACK%%lib/libsundials_sunlinsollapackband.so.%%SHLX1%%
-%%LAPACK%%lib/libsundials_sunlinsollapackband.so.%%SHLX3%%
+%%LAPACK%%lib/libsundials_sunlinsollapackband.so.4.2.0
 %%LAPACK%%lib/libsundials_sunlinsollapackdense.so
-%%LAPACK%%lib/libsundials_sunlinsollapackdense.so.%%SHLX1%%
-%%LAPACK%%lib/libsundials_sunlinsollapackdense.so.%%SHLX3%%
+%%LAPACK%%lib/libsundials_sunlinsollapackdense.so.4.2.0
 lib/libsundials_sunlinsolpcg.so
 lib/libsundials_sunlinsolpcg.so.4.2.0
 lib/libsundials_sunlinsolspbcgs.so