From 9f04cc47e4d031d495e574f469e89c717e3595ee Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 15 May 2018 16:40:34 +0100 Subject: [PATCH] MERGE: Remove loading of libs --- .../decompositionMethod/decompositionMethod.C | 45 ++++--------------- .../decompositionMethod/decompositionMethod.H | 4 -- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C index 111cca4e5..767538191 100644 --- a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C +++ b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C @@ -431,15 +431,12 @@ Foam::autoPtr 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::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::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::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::New return autoPtr(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 * * * * * * * * * * * * * // diff --git a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H index 9bf99744a..ef329ebe3 100644 --- a/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H +++ b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H @@ -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: