Commit 995c55b6 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

CONFIG: add clang third-party lib to LD_LIBRARY_PATH

- required if there is no system openmp and libomp or libgomp are
  only found in the clang hierarchy

STYLE: add some notes in the openmp rules.

- the _OPENMP macro is now used in low-level testing files
parent 576a226d
EXE_INC = ${COMP_OPENMP}
EXE_INC = ${COMP_OPENMP} /* -UUSE_OMP */
/* Mostly do not need to explicitly link openmp libraries */
/* EXE_LIBS = ${LINK_OPENMP} */
......@@ -30,7 +30,7 @@ Description
#include <cstdlib>
#include <iostream>
#ifdef USE_OMP
#if _OPENMP
#include <omp.h>
#endif
......@@ -39,11 +39,19 @@ Description
int main(int argc, char *argv[])
{
#if USE_OMP
std::cout << "USE_OMP defined (" << USE_OMP << ")\n";
#else
std::cout << "USE_OMP undefined\n";
#endif
#if _OPENMP
std::cout << "_OPENMP = " << _OPENMP << "\n\n";
// Fork threads with their own copies of variables
int nThreads, threadId;
// Fork threads with their own copies of variables
#ifdef USE_OMP
#pragma omp parallel private(nThreads, threadId)
#pragma omp parallel private(nThreads, threadId)
{
threadId = omp_get_thread_num();
nThreads = omp_get_num_threads();
......
......@@ -302,6 +302,7 @@ CLANG_NOT_FOUND
_foamAddMan $clangDir/man
_foamAddPath $clangDir/bin
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using ThirdParty compiler"
......
......@@ -287,6 +287,7 @@ CLANG_NOT_FOUND
_foamAddMan $clangDir/share/man
_foamAddPath $clangDir/bin
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
......
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
# -
# Clang provides 'omp' and a link for 'gomp'.
# With 'gomp' we can use system libs.
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -qopenmp
LINK_OPENMP = -liomp5
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -qopenmp
LINK_OPENMP = -liomp5
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
# -
# Clang provides 'omp' and a link for 'gomp'.
# With 'gomp' we can use system libs.
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
# -
# Clang provides 'omp' and a link for 'gomp'.
# With 'gomp' we can use system libs.
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -qopenmp
LINK_OPENMP = -liomp5
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp
Supports Markdown
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