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

Compilation error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 8, 2014, 16:52
Default Compilation error
  #1
Member
 
India
Join Date: Oct 2012
Posts: 84
Rep Power: 4
mayank.dce2k7 is on a distinguished road
Hi Foamers,

I copied icoFoam solver folder from /opt/openfoam222/applications/solvers/incompressible/icoFoam and placed it in my working directory. I made following changes:

1.) Renamed icoFoam folder to micoFoam
2.) Renamed icoFoam.C to micoFoam.C
3.) In Make/files changed icoFoam.C to micoFoam.C
and also changed FOAM_APPBIN/icoFoam to FOAM_USER_APPBIN/micoFoam

I went inside micoFoam directory and typed wmake. I got the following error:

Making dependency list for source file micoFoam.C
SOURCE=micoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/finiteVolume/lnInclude -I/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/sampling/lnInclude -IlnInclude -I. -I/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude -I/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/OSspecific/POSIX/lnInclude -I/usr/local/apps/foam/gnu44ThirdParty-2.1.1/ParaView-3.14.1-Linux-64bit/bin/include/paraview- -fPIC -c $SOURCE -o Make/linux64Gcc45DPOpt/micoFoam.o
/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’
/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’
/usr/local/apps/OpenFOAM/gcc454-2.2.2/OpenFOAM-2.2.2/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’
mkdir: `': No such file or directory
make: *** [/micoFoam] Error 1

I don't understand the last two line:

mkdir: `': No such file or directory
make: *** [/micoFoam] Error 1


when i compiled above 'micoFoam' on my laptop it compiled. Now I am compiling it on cluster and it is giving me above error. Any ideas what is lacking?

Regards,
Mayank
mayank.dce2k7 is offline   Reply With Quote

Old   April 8, 2014, 20:56
Default
  #2
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 84
Rep Power: 3
chrisb2244 is on a distinguished road
I'm guessing your compiler might be problematic?

I haven't seen the error before, but from the path you have I assume you have gcc 4.5.4, and according to the OF website,

"The GCC compiler may need to be upgraded to version 4.7 or higher, a requirement for OpenFOAM. "

http://www.openfoam.org/download/source.php

It might be that when you compiled OF on the cluster, it had some errors making relevant parts of the wmake system? I'm not sure, just a thought.
chrisb2244 is offline   Reply With Quote

Old   April 9, 2014, 00:02
Default
  #3
Member
 
India
Join Date: Oct 2012
Posts: 84
Rep Power: 4
mayank.dce2k7 is on a distinguished road
Thanks Christian. I was also thinking on the same lines. I will get the compiler version updated and let you know.
mayank.dce2k7 is offline   Reply With Quote

Old   April 9, 2014, 16:23
Default
  #4
Member
 
India
Join Date: Oct 2012
Posts: 84
Rep Power: 4
mayank.dce2k7 is on a distinguished road
Hi Christian,

I guess compiler is not the problem on the link you provided if you scroll down, you will find following lines written under 'CHECKING THE SYSTEM':

"The default compiler for OpenFOAM is GCC. OpenFOAM v2.2 series will only compile with versions of GCC above 4.5.0."

I have GCC-4.5.4 so compiler version should not be a problem.

Any other ideas?
mayank.dce2k7 is offline   Reply With Quote

Old   April 10, 2014, 00:51
Default
  #5
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 84
Rep Power: 3
chrisb2244 is on a distinguished road
What do you have in your Make/files file?

In particular, where is it trying to put your application?

My next guess is that you're trying to compile it as/to $FOAM_USER_APPBIN/micoFoam, and that if you type

Code:
 echo $FOAM_USER_APPBIN
you'll get a blank line of output - ie the directory doesn't exist.

So whilst I'm not very confident this is your issue, it's possible that your user directories for the output of your compilation doesn't exist, and then mkdir can't make the relevant directory to store it because it is multiple directories down a non-existent hierarchy.

As a quick check, try using
Code:
 EXE = $(FOAM_APPBIN)/micoFoam
and storing it with the default OF applications (unless you disabled write access to your applications dir, in which case pick somewhere else you know exists!

Best,
Christian
chrisb2244 is offline   Reply With Quote

Old   April 10, 2014, 01:59
Default
  #6
Member
 
India
Join Date: Oct 2012
Posts: 84
Rep Power: 4
mayank.dce2k7 is on a distinguished road
Hey Christian,

I solved the problem. I dunno how OF-2.2.2 was installed on the cluster by the administrator, it was not recognizing the environment variable "FOAM_USER_APPBIN". As soon as I realized this, I set the environment variable as below:

Code:
setenv FOAM_USER_APPBIN  /share/mvaish/OpenFOAM/mvaish-2.2.2/platforms/linux64GccDPOpt/bin
Now, the code micoFoam.C was successfully compiled and I can see it in 'bin' folder.
But now I have a new problem.......although the micoFoam.C has compiled but when I tried running it on cavity tutorial from my home directory ' /share/mvaish/OpenFOAM/mvaish-2.2.2/run/cavity' I got the error message:

Code:
micoFoam: Command not found
Any thoughts ?

Best,
Mayank
mayank.dce2k7 is offline   Reply With Quote

Old   April 10, 2014, 02:19
Default Add it to your $PATH :)
  #7
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 84
Rep Power: 3
chrisb2244 is on a distinguished road
relog into your cluster

