Commit 5c61994a authored by Kim, Jungwon's avatar Kim, Jungwon

Modifying CMakeLists.txt to support spack

parent 296f5ac0
cmake_minimum_required(VERSION 2.8)
find_package(MPI REQUIRED)
cmake_minimum_required(VERSION 3.8)
project(PAPYRUS)
......@@ -8,7 +6,15 @@ set(PAPYRUS_VERSION_MAJOR 1)
set(PAPYRUS_VERSION_MINOR 0)
set(PAPYRUS_VERSION_PATCH 0)
include(conf/default.cmake)
find_package(MPI REQUIRED)
if("${MPI_C_COMPILER}")
set(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
endif()
if("${MPI_CXX_COMPILER}")
set(CMAKE_CXX_COMPILER "${MPI_CXX_COMPILER}")
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(CTest)
......
......@@ -5,35 +5,28 @@ Papyrus is a programming system that provides features for scalable, aggregate,
- C++11 compiler
- MPI library supporting MPI\_THREAD\_MULTIPLE
- CMake (>=2.8)
- CMake (>=3.8)
## Installation
You can download Papyrus from the code.ornl.gov.
You can download Papyrus from the code.ornl.gov:
$ git clone https://code.ornl.gov/eck/papyrus.git
$ cd papyrus
To compile the code, CMake reads a user-defined configuration file stored in conf/ directory. One needs first to modify the conf/default.cmake file accordingly. The sample configuration files for OLCF's Summitdev, NERSC's Cori, TACC's Stampede2, and ALCF's Theta are included in the directory.
set(CMAKE_C_COMPILER "mpicc")
set(CMAKE_CXX_COMPILER "mpic++")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "-O2 -std=c++11")
set(MPIEXEC "mpirun")
set(MPIEXEC_NUMPROC_FLAG "-n")
You can build Papyrus with CMake and Make:
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=<install_dir> ..
$ cmake .. -DCMAKE_INSTALL_PREFIX=<install_dir>
or if you want to run tests after build
$ cmake .. -DCMAKE_INSTALL_PREFIX=<install_dir> -DMPIEXEC=<mpiexec_path> -DMPIEXEC_NUMPROC_FLAG=<np_flag>
$ make
$ make install
### Running tests
For the Cray MPI Library, an environment variable MPICH\_MAX\_THREAD\_SAFETY has to be set to multiple.
For the Cray MPI Library, an environment variable MPICH\_MAX\_THREAD\_SAFETY has to be set to multiple:
$ export MPICH_MAX_THREAD_SAFETY=multiple
......@@ -45,7 +38,6 @@ The project's test suite can be run by executing:
- The public interface is in include/papyrus/\*.h.
- The Key-Value Store is in kv/.
- The compiler and MPI information for CMake is in conf/.
## References
......
# This is a sample build script for CSCS's Grand Tave
rm -rf build install
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DMPIEXEC="/opt/intel/compilers_and_libraries_2017.4.196/linux/mpi/intel64/bin/mpirun" -DMPIEXEC_NUMPROC_FLAG="-n"
make -j install
set(CMAKE_C_COMPILER "CC")
set(CMAKE_CXX_COMPILER "CC")
set(CMAKE_C_FLAGS "-craympich-mt")
set(CMAKE_CXX_FLAGS "-O2 -std=c++11 -craympich-mt")
set(MPIEXEC "srun")
set(MPIEXEC_NUMPROC_FLAG "-n")
set(CMAKE_C_COMPILER "mpicc")
set(CMAKE_CXX_COMPILER "mpic++")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "-O2 -std=c++11")
set(MPIEXEC "mpirun")
set(MPIEXEC_NUMPROC_FLAG "-n")
set(CMAKE_C_COMPILER "mpicc")
set(CMAKE_CXX_COMPILER "mpicxx")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "-O2 -std=c++11")
set(MPIEXEC "mpirun")
set(MPIEXEC_NUMPROC_FLAG "-n")
set(CMAKE_C_COMPILER "mpicc")
set(CMAKE_CXX_COMPILER "mpic++")
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "-O2 -qlanglvl=extended0x")
set(MPIEXEC "mpirun")
set(MPIEXEC_NUMPROC_FLAG "-n")
set(CMAKE_C_COMPILER "cc")
set(CMAKE_CXX_COMPILER "CC")
set(CMAKE_C_FLAGS "-craympich-mt")
set(CMAKE_CXX_FLAGS "-O2 -std=c++11 -craympich-mt")
set(MPIEXEC "aprun")
set(MPIEXEC_NUMPROC_FLAG "-n")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment