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

Compiler error with OF 2.1.1 on OpenSUSE 12.3 (64bit) [GeekoCFD 5.0]

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2013, 11:01
Default Compiler error with OF 2.1.1 on OpenSUSE 12.3 (64bit) [GeekoCFD 5.0]
  #1
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Hello,
I recently installed GeekoCFD 5.0 which is based on OpenSUSE 12.3 (64bit). Because of some tools which won't work with OF 2.2 which is automatically installed along with GeekoCFD, I need to install OF 2.1.1. Therefore I downloaded and compiled the source code according to this guide: http://openfoamwiki.net/index.php/In...#openSUSE_12.2
I tried to attach the make.log to this post but it is too big. As far as I can see, there are only minor problems occuring in the log.

When I try to compile my own library with "wclean"/"wmake libso", I get the following error message:
Code:
wmakeLnInclude: linking include files to ./lnInclude                                                                                
Making dependency list for source file fiberPorousZone.C                                                                            
make: *** Keine Regel vorhanden, um das Target »fiberPorousZones.dep«,                                                              
  benötigt von »Make/linux64GccDPOpt/dependencies«, zu erstellen.  Schluss.
At first, I thought this could be due to an error of the gcc installation. "which gcc" gives "/usr/bin/gcc". Then I copied simpleFoam and compiled that again with no error. I also compiled another library without problems. Now I'm confused and I hope that someone has a clue.

Some outputs which might help:

gcc -v
Code:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.7/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.7 --enable-ssp --disable-libssp --disable-libitm --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --program-suffix=-4.7 --enable-linux-futex --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.7.2 20130108 [gcc-4_7-branch revision 195012] (SUSE Linux)
echo $LD_LIBRARY_PATH
Code:
/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12:/opt/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/openmpi-1.5.3:/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib/openmpi-1.5.3:/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/openmpi-1.5.3/lib:/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/openmpi-1.5.3/lib64:/home/user/OpenFOAM/user-2.1.1/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/site/2.1.1/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib:/opt/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/dummy:/usr/lib64/mpi/gcc/openmpi/lib64
echo $PATH
Code:
/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/paraview-3.12.0/bin:/opt/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/openmpi-1.5.3/bin:/home/user/OpenFOAM/user-2.1.1/platforms/linux64GccDPOpt/bin:/opt/OpenFOAM/site/2.1.1/platforms/linux64GccDPOpt/bin:/opt/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin:/opt/OpenFOAM/OpenFOAM-2.1.1/bin:/opt/OpenFOAM/OpenFOAM-2.1.1/wmake:/opt/Engys/HelyxOS/v1.0.1:/opt/gmsh-2.7.0-Linux/bin:/opt/eclipse:/opt/pyFoam/bin:/usr/lib64/mpi/gcc/openmpi/bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin
Let me know if something else is of interest!

Thanks in advance, Alex
Attached Files
File Type: txt foamInstTest.txt (3.1 KB, 3 views)
derkermit is offline   Reply With Quote

Old   May 14, 2013, 16:06
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Alex,

I haven't tried GeekoCFD yet, so I don't know what the default installation looks like.

Remember the step #4 from the instructions you mentioned? Try changing it to this:
Code:
source $HOME/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI WM_COMPILER=Gcc47
"WM_COMPILER=Gcc47" is the new part.
And edit the file "~/.bashrc" accordingly as well.

Then start a new terminal window or tab, just in case. After that, you'll have to do step #5 once again.

Another detail is that you have to be careful to avoid having OpenFOAM versions go into conflict between them. Read this blog post for more information: Advanced tips for working with the OpenFOAM shell environment

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 15, 2013, 04:13
Default
  #3
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Hey Bruno,
I changed my bashrc and it's compiling again at the moment. One question regarding this: Is it necessary to be in su mode when compiling OpenFOAM?

I'm switching between the OF versions with aliases as it is proposed in your link. I checked the OF environment variables and they seem to be ok.

