MERGE: Remove loading of libs

This commit is contained in:
Hrvoje Jasak 2018-05-15 16:40:34 +01:00
parent 549ba4fab8
commit 9f04cc47e4
2 changed files with 8 additions and 41 deletions

View file

@ -431,15 +431,12 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
const dictionary& decompositionDict
)
{
loadExternalLibraries();
word methodName(decompositionDict.lookup("method"));
word decompositionMethodTypeName(decompositionDict.lookup("method"));
Info<< "Selecting decompositionMethod "
<< decompositionMethodTypeName << endl;
Info<< "Selecting decompositionMethod " << methodName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(decompositionMethodTypeName);
dictionaryConstructorTablePtr_->find(methodName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
@ -448,7 +445,7 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
"decompositionMethod::New"
"(const dictionary& decompositionDict)"
) << "Unknown decompositionMethod "
<< decompositionMethodTypeName << endl << endl
<< methodName << endl << endl
<< "Valid decompositionMethods are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
@ -464,15 +461,13 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
const polyMesh& mesh
)
{
loadExternalLibraries();
word decompositionMethodTypeName(decompositionDict.lookup("method"));
word methodName(decompositionDict.lookup("method"));
Info<< "Selecting decompositionMethod "
<< decompositionMethodTypeName << endl;
<< methodName << endl;
dictionaryMeshConstructorTable::iterator cstrIter =
dictionaryMeshConstructorTablePtr_->find(decompositionMethodTypeName);
dictionaryMeshConstructorTablePtr_->find(methodName);
if (cstrIter == dictionaryMeshConstructorTablePtr_->end())
{
@ -482,7 +477,7 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
"(const dictionary& decompositionDict, "
"const polyMesh& mesh)"
) << "Unknown decompositionMethod "
<< decompositionMethodTypeName << endl << endl
<< methodName << endl << endl
<< "Valid decompositionMethods are : " << endl
<< dictionaryMeshConstructorTablePtr_->sortedToc()
<< exit(FatalError);
@ -491,30 +486,6 @@ Foam::autoPtr<Foam::decompositionMethod> Foam::decompositionMethod::New
return autoPtr<decompositionMethod>(cstrIter()(decompositionDict, mesh));
}
void Foam::decompositionMethod::loadExternalLibraries()
{
wordList libNames(3);
libNames[0] = word("scotchDecomp");
libNames[1] = word("metisDecomp");
libNames[2] = word("parMetisDecomp");
forAll (libNames,i)
{
const word libName("lib"+libNames[i]+".so");
bool ok = dlLibraryTable::open(libName);
if (!ok)
{
WarningIn("decompositionMethod::loadExternalLibraries()")
<< "Loading of decomposition library " << libName
<< " unsuccesful. Some decomposition methods may not be "
<< "available"
<< endl;
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View file

@ -113,10 +113,6 @@ private:
//- Disallow default bitwise assignment
void operator=(const decompositionMethod&);
//- Load missing libraries to avoid compile-time linking
// to external dependencies
static void loadExternalLibraries();
public: