Fixes for compiling 4.1 on macOS.

This commit is contained in:
Martin Beaudoin 2018-02-22 21:13:06 -05:00
parent a9b6d1beb1
commit f54d1bf5f1
34 changed files with 112 additions and 16 deletions

View file

@ -10,6 +10,7 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -9,6 +9,7 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -8,5 +8,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers -llduSolvers

View file

@ -8,5 +8,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers -llduSolvers

View file

@ -9,6 +9,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lequationReader -lequationReader

View file

@ -10,4 +10,5 @@ EXE_LIBS = \
-lmeshTools \ -lmeshTools \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-llduSolvers -llduSolvers

View file

@ -10,5 +10,6 @@ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers -llduSolvers

View file

@ -13,6 +13,7 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lradiation \ -lradiation \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lsurfMesh \ -lsurfMesh \

View file

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lsurfMesh \ -lsurfMesh \

View file

@ -6,5 +6,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers -llduSolvers

View file

@ -9,6 +9,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \

View file

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -8,5 +8,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-llduSolvers -llduSolvers

View file

@ -6,6 +6,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llduSolvers -llduSolvers

View file

@ -9,10 +9,12 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
$(FOAM_LIBBIN)/postCalc.o \ $(FOAM_LIBBIN)/postCalc.o \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume -lfiniteVolume

View file

@ -7,4 +7,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume -lfiniteVolume

View file

@ -7,4 +7,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume -lfiniteVolume

View file

@ -11,10 +11,12 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
$(FOAM_LIBBIN)/postCalc.o \ $(FOAM_LIBBIN)/postCalc.o \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \

View file

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lfiniteVolume \ -lfiniteVolume \

View file

@ -9,7 +9,9 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume -lfiniteVolume

View file

@ -9,4 +9,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume -lfiniteVolume

View file

@ -9,9 +9,11 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \

View file

@ -264,10 +264,10 @@ Foam::fileNameList Foam::findEtcFiles
fileNameList results; fileNameList results;
// Search for user files in // Search for user files in
// * ~/.OpenFOAM/VERSION // * ~/.foam/VERSION
// * ~/.OpenFOAM // * ~/.foam
// //
fileName searchDir = home()/".OpenFOAM"; fileName searchDir = home()/".foam";
if (isDir(searchDir)) if (isDir(searchDir))
{ {
fileName fullName = searchDir/FOAMversion/name; fileName fullName = searchDir/FOAMversion/name;

View file

@ -26,6 +26,7 @@ License
#include "dlLibraryTable.H" #include "dlLibraryTable.H"
#include "OSspecific.H" #include "OSspecific.H"
#include "int.H" #include "int.H"
#include <dlfcn.h>
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -34,6 +35,8 @@ namespace Foam
defineTypeNameAndDebug(dlLibraryTable, 0); defineTypeNameAndDebug(dlLibraryTable, 0);
} }
Foam::dlLibraryTable Foam::dlLibraryTable::loadedLibraries;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -75,24 +78,75 @@ bool Foam::dlLibraryTable::open
{ {
if (functionLibName.size()) 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 (!functionLibPtr)
{ {
if (verbose) fileName l_LIBBIN_Name =
{ getEnv("FOAM_LIBBIN")/osxFileName;
WarningInFunction functionLibPtr =
<< "could not load " << functionLibName dlopen(l_LIBBIN_Name.c_str(), RTLD_LAZY|RTLD_GLOBAL);
<< endl; }
} 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; return false;
} }
else else
{ {
libPtrs_.append(functionLibPtr); if (!loadedLibraries.found(functionLibPtr))
libNames_.append(functionLibName); {
return true; loadedLibraries.insert(functionLibPtr, functionLibName);
return true;
}
else
{
return false;
}
} }
} }
else else

View file

@ -37,6 +37,8 @@ SourceFiles
#include "label.H" #include "label.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "Hash.H"
#include "HashTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,6 +50,8 @@ namespace Foam
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class dlLibraryTable class dlLibraryTable
:
public HashTable<fileName, void*, Hash<void*> >
{ {
// Private Member Functions // Private Member Functions
@ -68,6 +72,12 @@ public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
ClassName("dlLibraryTable"); ClassName("dlLibraryTable");
// Static data members
//- Static data someStaticData
static dlLibraryTable loadedLibraries;
// Constructors // Constructors
//- Construct null //- Construct null

View file

@ -1145,7 +1145,7 @@ void Foam::argList::printUsage() const
printNotes(); printNotes();
Info<< nl Info<< nl
<<"Using: OpenFOAM-" << Foam::FOAMversion <<"Using: foam-extend-" << Foam::FOAMversion
<< " (see www.foam-extend.org)" << nl << " (see www.foam-extend.org)" << nl
<<"Build: " << Foam::FOAMbuild << nl <<"Build: " << Foam::FOAMbuild << nl
<< endl; << endl;

View file

@ -1,6 +1,6 @@
.SUFFIXES: .C .cxx .cc .cpp .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 CC = $(WM_CXX) $(WM_CXXFLAGS) -ftrapping-math