Various fixes for compiling 4.1 on macOS. Martin Beaudoin. Approved by Bernhard Gschaider.
This commit is contained in:
commit
077f219e9c
39 changed files with 249 additions and 18 deletions
|
@ -10,6 +10,7 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -9,6 +9,7 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -9,6 +9,6 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lequationReader
|
-lequationReader
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,5 @@ EXE_LIBS = \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,5 +10,6 @@ EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -13,6 +13,7 @@ EXE_LIBS = \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lradiation \
|
-lradiation \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
|
|
|
@ -6,5 +6,6 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -9,6 +9,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -10,6 +10,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -8,5 +8,6 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -6,6 +6,7 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llduSolvers
|
-llduSolvers
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -7,4 +7,5 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|
|
@ -7,4 +7,5 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|
|
@ -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 \
|
||||||
|
|
|
@ -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 \
|
||||||
|
|
|
@ -9,7 +9,9 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|
|
@ -9,4 +9,5 @@ EXE_INC = \
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lincompressibleTurbulenceModel \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|
|
@ -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 \
|
||||||
|
|
|
@ -52,7 +52,10 @@ Description
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
#ifndef darwin
|
||||||
#include <link.h>
|
#include <link.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
@ -261,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;
|
||||||
|
@ -552,6 +555,7 @@ bool Foam::chMod(const fileName& name, const mode_t m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return the file mode
|
||||||
mode_t Foam::mode(const fileName& name)
|
mode_t Foam::mode(const fileName& name)
|
||||||
{
|
{
|
||||||
fileStat fileStatus(name);
|
fileStat fileStatus(name);
|
||||||
|
@ -566,6 +570,7 @@ mode_t Foam::mode(const fileName& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return the file type: FILE or DIRECTORY
|
||||||
Foam::fileName::Type Foam::type(const fileName& name)
|
Foam::fileName::Type Foam::type(const fileName& name)
|
||||||
{
|
{
|
||||||
mode_t m = mode(name);
|
mode_t m = mode(name);
|
||||||
|
@ -585,24 +590,28 @@ Foam::fileName::Type Foam::type(const fileName& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Does the name exist in the filing system?
|
||||||
bool Foam::exists(const fileName& name, const bool checkGzip)
|
bool Foam::exists(const fileName& name, const bool checkGzip)
|
||||||
{
|
{
|
||||||
return mode(name) || isFile(name, checkGzip);
|
return mode(name) || isFile(name, checkGzip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Does the directory exist?
|
||||||
bool Foam::isDir(const fileName& name)
|
bool Foam::isDir(const fileName& name)
|
||||||
{
|
{
|
||||||
return S_ISDIR(mode(name));
|
return S_ISDIR(mode(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Does the file exist?
|
||||||
bool Foam::isFile(const fileName& name, const bool checkGzip)
|
bool Foam::isFile(const fileName& name, const bool checkGzip)
|
||||||
{
|
{
|
||||||
return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz")));
|
return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return size of file
|
||||||
off_t Foam::fileSize(const fileName& name)
|
off_t Foam::fileSize(const fileName& name)
|
||||||
{
|
{
|
||||||
fileStat fileStatus(name);
|
fileStat fileStatus(name);
|
||||||
|
@ -617,6 +626,7 @@ off_t Foam::fileSize(const fileName& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Return time of last file modification
|
||||||
time_t Foam::lastModified(const fileName& name)
|
time_t Foam::lastModified(const fileName& name)
|
||||||
{
|
{
|
||||||
fileStat fileStatus(name);
|
fileStat fileStatus(name);
|
||||||
|
@ -631,6 +641,7 @@ time_t Foam::lastModified(const fileName& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Read a directory and return the entries as a string list
|
||||||
Foam::fileNameList Foam::readDir
|
Foam::fileNameList Foam::readDir
|
||||||
(
|
(
|
||||||
const fileName& directory,
|
const fileName& directory,
|
||||||
|
@ -726,6 +737,7 @@ Foam::fileNameList Foam::readDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Copy, recursively if necessary, the source to the destination
|
||||||
bool Foam::cp(const fileName& src, const fileName& dest)
|
bool Foam::cp(const fileName& src, const fileName& dest)
|
||||||
{
|
{
|
||||||
// Make sure source exists.
|
// Make sure source exists.
|
||||||
|
@ -825,6 +837,7 @@ bool Foam::cp(const fileName& src, const fileName& dest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Create a softlink. dst should not exist. Returns true if successful.
|
||||||
bool Foam::ln(const fileName& src, const fileName& dst)
|
bool Foam::ln(const fileName& src, const fileName& dst)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
|
@ -862,6 +875,7 @@ bool Foam::ln(const fileName& src, const fileName& dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Rename srcFile dstFile
|
||||||
bool Foam::mv(const fileName& src, const fileName& dst)
|
bool Foam::mv(const fileName& src, const fileName& dst)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
|
@ -887,6 +901,8 @@ bool Foam::mv(const fileName& src, const fileName& dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Rename to a corresponding backup file
|
||||||
|
// If the backup file already exists, attempt with "01" .. "99" index
|
||||||
bool Foam::mvBak(const fileName& src, const std::string& ext)
|
bool Foam::mvBak(const fileName& src, const std::string& ext)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
|
@ -924,6 +940,8 @@ bool Foam::mvBak(const fileName& src, const std::string& ext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Remove a file, returning true if successful otherwise false
|
||||||
bool Foam::rm(const fileName& file)
|
bool Foam::rm(const fileName& file)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
|
@ -944,6 +962,7 @@ bool Foam::rm(const fileName& file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Remove a dirctory and its contents
|
||||||
bool Foam::rmDir(const fileName& directory)
|
bool Foam::rmDir(const fileName& directory)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
|
@ -1233,7 +1252,7 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NOT_SURE_HOW_TO_USE_THIS
|
||||||
static int collectLibsCallback
|
static int collectLibsCallback
|
||||||
(
|
(
|
||||||
struct dl_phdr_info *info,
|
struct dl_phdr_info *info,
|
||||||
|
@ -1260,6 +1279,7 @@ Foam::fileNameList Foam::dlLoaded()
|
||||||
}
|
}
|
||||||
return libs;
|
return libs;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void Foam::osRandomSeed(const label seed)
|
void Foam::osRandomSeed(const label seed)
|
||||||
|
|
|
@ -262,7 +262,7 @@ void Foam::sigFpe::set(const bool verbose)
|
||||||
# elif defined(__APPLE__)
|
# elif defined(__APPLE__)
|
||||||
|
|
||||||
struct sigaction newAction;
|
struct sigaction newAction;
|
||||||
newAction.sa_handler = sigFpeHandler;
|
newAction.sa_handler = sigHandler;
|
||||||
newAction.sa_flags = SA_NODEFER;
|
newAction.sa_flags = SA_NODEFER;
|
||||||
sigemptyset(&newAction.sa_mask);
|
sigemptyset(&newAction.sa_mask);
|
||||||
if (sigaction(SIGFPE, &newAction, &oldAction_) < 0)
|
if (sigaction(SIGFPE, &newAction, &oldAction_) < 0)
|
||||||
|
|
|
@ -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,25 +78,76 @@ 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);
|
{
|
||||||
|
loadedLibraries.insert(functionLibPtr, functionLibName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -31,6 +31,25 @@ License
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#if defined(darwin) && defined(__clang__)
|
||||||
|
#ifndef DUMMY_SCALAR_FUNCTIONS
|
||||||
|
#define DUMMY_SCALAR_FUNCTIONS
|
||||||
|
inline float j0f(float x) { return float(j0(double(x)));}
|
||||||
|
inline float j1f(float x) { return float(j1(double(x)));}
|
||||||
|
inline float y0f(float x) { return float(y0(double(x)));}
|
||||||
|
inline float y1f(float x) { return float(y1(double(x)));}
|
||||||
|
inline float jnf(const int n, const float s) { return float(jn(n, double(s))); }
|
||||||
|
inline float ynf(const int n, const float s) { return float(yn(n, double(s))); }
|
||||||
|
|
||||||
|
inline long double j0l(float x) { return double(j0(double(x)));}
|
||||||
|
inline long double j1l(float x) { return double(j1(double(x)));}
|
||||||
|
inline long double y0l(float x) { return double(y0(double(x)));}
|
||||||
|
inline long double y1l(float x) { return double(y1(double(x)));}
|
||||||
|
inline long double jnl(const int n, const float s) { return double(jn(n, double(s))); }
|
||||||
|
inline long double ynl(const int n, const float s) { return double(yn(n, double(s))); }
|
||||||
|
#endif
|
||||||
|
#endif // darwin
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
|
|
@ -69,6 +69,11 @@ bool read(const char*, int64_t&);
|
||||||
Istream& operator>>(Istream&, int64_t&);
|
Istream& operator>>(Istream&, int64_t&);
|
||||||
Ostream& operator<<(Ostream&, const int64_t);
|
Ostream& operator<<(Ostream&, const int64_t);
|
||||||
|
|
||||||
|
#if WM_ARCH_OPTION == 64 && darwin && __clang__
|
||||||
|
Istream& operator>>(Istream&, long&);
|
||||||
|
Ostream& operator<<(Ostream&, const long);
|
||||||
|
#endif
|
||||||
|
|
||||||
//- Template specialization for pTraits<int64_t>
|
//- Template specialization for pTraits<int64_t>
|
||||||
template<>
|
template<>
|
||||||
class pTraits<int64_t>
|
class pTraits<int64_t>
|
||||||
|
|
|
@ -101,5 +101,17 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const int64_t i)
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WM_ARCH_OPTION == 64 && darwin && __clang__
|
||||||
|
Foam::Istream& Foam::operator>>(Istream& is, long& i)
|
||||||
|
{
|
||||||
|
return operator>>(is, reinterpret_cast<int64_t&>(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const long i)
|
||||||
|
{
|
||||||
|
os << int64_t(i);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
79
wmake/src/Makefile
Normal file
79
wmake/src/Makefile
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | foam-extend: Open Source CFD
|
||||||
|
# \\ / O peration | Version: 4.1
|
||||||
|
# \\ / A nd | Web: http://www.foam-extend.org
|
||||||
|
# \\/ M anipulation | For copyright notice see file Copyright
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of foam-extend.
|
||||||
|
#
|
||||||
|
# foam-extend is free software: you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
# option) any later version.
|
||||||
|
#
|
||||||
|
# foam-extend is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
# General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# Makefile
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Makefile used to compile wmake utilities.
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# The Makefile use a POSIX shell
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Initialise suffices list
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .o
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# set compilation and dependency building rules
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
GENERAL_RULES = $(WM_DIR)/rules/General
|
||||||
|
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
|
||||||
|
BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
|
||||||
|
|
||||||
|
include $(RULES)/general
|
||||||
|
include $(RULES)/$(WM_LINK_LANGUAGE)
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# targets
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
all: $(BIN)/dirToString $(BIN)/wmkdep
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(BIN)/dirToString $(BIN)/wmkdep 2>/dev/null
|
||||||
|
|
||||||
|
|
||||||
|
$(BIN)/dirToString: dirToString.c
|
||||||
|
@mkdir -p $(BIN)
|
||||||
|
$(cc) $(cFLAGS) dirToString.c -o $(BIN)/dirToString
|
||||||
|
|
||||||
|
$(BIN)/wmkdep: wmkdep.l
|
||||||
|
@mkdir -p $(BIN)
|
||||||
|
flex wmkdep.l
|
||||||
|
$(cc) $(cFLAGS) lex.yy.c -o $(BIN)/wmkdep
|
||||||
|
@rm -f lex.yy.c 2>/dev/null
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
Reference in a new issue