Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
5d5920d9
Commit
5d5920d9
authored
8 years ago
by
Benjamin Cumming
Browse files
Options
Downloads
Patches
Plain Diff
add cmake support for MPI and Cray systems, updated README
parent
520d27a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+15
-2
15 additions, 2 deletions
CMakeLists.txt
README.md
+53
-1
53 additions, 1 deletion
README.md
with
68 additions
and
3 deletions
CMakeLists.txt
+
15
−
2
View file @
5d5920d9
...
@@ -20,13 +20,26 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
...
@@ -20,13 +20,26 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/lib
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/lib
)
# TBB support
# TBB support
set
(
WITH_TBB
"
OFF
"
CACHE BOOL
"use TBB for on-node threading"
)
set
(
WITH_TBB OFF CACHE BOOL
"use TBB for on-node threading"
)
if
(
"
${
WITH_TBB
}
"
STREQUAL
"ON"
)
if
(
${
WITH_TBB
}
)
find_package
(
TBB REQUIRED
)
find_package
(
TBB REQUIRED
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DWITH_TBB
${
TBB_DEFINITIONS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DWITH_TBB
${
TBB_DEFINITIONS
}
"
)
link_directories
(
${
TBB_LIBRARY
}
)
link_directories
(
${
TBB_LIBRARY
}
)
endif
()
endif
()
# MPI support
# relies on the user specifying an MPI-aware compiler wrapper
set
(
WITH_MPI OFF CACHE BOOL
"use MPI for distrubuted parallelism"
)
if
(
${
WITH_MPI
}
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DWITH_MPI"
)
endif
()
# Cray systems
set
(
SYSTEM_CRAY OFF CACHE BOOL
"add flags for compilation on Cray systems"
)
if
(
${
SYSTEM_CRAY
}
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-dynamic"
)
endif
()
# targets for extermal dependencies
# targets for extermal dependencies
include
(
ExternalProject
)
include
(
ExternalProject
)
...
...
This diff is collapsed.
Click to expand it.
README.md
+
53
−
1
View file @
5d5920d9
...
@@ -10,7 +10,9 @@ git submodule init
...
@@ -10,7 +10,9 @@ git submodule init
git submodule update
git submodule update
# setup environment
# setup environment
module load gcc
# on a desktop system this might not be required
# on a cluster this could be required
module load gcc
module load cmake
module load cmake
export
CC
=
`
which gcc
`
export
CC
=
`
which gcc
`
export
CXX
=
`
which g++
`
export
CXX
=
`
which g++
`
...
@@ -25,3 +27,53 @@ make -j
...
@@ -25,3 +27,53 @@ make -j
cd
tests
cd
tests
./test.exe
./test.exe
```
```
## MPI
Set the
`WITH_MPI`
option either via the ccmake interface, or via the command line as shown below.
For the time being our CMake configuration does not try to detect MPI.
Instead, it relies on the user specifying an MPI wrapper for the compiler by setting the
`CXX`
and
`CC`
environment variables.
```
export CXX=mpicxx
export CC=mpicc
cmake <path to CMakeLists.txt> -DWITH_MPI=ON
```
## TBB
Support for multi-threading requires Intel Threading Building Blocks (TBB).
When TBB is installed, it comes with some scripts that can be run to set up the user environment.
The scripts set the
`TBB_ROOT`
environment variable, which is used by the CMake configuration to find TBB.
```
source <path to TBB installation>/tbbvars.sh
cmake <path to CMakeLists.txt> -DWITH_TBB=ON
```
### TBB on Cray systems
To compile with TBB on Cray systems, load the intel module, which will automatically configure the environment.
```
# load the gnu environment for compiling the application
module load PrgEnv-gnu
# gcc 5.x does not work with the version of TBB installed on Cray
# requires at least version 4.4 of TBB
module swap gcc/4.9.3
# load the intel programming module
# on Cray systems this automatically sets `TBB_ROOT` environment variable
module load intel
module load cmake
export CXX=`which CC`
export CC=`which cc`
# multithreading only
cmake <path to CMakeLists.txt> -DWITH_TBB=ON -DSYSTEM_CRAY=ON
# multithreading and MPI
cmake <path to CMakeLists.txt> -DWITH_TBB=ON -DWITH_MPI=ON -DSYSTEM_CRAY=ON
```
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment