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

error when compile a new solver on version 4.1

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2017, 13:23
Default error when compile a new solver on version 4.1
  #1
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Dear,
I have have met a problem in version 4.1.0 on a cluster to compile a new solver.
Code:
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude -I/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/meshTools/lnInclude -IlnInclude -I. -I/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude -I/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OSspecific/POSIX/lnInclude -fPIC -c myIcoFoam.C -o Make/linux64GccDPInt32Opt/myIcoFoam.o
In file included from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/sphericalTensor.H:39,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/fieldTypes.H:36,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/flipOp.H:40,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/mapDistributeBaseTemplates.C:29,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/mapDistributeBase.H:488,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.C:30,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Field.H:405,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/scalarField.H:38,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionSet.H:46,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedType.H:40,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/dimensionedScalar.H:38,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/TimeState.H:38,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Time.H:47,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:6,
                 from myIcoFoam.C:32:
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Identity.H:80: error: only declarations of constructors can be 'explicit'
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/Identity.H:86: error: only declarations of constructors can be 'explicit'
In file included from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:7,
                 from myIcoFoam.C:32:
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvMesh.H:381: error: using 'typename' outside of template
In file included from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvc.H:39,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from myIcoFoam.C:32:
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:262: error: using 'typename' outside of template
In file included from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:29,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvc.H:39,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from myIcoFoam.C:32:
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/geometricOneField.H:88: error: using 'typename' outside of template
In file included from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/geometricOneField.H:137,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:29,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvc.H:39,
                 from /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from myIcoFoam.C:32:
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/geometricOneFieldI.H:68: error: using 'typename' outside of template
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/geometricOneFieldI.H: In member function 'Foam::oneField Foam::geometricOneField::primitiveField() const':
/cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/src/OpenFOAM/lnInclude/geometricOneFieldI.H:71: error: using 'typename' outside of template
make: *** [Make/linux64GccDPInt32Opt/myIcoFoam.o] Error 1
The procedure is like this:
Code:
	1. module load openmpi/gcc/64/1.4.4
   source /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/etc/bashrc
2. mkdir -p /home/ywang005/run
2. cp -r $FOAM_SOLVERS/incompressible/icoFoam /home/ywang005/run
3. cd /home/ywang005/run/icoFoam 
4. mv icoFoam myIcoFoam 
5. cd myIcoFoam
6. mv icoFoam.C myIcoFoam.C 
   rm icoFoam.dep 
7. sed -i s/icoFoam/myIcoFoam/g myIcoFoam.C
8. sed -i s/icoFoam/myIcoFoam/g Make/files
9.Make/files EXE= $(FOAM_APPBIN)/myIcoFoam EXE= $(FOAM_USER_APPBIN)/myIcoFoam
10.rm -rf linuxGccDPOpt
11. wclean
     wmake 
12. After modification in the new solver, wmake again.
I have attached the new solver files. Actually, I did not make any modifications only renamed the icoFoam into myIcoFoam.
Any suggestion would be appreciated.
Thank you in advance.
Best Regards,
Bill
Attached Files
File Type: zip myIcoFoam.zip (7.3 KB, 8 views)
6863523 is offline   Reply With Quote

Old   February 11, 2017, 07:30
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Could you post output of

Code:
g++ --version
after you do

Code:
source /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/etc/bashrc
Since error is located in OpenFOAM sources, my guess is "incompatible compiler version".
alexeym is offline   Reply With Quote

Old   February 11, 2017, 09:40
Default gcc version
  #3
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

Could you post output of

Code:
g++ --version
after you do

Code:
source /cm/shared/contrib/apps/openfoam/4.1/OpenFOAM-4.1/etc/bashrc
Since error is located in OpenFOAM sources, my guess is "incompatible compiler version".
Code:
$ gcc --version
gcc (GCC) 4.4.6
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (GCC) 4.4.6
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thank you in advance.
Any info needed, please let me know.
Best Regards,
Bill
6863523 is offline   Reply With Quote

Old   February 11, 2017, 13:40
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Take a look at

http://openfoam.org/download/source/...r-compilation/

The first requirement:

Quote:
Compiler: either GCC version 4.5 or above; or LLVM Clang version 3.6 or above; or Intel ICC version 15.0.3 or above.
6863523 likes this.
alexeym is offline   Reply With Quote

Old   February 11, 2017, 14:07
Default
  #5
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Take a look at

