diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69a4049ed..a54395c3c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ name: GitHub Actions # events but only for the master branch on: push: - branches: [ master, chogan/**, kimmy/** ] + branches: [ master, chogan/**, kimmy/**, hariharan/** ] pull_request: branches: [ master ] diff --git a/.gitignore b/.gitignore index 41d6fd8aa..9c81000f7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ GTAGS .gdb_history +/cmake-build-debug/ +/.idea/ diff --git a/CMakeLists.txt b/CMakeLists.txt index e3d177164..72e2e5e26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,6 +347,7 @@ if(CMAKE_PROJECT_NAME STREQUAL HERMES) endif() if(CMAKE_PROJECT_NAME STREQUAL HERMES AND BUILD_TESTING) + find_package(Catch2 REQUIRED) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test) endif() diff --git a/ci/hermes/packages/catch2/package.py b/ci/hermes/packages/catch2/package.py new file mode 100644 index 000000000..f44136e8c --- /dev/null +++ b/ci/hermes/packages/catch2/package.py @@ -0,0 +1,56 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install catch2 +# +# You can edit this file again by typing: +# +# spack edit catch2 +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import * + + +class Catch2(CMakePackage): + + homepage = "https://github.com/catchorg/Catch2" + url = "https://github.com/catchorg/Catch2.git" + + version('2.13.3', sha256='fedc5b008f7eb574f45098e7c7138211c543f0f8ad04792090e790511697a877') + + def url_for_version(self, version): + url = "https://github.com/catchorg/Catch2/archive/v{0}.tar.gz" + return url.format(version) + + def cmake_args(self): + options = ['-DCMAKE_INSTALL_PREFIX={}'.format(self.prefix), + '-DBUILD_TESTING=OFF'] + return options + + def set_include(self,env,path): + env.append_flags('CFLAGS', '-I{}'.format(path)) + env.append_flags('CXXFLAGS', '-I{}'.format(path)) + def set_lib(self,env,path): + env.prepend_path('LD_LIBRARY_PATH', path) + env.append_flags('LDFLAGS', '-L{}'.format(path)) + def set_flags(self,env): + self.set_include(env,'{}/include'.format(self.prefix)) + self.set_include(env,'{}/include'.format(self.prefix)) + self.set_lib(env,'{}/lib'.format(self.prefix)) + self.set_lib(env,'{}/lib64'.format(self.prefix)) + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + self.set_flags(spack_env) + def setup_run_environment(self, env): + self.set_flags(env) diff --git a/ci/hermes/packages/gortools/package.py b/ci/hermes/packages/gortools/package.py new file mode 100644 index 000000000..fcda26250 --- /dev/null +++ b/ci/hermes/packages/gortools/package.py @@ -0,0 +1,69 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install rpclib +# +# You can edit this file again by typing: +# +# spack edit rpclib +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import * + + +class Gortools(Package): + + homepage = "https://developers.google.com/optimization/install/cpp" + version('8.0', sha256='ac01d7ebde157daaeb0e21ce54923a48e4f1d21faebd0b08a54979f150f909ee') + version('7.1', sha256='c4c65cb3351554d207d5bb212601ca4e9d352563cda35a283d75963739d16bbd') + version('7.2', sha256='13a4de5dba1f64e2e490394f8f63fe0a301ee55466ef65fe309ffd5100358ea8') + version('7.3', sha256='b87922b75bbcce9b2ab5da0221751a3c8c0bff54b2a1eafa951dbf70722a640e') + version('7.4', sha256='89fafb63308b012d56a6bb9b8da9dead4078755f137a4f6b3567b36a7f3ba85c') + version('7.5', sha256='fb111aaacaf89d395d62e9e871833afdcf7f168b9f004bcfc9b70a894852f808') + version('7.6', sha256='a41202ebe24e030dccaf15846bd24224eec692b523edd191596b6a15159a2d47') + version('7.7', sha256='d20eb031ea3f1b75e55e44ae6acdb674ee6fb31e7a56498be32dc83ba9bc13bd') + version('7.8', sha256='d93a9502b18af51902abd130ff5f23768fcf47e266e6d1f34b3586387aa2de68') + version('7.0', sha256='379c13c9a5ae70bf0e876763005b2d2d51fcf966882b28b1a65344f2d3d2c589') + depends_on('gflags') + depends_on('cmake') + depends_on('gcc@8.3.0') + + def url_for_version(self, version): + url = "https://github.com/google/or-tools/archive/v{}.tar.gz" + return url.format(version) + #def cmake_args(self): + # args = ['-DCMAKE_INSTALL_PREFIX={}'.format(self.prefix),'-DBUILD_DEPS:BOOL=ON'] + # return args + def install(self, spec, prefix): + options = ['prefix=%s' % prefix] + #with working_dir('spack-build', create=True): + make('third_party') + make('cc') + make('install_cc', *options) + def set_include(self,env,path): + env.append_flags('CFLAGS', '-I{}'.format(path)) + env.append_flags('CXXFLAGS', '-I{}'.format(path)) + def set_lib(self,env,path): + env.prepend_path('LD_LIBRARY_PATH', path) + env.append_flags('LDFLAGS', '-L{}'.format(path)) + def set_flags(self,env): + self.set_include(env,'{}/include'.format(self.prefix)) + self.set_include(env,'{}/include'.format(self.prefix)) + self.set_lib(env,'{}/lib'.format(self.prefix)) + self.set_lib(env,'{}/lib64'.format(self.prefix)) + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + self.set_flags(spack_env) + def setup_run_environment(self, env): + self.set_flags(env) diff --git a/ci/hermes/repo.yaml b/ci/hermes/repo.yaml new file mode 100644 index 000000000..fdd6f5fb9 --- /dev/null +++ b/ci/hermes/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: hermes diff --git a/ci/install_deps.sh b/ci/install_deps.sh index df39409c5..d3ba05043 100755 --- a/ci/install_deps.sh +++ b/ci/install_deps.sh @@ -9,6 +9,7 @@ SPACK_DIR=${INSTALL_DIR}/spack SDS_REPO_DIR=${INSTALL_DIR}/sds-repo THALLIUM_VERSION=0.8.3 GOTCHA_VERSION=develop +CATCH2_VERSION=2.13.3 echo "Installing dependencies at ${INSTALL_DIR}" mkdir -p ${INSTALL_DIR} @@ -23,15 +24,18 @@ git clone https://xgitlab.cels.anl.gov/sds/sds-repo.git ${SDS_REPO_DIR} set +x spack repo add ${SDS_REPO_DIR} +spack repo add ./ci/hermes GOTCHA_SPEC=gotcha@${GOTCHA_VERSION} spack install ${GOTCHA_SPEC} THALLIUM_SPEC="mochi-thallium~cereal@${THALLIUM_VERSION} ^mercury~boostsys" spack install ${THALLIUM_SPEC} +CATCH2_SPEC="catch2@${CATCH2_VERSION}" +spack install ${CATCH2_SPEC} SPACK_STAGING_DIR=~/spack_staging mkdir -p ${SPACK_STAGING_DIR} -spack view --verbose symlink ${SPACK_STAGING_DIR} ${THALLIUM_SPEC} ${GOTCHA_SPEC} +spack view --verbose symlink ${SPACK_STAGING_DIR} ${THALLIUM_SPEC} ${GOTCHA_SPEC} ${CATCH2_SPEC} set -x ORTOOLS_VERSION=v7.7 diff --git a/ci/install_hermes.sh b/ci/install_hermes.sh index 4c139847a..a4e3b599d 100755 --- a/ci/install_hermes.sh +++ b/ci/install_hermes.sh @@ -27,6 +27,7 @@ cmake \ -DHERMES_USE_THREAD_SANITIZER=OFF \ -DHERMES_RPC_THALLIUM=ON \ -DHERMES_DEBUG_HEAP=OFF \ + -DBUILD_TESTING=ON \ .. cmake --build . -- -j4 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aba507b76..30953d451 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -54,7 +54,7 @@ if(HERMES_HAVE_GOTCHA) add_executable(stdio_test stdio_test.c) target_link_libraries(stdio_test hermes) add_executable(mpi_test mpi_test.c) - target_link_libraries(mpi_test hermes) + target_link_libraries(mpi_test hermes MPI::MPI_CXX) endif() #------------------------------------------------------------------------------