I'm guessing you source the OF bashrc file through some sort of .profile file?

etc/bashrc will add the $FOAM_USER_APPBIN to your $PATH, but if you didn't set $FOAM_USER_APPBIN before bashrc was sourced, it won't be on your $PATH.

As such, you need to make sure you set the environment variable $FOAM_USER_APPBIN, and then source the bashrc file afterwards. (Comparable instructions for whatever the csh/ksch files are - I haven't used these but I'm guessing you might be from your setenv command.)

Best,

Christian
chrisb2244 is offline   Reply With Quote

Old   May 9, 2014, 16:28
Default
  #8
New Member
 
Gareth
Join Date: Jun 2010
Posts: 20
Rep Power: 7
bullmut is on a distinguished road
Hi Guys
A relative newbie to OpenFoam here, but -
I am having the same problem as initially reported in this thread.

"~/OpenFOAM/gareth-2.2.2/applications/myIcoFoam$ wmake
Making dependency list for source file myIcoFoam.C
SOURCE=myIcoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam222/src/finiteVolume/lnInclude -I/opt/openfoam222/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam222/src/OpenFOAM/lnInclude -I/opt/openfoam222/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/myIcoFoam.o
In file included from myIcoFoam.C:53:0:
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
/opt/openfoam222/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
mkdir: cannot create directory ‘’: No such file or directory
make: *** [/myIcoFoam] Error 1 "

After following the original advice i also found my $FOAM_USER_APPBIN to be non-existent.
I created then created the folder
:~/OpenFOAM/gareth-2.2.2$ cd platforms/linux64GccDPOpt/bin

and went back to my folder to re use wmake...
this gave me the same error

Any help on this would greatly help.

Thanks
bullmut is offline   Reply With Quote

Old   May 10, 2014, 06:29
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Gareth:
I'll need a bit more information, in order to deduce what the problem might be:
  1. Which Linux Distribution and version are you using?
  2. Which installation instructions did you follow? And did you do anything differently from those instructions?
  3. Which shell are you using? Namely: Dash, Bash, CSH, TCSH or any other?
  4. What is the content of the file "Make/files" you have in your customized solver?
I ask all of this, because these details will let us know what is the critical detail that is missing and leading to this specific error.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   May 10, 2014, 06:45
Default info
  #10
New Member
 
Gareth
Join Date: Jun 2010
Posts: 20
Rep Power: 7
bullmut is on a distinguished road
Hi Bruno

To answer your questions:

1) I am on ubuntu 13.04
2) The installation is .. well i cant recall exactly, as i installed it a while back, but i dont recall deviating from the instructions. I used the install instructions from this site http://www.openfoam.org/download/ubuntu.php
(side - i can run the tuts, have run my own models, and it all works...)
3)when i sheck $SHELL the reply is /bin/bash,
4) as to the content of "make/files"
"myIcoFoam.C

EXE = $(FOAM_USER_APPBIN)/myIcoFoam"

Sorry my knowledge of linux is limited and i am basically picking things up as i go

Thanks

Gareth
bullmut is offline   Reply With Quote

Old   May 10, 2014, 07:05
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Gareth,

OK, try the following steps:
  1. Run this command, to check if the environment variable is properly defined:
    Code:
    echo $FOAM_USER_APPBIN
    It should give you the full path to the folder you tried to create.
  2. If the previous step worked, then try:
    Code:
    mkdir -p $FOAM_USER_APPBIN
    It should either be:
    • successful and give no message;
    • or tell you that the folder already exists;
    • or that it didn't have enough permissions. This last one would be a problem.
  3. If the previous two steps worked fine, then edit the file "Make/files" and delete the text "_USER_" and write it again manually. I ask this because sometimes copy-paste will not work the way you think. For example in this case, it would because the original text had in fact a different symbol instead of the standard underscore.
    Then run in the command line:
    Code:
    wclean
    wmake
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   May 10, 2014, 07:09
Default
  #12
New Member
 
Gareth
Join Date: Jun 2010
Posts: 20
Rep Power: 7
bullmut is on a distinguished road
@Bruno

I had the right folder in place.. but deleted it and started again with the mkdir command as you suggested. I cant explain it but, it worked fine.. thanks

Not sure on the difference but it works and i can work on.
hehe
bullmut is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Native ParaView Reader Bugs tj22 OpenFOAM Paraview & paraFoam 266 July 1, 2015 02:00
blockMesh with double grading. spwater OpenFOAM Native Meshers: blockMesh 78 March 12, 2015 15:54
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 58 November 12, 2014 14:51
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38


All times are GMT -4. The time now is 00:25.