http://openfoam.org/download/source/...r-compilation/

The first requirement:
Thanks for the link.
I will post here if I solved my problem.
I am really appreciated for your kind help.
6863523 is offline   Reply With Quote

Old   February 13, 2017, 12:32
Default
  #6
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Take a look at

http://openfoam.org/download/source/...r-compilation/

The first requirement:
Dear,
I have load the module gcc/4.8.2 and there is no error any more for the compilation.
But when I use the new solver, there is this error
Code:
'functions' entry is not a dictionary

file: /home/ywang005/run/UC/Re29000/system/controlDict from line 18 to line 106.

    From function bool Foam::functionObjectList::read()
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 582.

FOAM exiting
I have tested with built-in icoFoam solver, it works fine;
I have tested the new solver with another version 3.0.1 with the same procedure, there is no such error;
Could you please help me out on this?
Thank you in advance.
6863523 is offline   Reply With Quote

Old   February 13, 2017, 16:06
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Do I get you right:

- if you execute stock icoFoam, your case works.
- if you take stock icoFoam, rename it into myIcoFoam, recompile, you case stops working.

Looks quite strange. Yet, the error explains itself: functions should be dictionary. Since you did not post your case, there is nothing to add.
alexeym is offline   Reply With Quote

Old   February 20, 2017, 04:20
Default
  #8
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Sorry about the delay. But I was on a trip.
Yes, Mr. Matveichev. This is totally what I mean.
I have tried to upload my case files, but it is larger than the limit.
Attached is the controlDict file which include the "function" problem.
Thank you in advance.
Attached Files
File Type: txt controlDict.txt (2.3 KB, 5 views)

Last edited by 6863523; February 20, 2017 at 05:02. Reason: wrong files
6863523 is offline   Reply With Quote

Old   February 20, 2017, 05:10
Default after deleting the functions part in controlDict file
  #9
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
I have tested that the problem occurs when I use the functions in controlDict.
There is a difference of the functions part for version 3.0.1 and 4.x.

In addition, after deleting the functions part in controlDict file, I am able to run my case with the command myIcoFoam.
However, when I run the bash script with the command
Code:
$ chmod +x UCRe29000.sh
$ sh ./UCRe29000.sh
it does not run, I have put the script under the working directory.
Attached is the bash script.
Any suggestion is appreciated.
Thank you in advance.
Attached Files
File Type: txt UCRe29000.txt (548 Bytes, 4 views)
6863523 is offline   Reply With Quote

Old   February 20, 2017, 08:37
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. I do not have 3.0.x installed, so I can not check if there were any changes in function description syntax. Yet OpenFOAM explain the error to you:

Code:
'functions' entry is not a dictionary
You have functions in your controlDict as a list, it must be dictionary. See examples in tutorials.

2. Did not understands your problem with shell file. Any way it is easier and more effective to ask cluster admins to help with your cluster.
alexeym is offline   Reply With Quote

Old   February 20, 2017, 09:17
Default
  #11
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

1. I do not have 3.0.x installed, so I can not check if there were any changes in function description syntax. Yet OpenFOAM explain the error to you:

Code:
'functions' entry is not a dictionary
You have functions in your controlDict as a list, it must be dictionary. See examples in tutorials.

2. Did not understands your problem with shell file. Any way it is easier and more effective to ask cluster admins to help with your cluster.
Dear Mr. Matveichev,
I somehow find that for version 3.0.1, the "functions" in controlDict is followed by "()", however, for version 4.x, it is followed by "{}".
2. I have contacted the cluster admins in our lab, it seems that they have no experience with such problems, since they never used OpenFOAM. Do you happen to know some experts in this forum and recommend to me?
Thank you in advance.
Best Regards,
Bill
6863523 is offline   Reply With Quote

Old   February 20, 2017, 09:33
Default
  #12
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
1. I do not know, where did you find YOUR controlDict, yet in 3.0.x functions is also dictionary, example: https://github.com/OpenFOAM/OpenFOAM...ontrolDict#L49

2. First you can try to explain in more details: what you are trying to achieve and what is the error. Current

Code:
it does not run, I have put the script under the working directory.
Is obviously not enough.
alexeym is offline   Reply With Quote

