共有ライブラリが生成されない件.(XX.so: cannot open shared object file: No such file or directory)

42 skatījumi
Pāriet uz pirmo nelasīto ziņojumu

Cane

nelasīta,
2022. gada 19. dec. 01:08:4719.12.22
uz OpenFOAM
  こんにちは,お読みいただきありがとうございます.

以下のようにfvOptionsにソース項を追加しました.

  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | =========                 |                                                 |
  3. | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
  4. |  \\    /   O peration     | Version:  2.3.0                                 |
  5. |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
  6. |    \\/     M anipulation  |                                                 |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10.     version     2.0;
  11.     format      ascii;
  12.     class       dictionary;
  13.     location    "system";
  14.     object      fvOptions;
  15. }
  16. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

  17. air1Source
  18. {
  19.   type          scalarCodedSource;
  20.   active        true;
  21.   name          air1source;

  22.   scalarCodedSourceCoeffs
  23.   {
  24.     selectionMode all;

  25.     name          air1source;
  26.     fields        (thermo:rho.air1);

  27.     codeOptions
  28.     #{
  29. -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \
  30. -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
  31. -I$(LIB_SRC)/transportModels/compressible/lnInclude \
  32. -I$(MPI_ROOT)/include \
  33. -I$(FOAM_RUN)/20221218/Include
  34.     #};

  35.     codeInclude
  36.     #{
  37. #include "fvCFD.H"
  38. #include "phaseSystem.H"
  39. #include "electrode.H"
  40. #include <mpi.h>
  41.     #};

  42.     codeCorrect
  43.     #{
  44.       Pout << "**codeCorrect**" << endl;
  45.     #};
  46.  
  47.     codeAddSup
  48.     #{
  49.       word phasename_ = ".air1";
  50. #include "codeAddSup_Electrode_model2_o2_mpi.H"
  51. #include "codeAddSup_Electrode_2.H"
  52.       scalar sumMass = 0.0;
  53.       forAll(Su,i)
  54.       {
  55.   Su[i] = source[i]*0.25;
  56.   Sp[i] = 0.0/psi[i];
  57.  
  58.   sumMass += Su[i]*mesh_.V()[i];
  59.       }
  60.       reduce(sumMass, sumOp<scalar>());
  61.       Pout << sumMass << endl;

  62.       eqn += Su + fvm::SuSp(Sp, psi);
  63.     #};

  64.     codeConstrain
  65.     #{
  66.       Pout << "**codeConstrain**" << endl;
  67.     #};

  68.   }
  69. }

これを【reactingMultiphaseEulerFoam】として実行したところ,以下のようなエラーが生じました.

jessica@jessica-VirtualBox:~/OpenFOAM/jessica-v2006/run/20221219$ Could not load "/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so"
/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so: cannot open shared object file: No such file or directory
    ln: ./lnInclude
/home/jessica/OpenFOAM/jessica-v2006/run/20221219/system/fvOptions.air1Source.scalarCodedSourceCoeffs:45:10: fatal error: mpi.h: No such file or directory
compilation terminated.
make: *** [/home/jessica/OpenFOAM/OpenFOAM-v2006/wmake/rules/General/transform:35: Make/linux64GccDPInt32Opt/codedFvOptionTemplate.o] Error 1


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/air1source/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so"


file: /home/jessica/OpenFOAM/jessica-v2006/run/20221219/system/fvOptions.air1Source.scalarCodedSourceCoeffs at line 26 to 73.

    From void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
    in file db/dynamicLibrary/codedBase/codedBase.C at line 237.

FOAM exiting


これに対して,/home/jessica/OpenFOAM/OpenFOAM-v2006/etc ディレクトリ下のconfig.cshとconfig.shのテキストファイル"mpi"に記述されている$MPI_ROOTを,include/mpi.hが存在するディレクトリである"/usr/lib/x86_64-linux-gnu/openmpi"に書き換えましたが,エラーは解決しませんでした.

また,実行したケースディレクトリに生成されたdynamicCodeディレクトリの階層構造は以下のようになっています.
├── dynamicCode
│   └── air1source
│       ├── codedFvOptionTemplate.C
│       ├── codedFvOptionTemplate.H
│       ├── lnInclude
│       │   ├── codedFvOptionTemplate.C -> ../codedFvOptionTemplate.C
│       │   └── codedFvOptionTemplate.H -> ../codedFvOptionTemplate.H
│       └── Make
│           ├── files
│           ├── linux64GccDPInt32Opt
│           │   ├── codedFvOptionTemplate.C.dep
│           │   ├── options
│           │   ├── sourceFiles
│           │   └── variables
│           ├── options
│           └── SHA1Digest
このように,エラーメッセージで表示されているdynamicCode直下のplatformsというディレクトリは生成されていません.

どなたか原因がお分かりになる方,ご教示いただけると大変助かります.

Cane

nelasīta,
2022. gada 19. dec. 02:21:5419.12.22
uz OpenFOAM
config.csh及びconfig.shのmpiファイル中の$MPI_ROOTを/usr/lib/x86_64-linux-gnu/openmpiに書き換えたと述べましたが,コメントアウト部分に書き込んでしまっており,ただいま修正したところ,今度は以下のようなエラーとなりました.

fvOptionsに記述したscalarCodedSourceはValid fvOption typesに含まれているのですが,何が問題なのでしょうか?

