git: d3f13fc91cf0 - main - science/axom: Add options LUA MFEM MPI OPENMP; Simplify tests

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 21 Aug 2022 10:11:43 UTC
The branch main has been updated by yuri:

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

commit d3f13fc91cf0c08177b8a1731b053be89145b39a
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-08-21 10:10:56 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-08-21 10:11:41 +0000

    science/axom: Add options LUA MFEM MPI OPENMP; Simplify tests
---
 science/axom/Makefile                              | 34 +++++++++++++++++-----
 .../files/patch-cmake_thirdparty_FindLUA.cmake     | 24 +++++++++++++++
 science/axom/pkg-plist                             | 23 +++++++++++++++
 3 files changed, 73 insertions(+), 8 deletions(-)

diff --git a/science/axom/Makefile b/science/axom/Makefile
index f88950d32194..bea2ec1af391 100644
--- a/science/axom/Makefile
+++ b/science/axom/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	axom
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.6.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	science
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -20,7 +20,7 @@ LIB_DEPENDS=	libconduit.so:science/conduit \
 		libsz.so:science/libaec
 RUN_DEPENDS=	sparsehash>0:devel/sparsehash
 
-USES=		cmake compiler:c++11-lang
+USES=		cmake:testing compiler:c++11-lang
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	LLNL
@@ -30,8 +30,10 @@ GH_TUPLE=	LLNL:axom_data:b3d8e6f:axom_data/../data \
 
 CMAKE_OFF=	AXOM_ENABLE_DOCS AXOM_ENABLE_EXAMPLES AXOM_ENABLE_TESTS FREEBSD_ENABLE_EXAMPLES
 CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_TESTING_ON=	AXOM_ENABLE_TESTS
 CMAKE_ARGS=	-DCONDUIT_DIR=${LOCALBASE} \
-		-DHDF5_DIR=${LOCALBASE}
+		-DHDF5_DIR=${LOCALBASE} \
+		-DBLT_CXX_STD=c++14 # BLT_CXX_STD=c++14 is required for LLNL/serac
 
 LDFLAGS+=	-lexecinfo
 
@@ -39,13 +41,29 @@ WRKSRC_SUBDIR=	src
 
 CONFLICTS_INSTALL=	libfmt # bundles and installs an incompatible libfmt version: https://github.com/LLNL/axom/issues/561, axom headers include fmt unnecessarily
 
+OPTIONS_DEFINE=		LUA MFEM MPI OPENMP
+OPTIONS_DEFAULT=	LUA MFEM MPI #OPENMP     LUA,MFEM,MPI are required for LLNL/serac
+OPTIONS_SUB=		yes
+
+LUA_USES=		lua:54
+LUA_CMAKE_ON=		-DLUA_DIR=${LUA_BASE} \
+			-DFREEBSD_LUA_VER_STR=${LUA_VER_STR} \
+			-DFREEBSD_LUA_VER=${LUA_VER}
+
+MFEM_DESC=		Use mfem - library for finite element methods
+MFEM_CMAKE_ON=		-DMFEM_DIR=${LOCALBASE}
+MFEM_LIB_DEPENDS=	libmfem.so:math/mfem
+
+MPI_CMAKE_BOOL=		ENABLE_MPI
+MPI_BUILD_DEPENDS=	openmpi>0:net/openmpi
+MPI_RUN_DEPENDS=	openmpi>0:net/openmpi
+
+OPENMP_CMAKE_BOOL=	ENABLE_OPENMP
+OPENMP_BROKEN=		https://github.com/LLNL/axom/issues/911
+
 post-install: # installs headers of a third party library sparsehash: https://github.com/LLNL/axom/issues/365
 	@${RM} -r ${STAGEDIR}${PREFIX}/include/sparsehash
 