Old   February 20, 2017, 10:04
Default
  #13
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
1. The controlDict file was used for version 2.2.0, but even if I used it on version 3.0.1, there is no error information and the results are good.
However, it does not work for version 4.x.
2. I am trying to execute the bash script to start the simulation. The commands to execute the shell script are listed at #9. However, after the commands, the case is reluctant to run.
Code:
[ywang005@avakas-frontend2 Re29000]$ chmod +x UCRe29000.sh
[ywang005@avakas-frontend2 Re29000]$ sh ./UCRe29000.sh
If it runs normally, it should decompose the case and generate the processor directories.
Any info needed, please let me know.
Thank you in advance.
6863523 is offline   Reply With Quote

Old   February 20, 2017, 10:34
Default
  #14
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
1. In 3.0.x there was piece of fallback code for functions in a list. In 4.x this piece was removed.

2. You are still playing the game "hey, guess, what I have done wrong!".

Quote:
However, after the commands, the case is reluctant to run.
Can mean anything. What is error message?
alexeym is offline   Reply With Quote

Old   February 20, 2017, 10:51
Default
  #15
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
1. In 3.0.x there was piece of fallback code for functions in a list. In 4.x this piece was removed.

2. You are still playing the game "hey, guess, what I have done wrong!".



Can mean anything. What is error message?
Sorry for the misunderstanding.
There is no error information.
Like what I said in my previous post, the case should be decomposed and there should be processor directories, since the parallel running command is included in the script.
But after executing the commands, no new files are generated. This is how I judge it is reluctant to run. Or maybe there are ways to determine the case is running or not.
6863523 is offline   Reply With Quote

Old   February 20, 2017, 10:56
Default
  #16
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
And why do you think, that your case is executed immediately and is not placed into the queue?
6863523 likes this.
alexeym is offline   Reply With Quote

Old   February 20, 2017, 11:02
Thumbs up
  #17
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
And why do you think, that your case is executed immediately and is not placed into the queue?
Awesome answer!!!
I will test and post here once the case starts to run.
Thank you for your patience and help.
Have a good day!
6863523 is offline   Reply With Quote

Old   February 20, 2017, 11:15
Default
  #18
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Code:
[ywang005@avakas-frontend1 ~]$ qstat -t -u $USER

master.cm.cluster:
                                                                         Req'd  Req'd   Elap
Job ID               Username Queue    Jobname          SessID NDS   TSK Memory Time  S Time
-------------------- -------- -------- ---------------- ------ ----- --- ------ ----- - -----
5802151.master.c     ywang005 visu     simple-turbovnc.  93259     1   1    --  23:59 R 04:53
[ywang005@avakas-frontend1 ~]$
I used the command
Code:
qstat -t -u $USER
to list all my array jobs and the subcomponents and their states.
But the job of the bash script is not included.
6863523 is offline   Reply With Quote

Old   February 20, 2017, 11:25
Default
  #19
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

1. I do not have 3.0.x installed, so I can not check if there were any changes in function description syntax. Yet OpenFOAM explain the error to you:

Code:
'functions' entry is not a dictionary
You have functions in your controlDict as a list, it must be dictionary. See examples in tutorials.

2. Did not understands your problem with shell file. Any way it is easier and more effective to ask cluster admins to help with your cluster.
I have contacted Henry, and this is his answer:
HTML Code:
OpenFOAM-3.0.1 supports the very old list format for backward compatibility but the recommended and documented format is the newer and more flexible dictionary format.

In OpenFOAM-4.? the old list format is no longer supported due to the maintenance overhead of indefinite backward compatibility.
Hope it may help someone else.
6863523 is offline   Reply With Quote

Old   February 21, 2017, 06:10
Default
  #20
Senior Member
 
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12
6863523 is on a distinguished road
The function error part has been solved, as seen
how to calculate the volume averaged values in version 4.1

The only left problem is how to execute the bash script.
Thank you in advance.
Best,
Bill
6863523 is offline   Reply With Quote

Reply


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
Unable to compile solver hwsv07 OpenFOAM Programming & Development 10 February 21, 2018 10:41
Hybrid discretisation - blend factor gcoopermax CFX 5 September 23, 2016 09:05
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 08:11
bubbleFoam validation case balkrishna OpenFOAM Running, Solving & CFD 24 August 30, 2010 05:37
How to compile an unsteady solver based on solver of MRFSimpleFoam? renyun0511 OpenFOAM Running, Solving & CFD 0 April 27, 2010 12:16


All times are GMT -4. The time now is 18:05.