CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Compiling Makeoptions (https://www.cfd-online.com/Forums/openfoam-solving/59791-compiling-makeoptions.html)

zakifoam March 12, 2007 09:38

Dear all, I'm using OF ver
 
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

hjasak March 12, 2007 09:57

It looks like a confusion in y
 
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

zakifoam March 12, 2007 10:17

Thanks for your quick reply,
 
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 March 12, 2007 10:29

whooops, Sorry for the last
 
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. http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

I can now view the change in FoamX.

Thanks Hrv! http://www.cfd-online.com/OpenFOAM_D...part/happy.gif


All times are GMT -4. The time now is 14:29.