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 \
-lspecie \
-lcompressibleRASModels \
-lcompressibleTurbulenceModel \
-lfiniteVolume \
-lmeshTools \
-llduSolvers

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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