CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Error running #codeStream/functions wmake lnInclude fails to open *.H Files (https://www.cfd-online.com/Forums/openfoam-installation/164535-error-running-codestream-functions-wmake-lninclude-fails-open-h-files.html)

tarik December 24, 2015 15:56

Error running #codeStream/functions wmake lnInclude fails to open *.H Files
 
Hello!
This is my first post on the forum and it's a pleasure to meet you all.

Currently i'm running OpenFoam 3.0.1 built with gcc 5.3 flex 2.5.35 on an Arch system (Linux 4.2.5-1ARCH x86_64). When i tried to run the $FOAM_RUN/tutorials/basic/potentialFoam/cylinder case i came across two problems. First was i was getting an error when running blockMesh due to the #codeStream code in the blockMeshDict file (could not open file dictionary.H etc... fatal error dictionary.H no such file or directory). I changed that file writing the vertices mannually to get rid of that code portion. But then when running
Code:

potentialFoam -withFunctionObjects -writePhi -writep
(as written in the Allrun script) I get pretty much the same error, i.e. Could not open files stringList.H, pointField.H, fvCFD.H, etc. Here's the output:

Code:

[tarik@arch cylinder]$ potentialFoam -withFunctionObjects -writePhi -writep
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 3.0.0-6abec57f5449
Exec  : potentialFoam -withFunctionObjects -writePhi -writep
Date  : Dec 24 2015
Time  : 15:07:06
Host  : "arch"
PID    : 18856
Case  : /home/tarik/OpenFOAM/tarik-3.0.0/run/tutorials/basic/potentialFoam/cylinder
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


potentialFlow: Operating solver in PISO mode

Reading velocity field U

Constructing pressure field p

Constructing velocity potential field Phi

No MRF models present

No finite volume options present


Calculating potential flow
Using dynamicCode for functionObject difference at line 53 in "/home/tarik/OpenFOAM/tarik-3.0.0/run/tutorials/basic/potentialFoam/cylinder/system/controlDict.functions.difference"
Creating new library in "dynamicCode/error/platforms/linux64GccDPInt32Opt/lib/liberror_e92448da6ae10bc777e0869670f72a48fd0673f1.so"
Invoking "wmake -s libso /home/tarik/OpenFOAM/tarik-3.0.0/run/tutorials/basic/potentialFoam/cylinder/dynamicCode/error"
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file FilterFunctionObjectTemplate.C
could not open file stringList.H for source file FilterFunctionObjectTemplate.C due to No such file or directory
could not open file pointField.H for source file FilterFunctionObjectTemplate.C due to No such file or directory
could not open file OutputFilterFunctionObject.H for source file FilterFunctionObjectTemplate.C due to No such file or directory
Making dependency list for source file functionObjectTemplate.C
could not open file stringList.H for source file functionObjectTemplate.C due to No such file or directory
could not open file pointField.H for source file functionObjectTemplate.C due to No such file or directory
could not open file Time.H for source file functionObjectTemplate.C due to No such file or directory
could not open file fvCFD.H for source file functionObjectTemplate.C due to No such file or directory
could not open file unitConversion.H for source file functionObjectTemplate.C due to No such file or directory
In file included from functionObjectTemplate.C:26:0:
functionObjectTemplate.H:36:24: fatal error: stringList.H: No such file or directory
compilation terminated.
/opt/OpenFOAM/OpenFOAM-3.0.0/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/functionObjectTemplate.o' failed
make: *** [Make/linux64GccDPInt32Opt/functionObjectTemplate.o] Error 1


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


file: /home/tarik/OpenFOAM/tarik-3.0.0/run/tutorials/basic/potentialFoam/cylinder/system/controlDict.functions.difference from line 53 to line 58.

    From function codedBase::createLibrary(..)
    in file db/dynamicLibrary/codedBase/codedBase.C at line 213.

FOAM exiting

Tried using flex 2.6 which fails to build and 2.5.39 which does work but doesn't solve the problem, so i kept 2.5.35. Followed a similar error on a thread here which recommended changing $WM_PROJECT_DIR/wmake/rules/general/sourceToDep from wmkdep to wmkdepend, but unfortunately my installation doesn't have sourceToDep nor wmkdepend files. Also couldn't find it on the git page so i'm assuming their absence is not the real problem. Running as root didn't work either (it fails to open libfiniteVolume.so, but i don't think i was supposed to run as root anyway). I don't have a clue of what to try. Has anyone had some similar troubles or may have any idea i might give a try?

wyldckat December 25, 2015 14:46

Greetings Tarik and welcome to the forum!

Something isn't right... either you have two conflicting versions of OpenFOAM installed, where 3.0.0 is possibly not completely installed, or you meant to write that you had installed OpenFOAM 3.0.0 and not 3.0.1.