Thanks, Alex

EDIT: Compilation finished -> see attachment. I could not find any errors in the log. The error message when compiling the library is the same. I also tried to compile it with "sudo wmake libso" and the output is:

Code:
wmake error: environment variable $WM_OPTIONS not set
echo $WM_OPTIONS gives:

Code:
linux64Gcc47DPOpt
So in fact it is set but why do I get that error?
Attached Files
File Type: gz make.log_1.tar.gz (10.6 KB, 2 views)
derkermit is offline   Reply With Quote

Old   May 15, 2013, 19:33
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Alex,

What a confusion of versions you've got there
OK, so here's the situation:
  • It looks like you're installing OpenFOAM 2.1.1 in "/opt". This usually requires root powers, hence the need for "sudo" or "su".
  • Then you're trying to build another library/application, while in normal user mode.
The problem is that in "su" mode, it has a shell environment for the root user. In normal user mode, you have another shell environment. And at least one of them is incorrectly defined.

The instructions at openfoamwiki.net instruct on how to install at "$HOME/OpenFOAM" as normal user, but you're installing at "/opt/OpenFOAM" as root user.

My guess is that you started to follow the instructions while the shell environment was activated for the pre-installed OpenFOAM 2.2.x or 2.2.0; then when you followed the instructions, you ended up somehow installing at "/opt"

Anyway, edit the file "/opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc" as root (using "su") and look for these lines:
Code:
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
Changed them to this:
Code:
# foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
Then edit your normal user's "~/.bashrc" and adapt the alias for 2.1.1 to point to the path at "/opt". And remove "WM_COMPILER=Gcc47" from your personal "~/.bashrc" file, since as root it was defined as "WM_COMPILER=Gcc".

Start a new terminal and try to see how things are working.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 16, 2013, 05:48
Default
  #5
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Hey Bruno,
sorry, I forgot to tell you that I want to install in opt/. I thought that would keep the OF installations some kind of sorted.

I just changed the bashrc foamInstall option as proposed by your last post and compiled OF again (in su mode). In detail I did the following: (to prevent to waste your time again due to lack of information )

1. Extract of the src code archives in /opt/OpenFOAM/ directory according to the commands from openfoamwiki.

2. Since x86_64 architecture I did:
Code:
source /opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI WM_COMPILER=Gcc47
echo "source /opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc $FOAM_SETTINGS" >> $HOME/.bashrc
3. Changed to OpenFOAM-2.1.1 directory and compiled it:

Code:
./Allwmake > make.log 2>&1
I did the 2nd run also and attached both logs to this post.

4. Built paraview according to openfoamwiki

I also attached my users bashrc and the root bashrc. I had to add the option WM_COMPILER=Gcc47 in the user bashrc in order to get openfoam tools running. The initial problem is however not solved. I compiled a library (not in sudo mode) and it finished without an error. The next library didn't compile successfully. The error is actually the same as in my first post:

Code:
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file fiberPorousZone.C
make: *** Keine Regel vorhanden, um das Target »fiberPorousZones.dep«, 
  benötigt von »Make/linux64Gcc47DPOpt/dependencies«, zu erstellen.  Schluss.
make: *** Warte auf noch nicht beendete Prozesse...
Thank you very much for helping me!

Greetings from Germany, Alex

EDIT: If i change the owner of the opt/OpenFOAM directory from root to my user, would that make things easier? I should than be able to compile OF without "su" or not?
Attached Files
File Type: gz make.log.tar.gz (81.7 KB, 0 views)
File Type: gz make_2ndTime.log.tar.gz (4.5 KB, 1 views)
File Type: gz root-bashrc.tar.gz (300 Bytes, 1 views)
File Type: gz user-bashrc.tar.gz (1.1 KB, 2 views)
File Type: gz foamInstTest.log.tar.gz (869 Bytes, 1 views)

Last edited by derkermit; May 16, 2013 at 08:15.
derkermit is offline   Reply With Quote

