CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

"Invalid line number" when compiling at runtime

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2019, 05:50
Default "Invalid line number" when compiling at runtime
  #1
New Member
 
gabriele centurelli
Join Date: Nov 2018
Posts: 3
Rep Power: 7
satter_partier is on a distinguished road
Hi to all,


I'm currently using the CINECA cluster to perform some heavy simulations,

Due to not better known reasons OpenFoam 5.0 was removed from the cluster and I had to use other versions installed (v17.. v18..).


My post process deeply relies on function objects and runtime calculations, everything was working five on the version 5, but fails in all the others.


The issue, in particular, happens any time a dynamic compilation is required at runtime, i.e. "#calc" in dictionaries or coded FO. The error is named "line error",
here below, part of the log running pimpleFoam on a classic tutorial with the unique modification of a #calc put in the transportDictionary.

Code:
Using #calc at line 22 in file "....../run/channel395/constant/transportProperties"
Using #codeStream with "......./run/channel395/dynamicCode/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"
Creating new library in "dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"
Invoking wmake libso ...../run/channel395/dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5
wmake libso ....../run/channel395/dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5
    ln: ./lnInclude
    dep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
codeStreamTemplate.C(61): error: invalid line number
          #line 0 ""
                ^

compilation aborted for codeStreamTemplate.C (code 2)
make: *** [Make/linux64IccDPInt32Opt/codeStreamTemplate.o] Error 2


--> FOAM FATAL IO ERROR: 
Failed wmake "dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"


file: ......./run/channel395/constant/transportProperties

    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 220.

FOAM exiting
The system calls operation are allowed, and on my local machine with the same versions of OpenFOAM everything behaves well.

I'm wondering if any of you may know the cause of such issue. Googling didn't provide much help, and the customer service from the cluster does not respond.

Best,
Gabriele

Last edited by satter_partier; July 3, 2019 at 05:46. Reason: language error
satter_partier is offline   Reply With Quote