Because according to the output you've provided from the solver, all sings point to OpenFOAM 3.0.0. The problem is that the "lnInclude" folders don't seem to be populated. I don't know how exactly you installed OpenFOAM in your machine, but I would suggest that you switch into installation mode and run the following commands:
Code:

cd $WM_PROJECT_DIR
wmakeLnIncludeAll

Then you should be able to use the "#codeStream" feature.

Best regards,
Bruno

tarik December 26, 2015 23:15

That worked perfectly. Tested in 3 different cases and everything is working! Thanks!!

Edit: Forgot to mention I also checked my openfoam version. It is indeed ver 3.0.0. But my package manager says 3.0.0-2 which I kind of read wrong.

cfd@kgp December 12, 2016 00:12

buoyantPimpleFoam fails with -withFunctionObjects
 
I am trying to create a new field "mag(U)" using coded function and compute_ptot using swak4foam. here is extract from controlDict addded to the "hotRoom" turorial for buoyantPimpleFoam,

Quote:

functions
{
compute_ptot
{
functionObjectLibs ( "libutilityFunctionObjects.so" );
type coded;
// enabled true;
redirectType ptot;
outputControl outputTime;
// outputInterval 1;
code
#{

const volVectorField& U = mesh().lookupObject<volVectorField>("U");
volScalarField mymagu
(
IOobject
(
"mymagu",
mesh().time().timeName(),
U.mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mag(U)
);
mymagu.write();

#};
}

compute_ptot
{
type expressionField;
outputControl outputTime;
outputInterval 1;
fieldName ptot;
expression "(mag(U))";
autowrite true;
}
};
with following libraries

Quote:

libs (


"libsimpleSwakFunctionObjects.so"


"libswakFunctionObjects.so"


);
In both the method I can see the output files of the variables "mymagu" and "compute_ptot", but they are not readable in paraview.
Quote:



Quote:
buoyantPimpleFoam -withFunctionObjects
produces following error,

Quote:


Usage: buoyantPimpleFoam [OPTIONS]
options:
-case <dir> specify alternate case directory, default is the cwd
-noFunctionObjects
do not execute functionObjects
-parallel run in parallel
-roots <(dir1 .. dirN)>
slave root directories for distributed running
-srcDoc display source code in browser
-doc display application documentation in browser
-help print the usage

Using: OpenFOAM-3.0.1 (see www.OpenFOAM.org)
Build: 3.0.1-18e358711b4e



--> FOAM FATAL ERROR:
Invalid option: -withFunctionObjects


FOAM exiting

Is this a bug in openfoam or I am making some mistake?:eek:

Please help :(:confused:

Thanks and regards.

wyldckat December 13, 2016 09:58

Quick answer: I see that you reported this as a bug: https://bugs.openfoam.org/view.php?id=2385 - and it's not a bug.
The original post here refers to potentialFoam, not buoyantPimpleFoam. This means that you don't need to use any additional option like potentialFoam did.

amuzeshi November 7, 2019 10:05

Quote:

Originally Posted by wyldckat (Post 578669)
Greetings Tarik and welcome to the forum!

Something isn't right... either you have two conflicting versions of OpenFOAM installed, where 3.0.0 is possibly not completely installed, or you meant to write that you had installed OpenFOAM 3.0.0 and not 3.0.1.

Because according to the output you've provided from the solver, all sings point to OpenFOAM 3.0.0. The problem is that the "lnInclude" folders don't seem to be populated. I don't know how exactly you installed OpenFOAM in your machine, but I would suggest that you switch into installation mode and run the following commands:
Code:

cd $WM_PROJECT_DIR
wmakeLnIncludeAll

Then you should be able to use the "#codeStream" feature.

Best regards,
Bruno

Dear Bruno,
I am writing to ask a question about this tutorial on codeStream.
After executing icoFoam, I received an error, the main part of which is
Code:

fatal error: fvCFD.H: No such file or directory
The whole output is in the following. I examined it under of6 and of7 unsuccessfully.
I would appreciate if you could help solving this problem.

Best Regards,
Ali

Code for codeStream:
Code:

    velocity-inlet-5
    {
        type            fixedValue;
        value          #codeStream
        {
            codeInclude
            #{
                #include "fvCFD.H"
            #};

            codeOptions
            #{
                -I$(LIB_SRC)/finiteVolume/lnInclude \
                -I$(LIB_SRC)/meshTools/lnInclude
            #};

                //libs needed to visualize BC in paraview
                codeLibs
                #{
                -lmeshTools \
                -lfiniteVolume
                #};
...

icoFoam output:
Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7-109ba3c8d53a
Exec  : icoFoam
Date  : Nov 07 2019
Time  : 18:27:09
Host  : "soha"
PID    : 27707
I/O    : uncollated
Case  : /home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Using #codeStream at line 33 in file "/home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/0/U.boundaryField.velocity-inlet-5"
Using #codeStream with "/home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_8e7d2492166cb8f6513bf377941d8d0987def757.so"
Invoking "wmake -s libso /home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/dynamicCode/_8e7d2492166cb8f6513bf377941d8d0987def757"
wmake libso /home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/dynamicCode/_8e7d2492166cb8f6513bf377941d8d0987def757
    Ctoo: codeStreamTemplate.C
/home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/0/U.boundaryField.velocity-inlet-5.#codeStream:37:11: fatal error: fvCFD.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPInt32Opt/codeStreamTemplate.o] Error 1
/opt/openfoam7/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/codeStreamTemplate.o' failed


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


file: /home/ali/OpenFOAM/ali-7/run/3weeks/11/programming1/2Delbow_UparabolicInlet/0/U.boundaryField.velocity-inlet-5 from line 32 to line 32.

    From function static void (* Foam::functionEntries::codeStream::getFunction(const Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&)
    in file db/dictionary/functionEntries/codeStream/codeStream.C at line 218.

FOAM exiting


rigid42 February 21, 2020 12:19

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : _f3950763fe-20191219 OPENFOAM=1912
Arch : "LSB;label=32;scalar=64"
Exec : blockMesh
Date : Feb 21 2020
Time : 18:13:17
Host : DESKTOP-G42P1AL
PID : 4074
I/O : uncollated
Case : /home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from "system/blockMeshDict"
Using #codeStream at line 19 in file "/home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/system/blockMeshDict"
Using #codeStream with "/home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/dynamicCode/platforms/linux64Gcc63DPInt32Opt/lib/libcodeStream_6edbd5c787a632d4d115e6ab6424ed259ef3 77d6.so"
Could not load "/home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/dynamicCode/platforms/linux64Gcc63DPInt32Opt/lib/libcodeStream_6edbd5c787a632d4d115e6ab6424ed259ef3 77d6.so"
/home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/dynamicCode/platforms/linux64Gcc63DPInt32Opt/lib/libcodeStream_6edbd5c787a632d4d115e6ab6424ed259ef3 77d6.so: cannot open shared object file: No such file or directory
Invoking wmake libso /home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/dynamicCode/_6edbd5c787a632d4d115e6ab6424ed259ef377d6
wmake libso /home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/dynamicCode/_6edbd5c787a632d4d115e6ab6424ed259ef377d6
Ctoo: codeStreamTemplate.C
In file included from /home/raviteja/OpenFOAM/ThirdParty-v1912/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/x86_64-pc-linux-gnu/bits/c++config.h:507:0,
from /home/raviteja/OpenFOAM/ThirdParty-v1912/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/type_traits:38,
from /home/raviteja/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dictionary.H:91,
from codeStreamTemplate.C:31:
/home/raviteja/OpenFOAM/ThirdParty-v1912/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/x86_64-pc-linux-gnu/bits/os_defines.h:39:22: fatal error: features.h: No such file or directory
#include <features.h>
^
compilation terminated.
/home/raviteja/OpenFOAM/OpenFOAM-v1912/wmake/rules/General/transform:34: recipe for target '/home/raviteja/OpenFOAM/OpenFOAM-v1912/build/linux64Gcc63DPInt32Opt/run/cylinder/dynamicCode/_6edbd5c787a632d4d115e6ab6424ed259ef377d6/codeStreamTemplate.o' failed
make: *** [/home/raviteja/OpenFOAM/OpenFOAM-v1912/build/linux64Gcc63DPInt32Opt/run/cylinder/dynamicCode/_6edbd5c787a632d4d115e6ab6424ed259ef377d6/codeStreamTemplate.o] Error 1


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_6edbd5c787a632d4d115e6ab6424ed259ef377d6/platforms/linux64Gcc63DPInt32Opt/lib/libcodeStream_6edbd5c787a632d4d115e6ab6424ed259ef3 77d6.so"


file: /home/raviteja/OpenFOAM/OpenFOAM-v1912/run/cylinder/system/blockMeshDict

From function static void (* Foam::functionEntries::codeStream::getFunction(con st Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 202.

FOAM exiting


Hie Bruno, I have tried the code you posted but i wasn't able to shake off the error. can you please guide me out it.
thanks & regards
ravi

pranavbahldce@gmail.com June 13, 2020 22:31

Did you find the answer ? Please let me know I am encountering a similar problem

amuzeshi June 14, 2020 03:12

Quote:

Originally Posted by pranavbahldce@gmail.com (Post 774297)
Did you find the answer ? Please let me know I am encountering a similar problem

Are you refering to my question?


All times are GMT -4. The time now is 11:40.