-
Notifications
You must be signed in to change notification settings - Fork 13
PetaVision CMake Variables
This page describes the CMake variables that PetaVision uses to define its build configuration.
BUILD_DIR The name of the directory containing the executable. If
blank, this will be the same as CMAKE_BUILD_TYPE. For example, if
BUILD_DIR is blank and CMAKE_BUILD_TYPE is Debug, the BasicSystemTest
executable is in
OpenPV/PVSystemTests/BasicSystemTest/Debug/BasicSystemTest
.
CLANG_OMP On Macs, this flag indicates that an OpenMP-capable version of clang (as opposed to the Xcode-supplied clang, which is not yet OpenMP capable) is being used. On machines other than Macs, this variable is ignored.
CMAKE_BUILD_TYPE A standard CMake variable. The usual choices are Debug (less optimization and more support in gdb or lldb) and Release (more optimization but no debugging information in gdb or lldb).
CUDA_RELEASE: Controls whether the CUDA kernels are compiled using optimization (CUDA_RELEASE on) or for debugging (CUDA_RELEASE off).
CUDNN_PATH: If PV_USE_CUDNN is on, this is the absolute path to the directory containing cuDNN. This directory must contain, somewhere in its tree, both cudnn.h and either libcudnn.dylib (OS X) or libcudnn.so (Linux). Because NVIDIA changed the directory structure of its cuDNN archive at version 7.0, we check both the immediate CUDNN_PATH directory and all of its subdirectories for these files.
OpenCL_dir: Not currently used.
PV_BUILD_SHARED: If this variable is off, the PetaVision library is built as
a static library, pv-core/lib/libpv.a
. If the variable is on, it is built as
a dynamic library, either pv-core/lib/libpv.dylib
(OS X) or
pv-core/lib/libpv.so
(Linux).
PV_DIR: The absolute path to the pv-core directory of the repository. Used by projects to link to the libpv library and to the core header files.
PV_OPENMP_COMPILER_FLAG: If PV_USE_OPENMP_THREADS is on, this flag will be
passed as an argument to the compiler. For GNU-GCC, it should be -fopenmp
.
For the clang/OpenMP installation described in the
MacOS installation page, use -fopenmp=libiomp5
.
Note that the version of clang supplied by Apple's Xcode is not compatible
with OpenMP (as of Xcode version 7.1).
PV_SYSTEM_TEST_THREADS: When running ctest from the PVSystemTests directory,
this variable controls the number of threads (the -t option) passed to each test.
To avoid oversubscribing threads when running the system tests, use the following
limits on PV_SYSTEM_TEST_THREADS: If you are using MPI and run ctest -j
m,
where m is the number of system tests to run in parallel (omitting the -j option
counts as m=1), make sure that 4_m_*PV_SYSTEM_TEST_THREADS is no more than
the maximum number of threads. If not using MPI, make sure that
m*PV_SYSTEM_TEST_THREADS is no more than the maximum number of threads.
The reason for the factor of 4 is that when using MPI is that many system tests are
run using 1, then 2, then 4 MPI processes.
PV_USE_CUDA: Controls whether PetaVision is compiled to use NVIDIA CUDA for GPU parallelization.
PV_USE_CUDNN: If PV_USE_CUDA is on, this flag controls whether PetaVision is compiled to use cuDNN.
PV_USE_MPI: Controls whether PetaVision is compiled to use Open MPI parallelization.
PV_USE_OPENCL: This should be left off. OpenCL is not currently supported.
PV_USE_OPENMP_THREADS: Controls whether PetaVision is compiled to use OpenMP thread parallelization.