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

Compiling Makeoptions

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 12, 2007, 08:38
Default Dear all, I'm using OF ver
  #1
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
Dear all,

I'm using OF ver 1.3 and I got into a problem related to compilation of a modified source file. I've been searching for relevant threads here and I found many tips that I thought might solve my problem, but in fact I haven't got the compiling right.

Before doing more substantial change of a solver, I just simply want to see if I can compile a slightly-modified source correctly and can observe the change in FoamX. So I chose to modify icoFoam, as follows:

(1) I added Info syntax into "createFields.H":

Info<< "Testing Here !!\n" << endl;

dimensionedScalar nu
(
transportProperties.lookup("nu")
);


I did this in hope to see "Testing here" in the log file after executing the solver.

As far as I know from this forum, I also have to do something with "Make/files" and "Make/options" as follows:

(2) I replaced FOAM_APPBIN with FOAM_USER_APPBIN in Make/files:

icoFoam.C

EXE = $(FOAM_USER_APPBIN)/icoFoam



(3) My Make/options is unchanged and looks like:

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lfiniteVolume



After compiling with wmake I got the following:

Making dependency list for source file icoFoam.C

SOURCE_DIR=.
SOURCE=icoFoam.C ; g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/zaki/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/home/zaki/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/icoFoam.o
/home/zaki/OpenFOAM/OpenFOAM-1.3/wmake/bashScripts/mkObjectDir /home/zaki/OpenFOAM/zaki-1.3/applications/bin/linuxGcc4DPOpt/icoFoam
g++ -m32 -Dlinux -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/zaki/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/home/zaki/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -pthread Make/linuxGcc4DPOpt/icoFoam.o -L/home/zaki/OpenFOAM/OpenFOAM-1.3/lib/linuxGcc4DPOpt \
-lfiniteVolume -lOpenFOAM -liberty -o /home/zaki/OpenFOAM/zaki-1.3/applications/bin/linuxGcc4DPOpt/icoFoam
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/../../../../x86_64-suse-linux/bin/ld: cannot find -lfiniteVolume
collect2: ld returned 1 exit status
make: *** [/home/zaki/OpenFOAM/zaki-1.3/applications/bin/linuxGcc4DPOpt/icoFoam] Error 1


Judging from the above message, I think there's a problem with the writing of path in Make/options. So I checked the LIB_SRC directory:

echo $LIB_SRC


but all I got is an empty line.

And also, when I checked the following directory:

cd ~/OpenFOAM/zaki-1.3/applications/bin/linuxGcc4DPOpt/
ls


no further directories nor files exist.

Any idea of how I should tackle this problem?

Thanks a lot,

zaki
zakifoam is offline   Reply With Quote

Old   March 12, 2007, 08:57
Default It looks like a confusion in y
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
It looks like a confusion in your environment set-up: do you have WM_64 set on or off?

Currently, the compile line says you are trying to compile a 32-bit version and the path vhere libraries are sought looks 64-bit to me. You will need to sort out your environment veriables - there is nothing wrong with your code.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 12, 2007, 09:17
Default Thanks for your quick reply,
  #3
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
Thanks for your quick reply,

I checked the following file:
~/OpenFOAM/OpenFOAM-1.3/.bashrc

and I found that WM_64 is set as on.

I tried to turn it off and do . ~/.bashrc again. But after compiling, similar message occured.

Am I on the right track or not?

Thanks again,

zk
zakifoam is offline   Reply With Quote

Old   March 12, 2007, 09:29
Default whooops, Sorry for the last
  #4
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
whooops,

Sorry for the last message. I got it right now. I should've set WM_64 as on. After setting it as off and re-setting it as on, and do . ~/.bashrc, I had no compiling error.

I can now view the change in FoamX.

Thanks Hrv!
zakifoam is offline   Reply With Quote

Reply

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
Compiling morfeus80 OpenFOAM Installation 18 March 16, 2008 01:21
Compiling UDF Claud FLUENT 10 December 18, 2006 16:52
Compiling my UDF chris FLUENT 5 July 12, 2006 08:49
Compiling MON FLUENT 0 October 20, 2002 20:48
Compiling UDF Zhang_clement FLUENT 5 February 3, 2002 00:56


All times are GMT -4. The time now is 22:39.