mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
EXE_INC = ${COMP_OPENMP}
|
EXE_INC = ${COMP_OPENMP} /* -UUSE_OMP */
|
||||||
|
|
||||||
/* Mostly do not need to explicitly link openmp libraries */
|
/* Mostly do not need to explicitly link openmp libraries */
|
||||||
/* EXE_LIBS = ${LINK_OPENMP} */
|
/* EXE_LIBS = ${LINK_OPENMP} */
|
||||||
|
|||||||
@ -30,7 +30,7 @@ Description
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifdef USE_OMP
|
#if _OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -39,11 +39,19 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
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;
|
int nThreads, threadId;
|
||||||
|
|
||||||
// Fork threads with their own copies of variables
|
#pragma omp parallel private(nThreads, threadId)
|
||||||
#ifdef USE_OMP
|
|
||||||
#pragma omp parallel private(nThreads, threadId)
|
|
||||||
{
|
{
|
||||||
threadId = omp_get_thread_num();
|
threadId = omp_get_thread_num();
|
||||||
nThreads = omp_get_num_threads();
|
nThreads = omp_get_num_threads();
|
||||||
|
|||||||
@ -302,6 +302,7 @@ CLANG_NOT_FOUND
|
|||||||
|
|
||||||
_foamAddMan $clangDir/man
|
_foamAddMan $clangDir/man
|
||||||
_foamAddPath $clangDir/bin
|
_foamAddPath $clangDir/bin
|
||||||
|
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
|
||||||
|
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using ThirdParty compiler"
|
echo "Using ThirdParty compiler"
|
||||||
|
|||||||
@ -287,6 +287,7 @@ CLANG_NOT_FOUND
|
|||||||
|
|
||||||
_foamAddMan $clangDir/share/man
|
_foamAddMan $clangDir/share/man
|
||||||
_foamAddPath $clangDir/bin
|
_foamAddPath $clangDir/bin
|
||||||
|
_foamAddLib $clangDir/lib # For things like libomp (openmp) etc
|
||||||
|
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
# Flags for compiling/linking openmp
|
# 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
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -qopenmp
|
COMP_OPENMP = -DUSE_OMP -qopenmp
|
||||||
LINK_OPENMP = -liomp5
|
LINK_OPENMP = -liomp5
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -qopenmp
|
COMP_OPENMP = -DUSE_OMP -qopenmp
|
||||||
LINK_OPENMP = -liomp5
|
LINK_OPENMP = -liomp5
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
# Flags for compiling/linking openmp
|
# 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
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
# Flags for compiling/linking openmp
|
# 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
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -qopenmp
|
COMP_OPENMP = -DUSE_OMP -qopenmp
|
||||||
LINK_OPENMP = -liomp5
|
LINK_OPENMP = -liomp5
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Flags for compiling/linking openmp
|
# Flags for compiling/linking openmp
|
||||||
|
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
|
||||||
|
|
||||||
COMP_OPENMP = -DUSE_OMP -fopenmp
|
COMP_OPENMP = -DUSE_OMP -fopenmp
|
||||||
LINK_OPENMP = -lgomp
|
LINK_OPENMP = -lgomp
|
||||||
|
|||||||
Reference in New Issue
Block a user