new package: Percept (#6636)

This also adds the 'exception' boost library to the set of default
libraries built by boost.
This commit is contained in:
Jon Rood 2017-12-14 19:11:47 -07:00 committed by scheibelp
parent 020ce7735d
commit 7369ba21bf
4 changed files with 151 additions and 0 deletions

View file

@ -91,6 +91,7 @@ class Boost(Package):
default_install_libs = set(['atomic',
'chrono',
'date_time',
'exception',
'filesystem',
'graph',
'iostreams',
@ -339,6 +340,8 @@ def install(self, spec, prefix):
withLibs.remove('chrono')
if not spec.satisfies('@1.43.0:'):
withLibs.remove('random')
if not spec.satisfies('@1.39.0:'):
withLibs.remove('exception')
if '+graph' in spec and '+mpi' in spec:
withLibs.append('graph_parallel')

View file

@ -0,0 +1,54 @@
--- percept.orig/CMakeLists.txt 2017-12-08 09:16:41.572819000 -0700
+++ percept/CMakeLists.txt 2017-12-08 09:17:25.028818000 -0700
@@ -97,13 +97,6 @@
SET (INSTALL_PERCEPT TRUE)
ENDIF()
-IF (INSTALL_PERCEPT)
- set(BINARY_INSTALL_DIR bin)
- set(INCLUDE_INSTALL_DIR include)
- set(LIB_INSTALL_DIR lib)
- INCLUDE(CMakePackageConfigHelpers)
-ENDIF ()
-
MESSAGE("Setting and checking of compilers:")
SET(CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER} )
SET(CMAKE_C_COMPILER ${Trilinos_C_COMPILER} )
@@ -269,6 +262,8 @@
FILE (GLOB ADAPT_SOURCE src/adapt/main/*.cpp)
MESSAGE("-- ADAPT_SOURCE = ${ADAPT_SOURCE}")
+file(GLOB TRANSFER_SOURCE src/percept/mesh_transfer/*.cpp)
+
FILE (GLOB PERCEPT_UTEST_SOURCE test/unit_tests/*.cpp)
MESSAGE("-- PERCEPT_UTEST_SOURCE = ${PERCEPT_UTEST_SOURCE}")
@@ -330,8 +325,11 @@
TARGET_LINK_LIBRARIES(${percept_lib_name} ${Trilinos_LIBRARIES} ${YAML_LIBRARY} ${OPENNURBS_LIBRARY} ${BOOST_LIBRARIES})
# TARGET_LINK_LIBRARIES(${percept_lib_name} ${GTEST_LIBRARY})
+ add_executable(mesh_transfer ${TRANSFER_SOURCE})
+ target_link_libraries(mesh_transfer ${percept_lib_name})
+
SET_PROPERTY(
- TARGET ${percept_lib_name} ${adapt_ex_name} ${percept_utest_name} ${percept_rtest_name}
+ TARGET ${percept_lib_name} mesh_transfer ${adapt_ex_name} ${percept_utest_name} ${percept_rtest_name}
PROPERTY COMPILE_DEFINITIONS STK_PERCEPT_LITE=0 STK_PERCEPT_HAS_GEOMETRY STK_PERCEPT_USE_INTREPID
)
@@ -342,5 +340,15 @@
ENDIF()
+IF (INSTALL_PERCEPT)
+ install(TARGETS ${percept_ex_name} ${adapt_ex_name}
+ ${percept_htest_name} ${percept_rtest_name} ${percept_utest_name}
+ mesh_transfer percept
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
+ #install(DIRECTORY include/ DESTINATION include)
+ include(CMakePackageConfigHelpers)
+ENDIF ()
MESSAGE("\nAnd CMake says...:")

View file

@ -0,0 +1,19 @@
--- percept.orig/src/percept/MeshType.hpp 2017-12-08 09:16:42.080818000 -0700
+++ percept/src/percept/MeshType.hpp 2017-12-08 09:17:25.568819000 -0700
@@ -11,6 +11,7 @@
#include <percept/Percept.hpp>
#include <array>
+#include <memory>
#include <stk_mesh/base/Field.hpp>
#include <stk_mesh/base/Entity.hpp>
#include <stk_mesh/base/Bucket.hpp>
@@ -62,7 +63,7 @@
typedef Kokkos::LayoutRight SecondaryDataLayout;
#endif
- #elif KOKKOS_HAVE_OPENMP
+ #elif defined(KOKKOS_HAVE_OPENMP)
typedef Kokkos::OpenMP ExecSpace;
typedef Kokkos::OpenMP MemSpace;
typedef Kokkos::LayoutLeft DataLayout;

View file

@ -0,0 +1,75 @@
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class Percept(CMakePackage):
"""Parallel mesh refinement and adaptivity tools for the finite
element method.
"""
homepage = "https://github.com/PerceptTools/percept"
url = "https://github.com/PerceptTools/percept.git"
# This package file was created at percept
# commit dc1c8ec0175213146ac139946beca185a84c22e8
version('develop',
git='https://github.com/PerceptTools/percept.git', branch='master')
depends_on('googletest')
depends_on('opennurbs@percept')
depends_on('boost+graph+mpi')
depends_on('yaml-cpp+pic~shared@0.5.3:')
# Percept was initially tested against Trilinos 12.12.1
depends_on('trilinos~shared+exodus+tpetra+epetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+aztec+sacado~openmp+shards+intrepid+cgns@master,12.12.1:')
patch('fix_cmakelists.patch')
patch('fix_header.patch')
def cmake_args(self):
spec = self.spec
options = []
options.extend([
'-DSTK_PERCEPT_LITE:BOOL=OFF',
'-DSTK_ADAPT_HAVE_YAML_CPP:BOOL=ON',
'-DTrilinos_DIR:PATH=%s' %
spec['trilinos'].prefix,
'-DYAML_DIR:PATH=%s' %
spec['yaml-cpp'].prefix,
'-DBOOST_DIR:PATH=%s' %
spec['boost'].prefix,
'-DOPENNURBS_DIR:PATH=%s' %
spec['opennurbs'].prefix,
'-DOPENNURBS_INCLUDE_DIR:PATH=%s' %
spec['opennurbs'].prefix.include,
'-DOPENNURBS_LIBRARY_DIR:PATH=%s' %
spec['opennurbs'].prefix.lib,
'-DPERCEPT_TPLS_INSTALL_DIR:PATH=%s' %
spec['googletest'].prefix,
'-DENABLE_INSTALL:BOOL=ON'
])
return options