Old   May 16, 2013, 12:22
Default
  #6
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Just tried compilation in opt/ without sudo but with changing the owner. No errors occured but when compiling my library the same message as before comes up.

I'll check the files of my library tomorrow. Maybe they got corrupted when copying them from dvd.
derkermit is offline   Reply With Quote

Old   May 16, 2013, 17:39
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Alex,

OK, I think that being tired lead me to misdiagnose the problem on your first post

There are at least two possibilities for this error:
  1. There could be some left overs from a previous build from the original source on said DVD. To clean things up on the custom source code in question, run on it's main folder:
    Code:
    wclean all
    It should clear up all files that are created at build time... including "*.dep" files.
  2. If the previous possibility doesn't fix it, then there is something outdated in the source code (e.g. if the source code was designed to work on OpenFOAM 1.7.1), or something is missing altogether.
    • My guess is that for the library that is not building, you should check the file "Make/files" and compare the file list in that files, against the files actually present on the library's folder. The file "fiberPorousZone.C" is probably missing on the file system.

Sorry about the initial misdiagnosis , but at least you learned a few more things about OpenFOAM's building mechanism


By the way, the script code you had:
Code:
export FOAM_INST_DIR=/opt/OpenFOAM
alias of22x='foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.2.x/etc/bashrc && [ -f $foamDotFile ] && . $foamDotFile'
alias of211='foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc && [ -f $foamDotFile ] && . $foamDotFile'
Should work just fine, as long as you edit the file "OpenFOAM-2.1.1/etc/bashrc" or "OpenFOAM-2.1.1/etc/prefs.sh" accordingly, instead of using the custom options directly in the call to "bashrc".

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 17, 2013, 03:55
Default
  #8
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Hey Bruno,
I managed to compile it by copying the files from another source. Up to now I can't see any difference in the files. Has to be some kind of magic

But as you said, I learnt a ton about compiling OpenFOAM. Thanks for guiding me!

Just a last question regarding your last statement:
What exactly is meant by "foamDotFile"? And what is the difference between

Code:
alias of211='foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.1.1/etc/bashrc && [ -f $foamDotFile ] && . $foamDotFile'
and

Code:
alias of211='source /opt/OpenFOAM/OpenFOAM-2.1.1/etc/bashrc WM_NCOMPPROCS=4 WM_MPLIB=SYSTEMOPENMPI'
?

Greetings, Alex
derkermit is offline   Reply With Quote

Old   May 17, 2013, 18:07
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Alex,

OK, two details:
  1. "foamDotFile" is basically a variable.
    "foamDotFile=1" defines that the variable is assigned the value "1".
    "$foamDotFile" indicates that we want to use the value assigned to the variable.
    The trick is that it will only activate the OpenFOAM environment if can find that the file exists:
    Code:
    [ -f $foamDotFile ]
  2. The second alias has two further details:
    1. It's sourcing "bashrc" directly, instead of relying on a variable.
    2. It has all of the custom variable definitions done in a single line, because "bashrc" has code inside it to process these variables and assign them on-the-fly
A ton more details like these can be learned from online tutorials about programming scripts with/for bash.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 19, 2013, 03:30
Default
  #10
Member
 
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 14
derkermit is on a distinguished road
Thank you for the explanation. Helped me a lot!

Greetings, Alex
derkermit 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
[OpenFOAM.org] OpenFOAM 2.1.1 installation on openSUSE 12.2 32 bit saturn_53 OpenFOAM Installation 13 February 1, 2015 04:17
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 13:43
Troubles installing OF 1.6 on Opensuse 11.1 magnounibo OpenFOAM Installation 1 November 28, 2009 13:12
Dissimilarity in compiling new BC in 32bit OpenSuSE 103 versus 64bit CentOS 50 versus 64bit SLED 100 sponiar OpenFOAM Running, Solving & CFD 3 February 26, 2008 06:31


All times are GMT -4. The time now is 16:27.