Old   July 1, 2019, 04:17
Default
  #2
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 205
Rep Power: 16
t.teschner is on a distinguished road
switching from version 5.0 to 17/18 sounds like switching from the distribution provided by foundation (https://openfoam.org/) to the one provided by the esi group (https://openfoam.com/) ... function objects (at least according to my memory) used to be the same in both distribution but changed in the past few years in both distributions. the best advice i can offer is probably to check any tutorial on your local machine and check how the same tutorial is done in the other openfoam version (i.e. the one on the cluster). any differences should be visible in the tutorial files. that is, if any of the tutorials cover what you want to achieve ...
t.teschner is offline   Reply With Quote

Old   July 1, 2019, 04:52
Default
  #3
New Member
 
gabriele centurelli
Join Date: Nov 2018
Posts: 3
Rep Power: 7
satter_partier is on a distinguished road
Dear Tom,


thanks for the kind reply.
Sorry to not have been thoroughly clear. But exacty version 5.0 from the fundation and "v--" from the esi group.



Actually, there is no difference on the way function object should be formulated between these version.

Checking the source code, codedFunctionObject.H the reported example is the same.
I was also able to test on my machine with the version v18.12 and the compilation of my CFO gave no problem.
Thus i think the problem is not connected to the function obects, but to some issue in the compiler. Since it fails even when compiling run time calculation.
satter_partier is offline   Reply With Quote

Old   July 1, 2019, 08:45
Default
  #4
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14
einstein_zee is on a distinguished road
Quote:
Originally Posted by satter_partier View Post
Hi to all,


I'm currently using the CINECA cluster to perform some heavy simulations,

Due to not better known reasons OpenFoam 5.0 was removed from the cluster and I had to use other versions installed (v17.. v18..).


My post process deeply relies on function objects and runtime calculations, everything was working five on the version 5, but fails in all the others.


The issue, in particular, happens any time a dynamic compilation is required at runtime, i.e. "#calc" in dictionaries or coded FO. The error is named "line error",
here below, part of the log running pimpleFoam on a classic tutorial with the unique modification of a #calc put in the transportDictionary.

Code:
Using #calc at line 22 in file "....../run/channel395/constant/transportProperties"
Using #codeStream with "......./run/channel395/dynamicCode/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"
Creating new library in "dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"
Invoking wmake libso ...../run/channel395/dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5
wmake libso ....../run/channel395/dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5
    ln: ./lnInclude
    dep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
codeStreamTemplate.C(61): error: invalid line number
          #line 0 ""
                ^

compilation aborted for codeStreamTemplate.C (code 2)
make: *** [Make/linux64IccDPInt32Opt/codeStreamTemplate.o] Error 2


--> FOAM FATAL IO ERROR: 
Failed wmake "dynamicCode/_cfc4d58601dcd933810013f2a73aa94cc39c84f5/platforms/linux64IccDPInt32Opt/lib/libcodeStream_cfc4d58601dcd933810013f2a73aa94cc39c84f5.so"


file: ......./run/channel395/constant/transportProperties

    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 220.

FOAM exiting
The system calls operation are allowed, and on my local machine with the same versions of OpenFOAM anything behaves well.

I'm wondering if any of you may know the cause of such issue. Googling didn't provide much help, and the customer service from the cluster does not respond.

Best,
Gabriele
Hey there,

The easiest solution would be to compile OF 5.0 from source code in your cluster. For compiling from source you don't need root permissions...
einstein_zee is offline   Reply With Quote

Old   July 12, 2019, 19:47
Default
  #5
New Member
 
Charlie Barraud
Join Date: Jun 2016
Posts: 5
Rep Power: 9
choch is on a distinguished road
Hello Gabriele and all,

I know this thread is pretty new, but I run into the same problem. When trying to compile a "codeDict" boundary condition, an error appears which looks like yours:

HTML Code:
fixedValuePointPatchFieldTemplate.C(32): error: invalid line number
  #line 0 etc
Now, I went back using OpenFOAM/6.0, started the simulation lauching interDyMFoam (so far all went well) and stopped the simulation after a few time steps.

I went back loading OpenFOAM/v1812 and started the simulation directly with interFoam and... it started with no error !

That is obviously not a long term fix but it might be useful when waiting the response from the cluster service.

Cheers,

Charlie
choch is offline   Reply With Quote

Old   July 12, 2019, 21:12
Default
  #6
New Member
 
Charlie Barraud
Join Date: Jun 2016
Posts: 5
Rep Power: 9
choch is on a distinguished road
Hi again,

Actually to make it work you have to manually change .C file in dynamicCode/libraryFolder/fixedValuePointPatchFieldTemplate.C and change "#line 0" by the suitable line number.

Still not a good solution but it can be useful.
choch is offline   Reply With Quote

Old   July 16, 2019, 05:48
Default
  #7
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,713
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by choch View Post
Hi again,

Actually to make it work you have to manually change .C file in dynamicCode/libraryFolder/fixedValuePointPatchFieldTemplate.C and change "#line 0" by the suitable line number.

Still not a good solution but it can be useful.

This is what you are looking for (was fixed in the 1906 release).
https://develop.openfoam.com/Develop...us/issues/1282


The problem arose from trapping of 'not-found' entries. In OpenFOAM the line numbers start from 0, which are incremented by 1 when generating the pre-processor line directive. The line 0 is spurious output from when an entry is not found. It doesn't bother gcc or clang, but does rather upset the intel compiler.


Solution(s):
- upgrade to 1906
- use the maintenance-v1812 branch
- manually change the two lines within src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCodeContext.C (around line 120-130)
olesen is offline   Reply With Quote

Old   July 16, 2019, 06:01
Default
  #8
New Member
 
gabriele centurelli
Join Date: Nov 2018
Posts: 3
Rep Power: 7
satter_partier is on a distinguished road
Thanks to everyone for the kind replies.


Eventually the customer service responded and the issues on the cluster i mentioned seem gone to me. But it's good to know the reason of the problem and a temporary fix.
satter_partier is offline   Reply With Quote

Reply

Tags
cineca, coded function object, dynamic compilation

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 15:16


All times are GMT -4. The time now is 21:23.