jessica@jessica-VirtualBox:~/OpenFOAM/jessica-v2006/run/20221219$ Could not load "/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so"
/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so: undefined symbol: _ZN3MPI8Datatype4FreeEv
Could not load "/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so"
/home/jessica/OpenFOAM/jessica-v2006/run/20221219/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so: undefined symbol: _ZN3MPI8Datatype4FreeEv



--> FOAM FATAL IO ERROR:
Unknown fvOption type air1source

Valid fvOption types :

46
(
acousticDampingSource
actuationDiskSource
buoyancyEnergy
buoyancyForce
constantHeatTransfer
directionalPressureGradientExplicitSource
effectivenessHeatExchangerSource
explicitPorositySource
fixedTemperatureConstraint
interRegionExplicitPorositySource
jouleHeatingSource
limitTemperature
limitVelocity
meanVelocityForce
multiphaseStabilizedTurbulence
patchMeanVelocityForce
radialActuationDiskSource
radiation
rotorDisk
scalarCodedSource
scalarFixedValueConstraint
scalarPhaseLimitStabilization
scalarSemiImplicitSource
solidificationMeltingSource
sphericalTensorCodedSource
sphericalTensorFixedValueConstraint
sphericalTensorPhaseLimitStabilization
sphericalTensorSemiImplicitSource
symmTensorCodedSource
symmTensorFixedValueConstraint
symmTensorPhaseLimitStabilization
symmTensorSemiImplicitSource
tabulatedAccelerationSource
tabulatedHeatTransfer
tabulatedNTUHeatTransfer
tensorCodedSource
tensorFixedValueConstraint
tensorPhaseLimitStabilization
tensorSemiImplicitSource
variableHeatTransfer
vectorCodedSource
vectorFixedValueConstraint
vectorPhaseLimitStabilization
vectorSemiImplicitSource
velocityDampingConstraint
viscousDissipation
)



file: /home/jessica/OpenFOAM/jessica-v2006/run/20221219/system/fvOptions.air1Source at line 0 to 73.

    From static Foam::autoPtr<Foam::fv::option> Foam::fv::option::New(const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&)
    in file cfdTools/general/fvOptions/fvOption.C at line 93.

FOAM exiting


2022年12月19日月曜日 15:08:47 UTC+9 Cane:

ttsy shmz

nelasīta,
2022. gada 19. dec. 02:36:0719.12.22
uz open...@googlegroups.com
ttsy です

scalarCodedSourceのビルドに失敗して、そのsoがロードできていないために出ているかもしれませんね。

caseフォルダのdynamicCodeフォルダに入ってビルドがかかりますかね?

念の為、wmake libsoで上のビルドができます。

iPhoneから送信

2022/12/19 16:21、'Cane' via OpenFOAM <open...@googlegroups.com>のメール:


--
このメールは Google グループのグループ「OpenFOAM」に登録しているユーザーに送られています。
このグループから退会し、グループからのメールの配信を停止するには openfoam+u...@googlegroups.com にメールを送信してください。
このディスカッションをウェブ上で閲覧するには https://groups.google.com/d/msgid/openfoam/ce9b2e37-86df-4c89-9f2f-53d15aff9493n%40googlegroups.com にアクセスしてください。

Cane

nelasīta,
2022. gada 19. dec. 03:00:2119.12.22
uz OpenFOAM
ttsy様,ご返信大変感謝いたします.

現在の階層構造は以下のようになっており,ご指示いただいた通り,air1sourceディレクトリでwmake libsoをかけましたが,エラーは先ほどと同じでした.

├── dynamicCode
│   ├── air1source
│   │   ├── codedFvOptionTemplate.C
│   │   ├── codedFvOptionTemplate.H
│   │   ├── lnInclude
│   │   │   ├── codedFvOptionTemplate.C -> ../codedFvOptionTemplate.C
│   │   │   └── codedFvOptionTemplate.H -> ../codedFvOptionTemplate.H
│   │   └── Make
│   │       ├── files
│   │       ├── linux64GccDPInt32Opt
│   │       │   ├── codedFvOptionTemplate.C.dep
│   │       │   ├── codedFvOptionTemplate.o
│   │       │   ├── options
│   │       │   ├── sourceFiles
│   │       │   └── variables
│   │       ├── options
│   │       └── SHA1Digest
│   └── platforms
│       └── linux64GccDPInt32Opt
│           └── lib
│               └── libair1source_b243dd1e6407ebb2e014574026a16a935f01d9a4.so


もし何か他に思い当たることがありましたら教えていただけると幸いです.

2022年12月19日月曜日 16:36:07 UTC+9 LongGe:

ttsy shmz

nelasīta,
2022. gada 19. dec. 03:32:5019.12.22
uz open...@googlegroups.com
このディスカッションをウェブ上で閲覧するには https://groups.google.com/d/msgid/openfoam/3fe8bedb-2459-4a13-a926-4a71e462c7b5n%40googlegroups.com にアクセスしてください。

Cane

nelasīta,
2022. gada 19. dec. 04:46:0119.12.22
uz OpenFOAM
すみません,よくわからなかったのですが,mpi.hの絶対パスが"/usr/lib/x86_64-linux-gnu/openmpi/include/mpi.h"なので,
    codeOptions
    #{
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I/usr/lib/x86_64-linux-gnu/openmpi/include
    #};
と書くということでしょうか?
2022年12月19日月曜日 17:32:50 UTC+9 LongGe:
Atbildēt visiem
Atbildēt autoram
Pārsūtīt
0 jauni ziņojumi