Fixes for compiling 4.1 on macOS.
This commit is contained in:
parent
a9b6d1beb1
commit
f54d1bf5f1
34 changed files with 112 additions and 16 deletions
|
@ -10,6 +10,7 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -9,6 +9,7 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-llduSolvers
|
||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-llduSolvers
|
||||
|
|
|
@ -9,6 +9,6 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lequationReader
|
||||
|
||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
|||
-lmeshTools \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,5 +10,6 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-llduSolvers
|
||||
|
|
|
@ -13,6 +13,7 @@ EXE_LIBS = \
|
|||
-lspecie \
|
||||
-lradiation \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsurfMesh \
|
||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsurfMesh \
|
||||
|
|
|
@ -6,5 +6,6 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-llduSolvers
|
||||
|
|
|
@ -9,6 +9,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleLESModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-llduSolvers
|
||||
|
|
|
@ -6,6 +6,7 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-llduSolvers
|
||||
|
|
|
@ -9,10 +9,12 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume
|
||||
|
|
|
@ -7,4 +7,5 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume
|
||||
|
|
|
@ -7,4 +7,5 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume
|
||||
|
|
|
@ -11,10 +11,12 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lfiniteVolume \
|
||||
|
|
|
@ -7,6 +7,7 @@ EXE_INC = \
|
|||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lcompressibleRASModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lfiniteVolume \
|
||||
|
|
|
@ -9,7 +9,9 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lcompressibleRASModels \
|
||||
-lfiniteVolume
|
||||
|
|
|
@ -9,4 +9,5 @@ EXE_INC = \
|
|||
EXE_LIBS = \
|
||||
-lincompressibleLESModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lfiniteVolume
|
||||
|
|
|
@ -9,9 +9,11 @@ EXE_INC = \
|
|||
|
||||
EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lcompressibleRASModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
|
|
|
@ -264,10 +264,10 @@ Foam::fileNameList Foam::findEtcFiles
|
|||
fileNameList results;
|
||||
|
||||
// Search for user files in
|
||||
// * ~/.OpenFOAM/VERSION
|
||||
// * ~/.OpenFOAM
|
||||
// * ~/.foam/VERSION
|
||||
// * ~/.foam
|
||||
//
|
||||
fileName searchDir = home()/".OpenFOAM";
|
||||
fileName searchDir = home()/".foam";
|
||||
if (isDir(searchDir))
|
||||
{
|
||||
fileName fullName = searchDir/FOAMversion/name;
|
||||
|
|
|
@ -26,6 +26,7 @@ License
|
|||
#include "dlLibraryTable.H"
|
||||
#include "OSspecific.H"
|
||||
#include "int.H"
|
||||
#include <dlfcn.h>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -34,6 +35,8 @@ namespace Foam
|
|||
defineTypeNameAndDebug(dlLibraryTable, 0);
|
||||
}
|
||||
|
||||
Foam::dlLibraryTable Foam::dlLibraryTable::loadedLibraries;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -75,24 +78,75 @@ bool Foam::dlLibraryTable::open
|
|||
{
|
||||
if (functionLibName.size())
|
||||
{
|
||||
void* functionLibPtr = dlOpen(functionLibName, verbose);
|
||||
void* functionLibPtr =
|
||||
dlopen(functionLibName.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
|
||||
#ifdef darwin
|
||||
// If failing to load under OS X, let's try some obvious variations
|
||||
// before giving up completely
|
||||
fileName osxFileName(functionLibName);
|
||||
|
||||
if(!functionLibPtr && functionLibName.ext()=="so")
|
||||
{
|
||||
osxFileName=functionLibName.lessExt()+".dylib";
|
||||
|
||||
functionLibPtr =
|
||||
dlopen(osxFileName.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
|
||||
// If unsuccessful, which might be the case under Mac OSX 10.11 (El
|
||||
// Capitan) with System Integrity Protection (SIP) enabled, let's try
|
||||
// building a full path using well-known environment variables. This is
|
||||
// the last resort, unless you provide the full pathname yourself.
|
||||
if (!functionLibPtr)
|
||||
{
|
||||
if (verbose)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "could not load " << functionLibName
|
||||
<< endl;
|
||||
}
|
||||
fileName l_LIBBIN_Name =
|
||||
getEnv("FOAM_LIBBIN")/osxFileName;
|
||||
functionLibPtr =
|
||||
dlopen(l_LIBBIN_Name.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
if (!functionLibPtr)
|
||||
{
|
||||
fileName l_SITE_LIBBIN_Name =
|
||||
getEnv("FOAM_SITE_LIBBIN")/osxFileName;
|
||||
functionLibPtr =
|
||||
dlopen(l_SITE_LIBBIN_Name.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
if (!functionLibPtr)
|
||||
{
|
||||
fileName l_USER_LIBBIN_Name =
|
||||
getEnv("FOAM_USER_LIBBIN")/osxFileName;
|
||||
functionLibPtr =
|
||||
dlopen(l_USER_LIBBIN_Name.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
#elif defined mingw
|
||||
if(!functionLibPtr && functionLibName.ext()=="so") {
|
||||
fileName lName=functionLibName.lessExt()+".dll";
|
||||
functionLibPtr =
|
||||
dlopen(lName.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||
}
|
||||
#endif
|
||||
if (!functionLibPtr)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"dlLibraryTable::open(const fileName& functionLibName)"
|
||||
) << "could not load " << dlerror()
|
||||
<< endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
libPtrs_.append(functionLibPtr);
|
||||
libNames_.append(functionLibName);
|
||||
return true;
|
||||
if (!loadedLibraries.found(functionLibPtr))
|
||||
{
|
||||
loadedLibraries.insert(functionLibPtr, functionLibName);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -37,6 +37,8 @@ SourceFiles
|
|||
|
||||
#include "label.H"
|
||||
#include "DynamicList.H"
|
||||
#include "Hash.H"
|
||||
#include "HashTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -48,6 +50,8 @@ namespace Foam
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class dlLibraryTable
|
||||
:
|
||||
public HashTable<fileName, void*, Hash<void*> >
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
|
@ -68,6 +72,12 @@ public:
|
|||
// Declare name of the class and its debug switch
|
||||
ClassName("dlLibraryTable");
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Static data someStaticData
|
||||
static dlLibraryTable loadedLibraries;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
|
|
@ -1145,7 +1145,7 @@ void Foam::argList::printUsage() const
|
|||
printNotes();
|
||||
|
||||
Info<< nl
|
||||
<<"Using: OpenFOAM-" << Foam::FOAMversion
|
||||
<<"Using: foam-extend-" << Foam::FOAMversion
|
||||
<< " (see www.foam-extend.org)" << nl
|
||||
<<"Build: " << Foam::FOAMbuild << nl
|
||||
<< endl;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.SUFFIXES: .C .cxx .cc .cpp
|
||||
|
||||
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-overloaded-virtual -Wno-unsequenced -Wno-c++11-extensions -Wno-unused-comparison
|
||||
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-overloaded-virtual -Wno-unsequenced -Wno-c++11-extensions -Wno-unused-comparison -Wno-undefined-var-template
|
||||
|
||||
CC = $(WM_CXX) $(WM_CXXFLAGS) -ftrapping-math
|
||||
|
||||
|
|
Reference in a new issue