-do-test:
-	@cd ${BUILD_WRKSRC} && \
-		${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DAXOM_ENABLE_TESTS:BOOL=ON ${CMAKE_SOURCE_PATH} && \
-		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
-		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test
+# 2 tests are known to fail, see https://github.com/LLNL/axom/issues/912
 
 .include <bsd.port.mk>
diff --git a/science/axom/files/patch-cmake_thirdparty_FindLUA.cmake b/science/axom/files/patch-cmake_thirdparty_FindLUA.cmake
new file mode 100644
index 000000000000..50702987762e
--- /dev/null
+++ b/science/axom/files/patch-cmake_thirdparty_FindLUA.cmake
@@ -0,0 +1,24 @@
+- Lua related path adjustments
+
+--- cmake/thirdparty/FindLUA.cmake.orig	2022-08-21 08:14:54 UTC
++++ cmake/thirdparty/FindLUA.cmake
+@@ -23,7 +23,7 @@ endif()
+ # Find includes directory
+ find_path( LUA_INCLUDE_DIR lua.hpp
+            PATHS  ${LUA_DIR}/include/
+-                  ${LUA_DIR}/include/lua
++                  ${LUA_DIR}/include/lua${FREEBSD_LUA_VER_STR}
+            NO_DEFAULT_PATH
+            NO_CMAKE_ENVIRONMENT_PATH
+            NO_CMAKE_PATH
+@@ -31,8 +31,8 @@ find_path( LUA_INCLUDE_DIR lua.hpp
+            NO_CMAKE_SYSTEM_PATH)
+ 
+ # Find libraries
+-find_library( LUA_LIBRARY NAMES lua liblua
+-              PATHS ${LUA_DIR}/lib
++find_library( LUA_LIBRARY NAMES lua-${FREEBSD_LUA_VER} liblua
++	PATHS ${LUA_DIR}/lib
+               NO_DEFAULT_PATH
+               NO_CMAKE_ENVIRONMENT_PATH
+               NO_CMAKE_PATH
diff --git a/science/axom/pkg-plist b/science/axom/pkg-plist
index 00f1e37e0cde..0e65c4994e67 100644
--- a/science/axom/pkg-plist
+++ b/science/axom/pkg-plist
@@ -1,3 +1,5 @@
+%%MPI%%bin/convert_sidre_protocol
+%%MFEM%%bin/data_collection_util
 bin/mesh_tester
 include/axom/CLI11.hpp
 include/axom/config.hpp
@@ -65,6 +67,7 @@ include/axom/inlet/Inlet.hpp
 include/axom/inlet/InletVector.hpp
 include/axom/inlet/JSONReader.hpp
 include/axom/inlet/JSONSchemaWriter.hpp
+%%LUA%%include/axom/inlet/LuaReader.hpp
 include/axom/inlet/Proxy.hpp
 include/axom/inlet/Reader.hpp
 include/axom/inlet/SphinxWriter.hpp
@@ -83,6 +86,15 @@ include/axom/klee/KleeError.hpp
 include/axom/klee/Shape.hpp
 include/axom/klee/ShapeSet.hpp
 include/axom/klee/Units.hpp
+%%MPI%%include/axom/lumberjack.hpp
+%%MPI%%include/axom/lumberjack/BinaryTreeCommunicator.hpp
+%%MPI%%include/axom/lumberjack/Combiner.hpp
+%%MPI%%include/axom/lumberjack/Communicator.hpp
+%%MPI%%include/axom/lumberjack/Lumberjack.hpp
+%%MPI%%include/axom/lumberjack/MPIUtility.hpp
+%%MPI%%include/axom/lumberjack/Message.hpp
+%%MPI%%include/axom/lumberjack/RootCommunicator.hpp
+%%MPI%%include/axom/lumberjack/TextEqualityCombiner.hpp
 include/axom/mint.hpp
 include/axom/mint/config.hpp
 include/axom/mint/deprecated/MCArray.hpp
@@ -169,8 +181,11 @@ include/axom/quest.hpp
 include/axom/quest/AllNearestNeighbors.hpp
 include/axom/quest/Discretize.hpp
 include/axom/quest/InOutOctree.hpp
+%%MFEM%%include/axom/quest/IntersectionShaper.hpp
 include/axom/quest/MeshTester.hpp
 include/axom/quest/PointInCell.hpp
+%%MFEM%%include/axom/quest/SamplingShaper.hpp
+%%MFEM%%include/axom/quest/Shaper.hpp
 include/axom/quest/SignedDistance.hpp
 include/axom/quest/detail/AllNearestNeighbors_detail.hpp
 include/axom/quest/detail/Discretize_detail.hpp
@@ -181,10 +196,12 @@ include/axom/quest/detail/inout/InOutOctreeMeshDumper.hpp
 include/axom/quest/detail/inout/InOutOctreeStats.hpp
 include/axom/quest/detail/inout/InOutOctreeValidator.hpp
 include/axom/quest/detail/inout/MeshWrapper.hpp
+%%MFEM%%include/axom/quest/detail/shaping/shaping_helpers.hpp
 include/axom/quest/interface/inout.hpp
 include/axom/quest/interface/internal/QuestHelpers.hpp
 include/axom/quest/interface/internal/mpicomm_wrapper.hpp
 include/axom/quest/interface/signed_distance.hpp
+%%MPI%%include/axom/quest/readers/PSTLReader.hpp
 include/axom/quest/readers/STLReader.hpp
 include/axom/sidre.hpp
 include/axom/sidre/core/Array.hpp
@@ -196,11 +213,14 @@ include/axom/sidre/core/Group.hpp
 include/axom/sidre/core/ItemCollection.hpp
 include/axom/sidre/core/Iterator.hpp
 include/axom/sidre/core/ListCollection.hpp
+%%MFEM%%include/axom/sidre/core/MFEMSidreDataCollection.hpp
 include/axom/sidre/core/MapCollection.hpp
 include/axom/sidre/core/SidreDataTypeIds.h
 include/axom/sidre/core/SidreTypes.hpp
 include/axom/sidre/core/View.hpp
 include/axom/sidre/core/sidre.hpp
+%%MPI%%include/axom/sidre/spio/IOBaton.hpp
+%%MPI%%include/axom/sidre/spio/IOManager.hpp
 include/axom/slam.hpp
 include/axom/slam/BitSet.hpp
 include/axom/slam/BivariateMap.hpp
@@ -241,6 +261,9 @@ include/axom/slic/interface/slic.hpp
 include/axom/slic/interface/slic_macros.hpp
 include/axom/slic/internal/stacktrace.hpp
 include/axom/slic/streams/GenericOutputStream.hpp
+%%MPI%%include/axom/slic/streams/LumberjackStream.hpp
+%%MPI%%include/axom/slic/streams/SynchronizedStream.hpp
+%%LUA%%include/axom/sol.hpp
 include/axom/sparsehash/README
 include/axom/sparsehash/dense_hash_map
 include/axom/sparsehash/dense_hash_set