CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   OpenFOAM141dev linking error on IBM AIX 52 (

matthias November 24, 2007 21:48

Hello, I got the following

I got the following error when compiling the applications of the OF-1.4.1-dev version. All libraries (without mico) compiled fine after some modifications of the printstack and clocktime sources.

g++ -maix64 -Dibm64 -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-30 -I/home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude -fPIC -fpermissive -Wl,-brtl -lpthread -L/home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/lib/ibm64GccDPOpt/poe -lPstream -Wl,-binitfini:poe_remote_main -lmpi_r -lvtd_r -llapi_r -lpthreads -L/usr/lpp/ppe.poe/lib/threads -L/usr/lpp/ppe.poe/lib -L/usr/lpp/ppe.poe/lib/ip -Wl,-bnoquiet -L/home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/lib/ibm64GccDPOpt \
-lfiniteVolume -lOpenFOAM -liberty -o /home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/applications/bin/ibm64GccDPOpt/lapl acianFoam
(ld): setopt 64
(ld): halt 4
(ld): setopt r/o->w
(ld): setopt nodelcsect
(ld): setopt rtl
(ld): setopt rtllib
(ld): setopt symbolic:1
(ld): lrgpage 0
(ld): savename /home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/applications/bin/ibm64GccDPOpt/lapl acianFoam
(ld): filelist 15 1
(ld): i /lib/crt0_64.o
(ld): i /fastfs/tmp/mvimixer/dialog.tmpdir.berni1.1507428//ccUVzWCZ.o
(ld): lib /usr/lib/libpthread.a
(ld): lib /home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/lib/ibm64GccDPOpt/poe/
(ld): lib /usr/lpp/ppe.poe/lib/libmpi_r.a
(ld): lib /usr/lib/liblapi_r.a
(ld): lib /home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/lib/ibm64GccDPOpt/libfiniteVolume.s o
(ld): lib /home/b/mvimixer/OpenFOAM/OpenFOAM-1.4.1-dev/lib/ibm64GccDPOpt/
(ld): lib /aws/sw/ppc/gcc-4.0.2/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.0.2/../../../ppc64 /libiberty.a
(ld): lib /aws/sw/ppc/gcc-4.0.2/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.0.2/../../../ppc64 /libstdc++.a
(ld): lib /usr/lib/libm.a
(ld): lib /aws/sw/ppc/gcc-4.0.2/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.0.2/../../../ppc64 /libgcc_s.a
(ld): i /aws/sw/ppc/gcc-4.0.2/bin/../lib/gcc/powerpc-ibm-aix5.2.0.0/4.0.2/ppc64/libgcc.a
(ld): lib /usr/lpp/ppe.poe/lib/threads/libc.a
(ld): lib /usr/lib/librtl.a
LIBRARY: Shared object libpthread.a[shr_xpg5_64.o]: 285 symbols imported.
LIBRARY: Shared object 46 symbols imported.
LIBRARY: Shared object libmpi_r.a[mpci64_r.o]: 45 symbols imported.
LIBRARY: Shared object libmpi_r.a[mpicore64_r.o]: 648 symbols imported.
LIBRARY: Shared object libmpi_r.a[mpifort64_r.o]: 1580 symbols imported.
LIBRARY: Shared object libmpi_r.a[mpipoe64_r.o]: 113 symbols imported.
LIBRARY: Shared object libmpi_r.a[mpicpp64_r.o]: 24 symbols imported.
LIBRARY: Shared object libmpi_r.a[dynamic64_r.o]: 22 symbols imported.
LIBRARY: Shared object libmpi_r.a[pm_chkrst64_r.o]: 3 symbols imported.
LIBRARY: Shared object liblapi_r.a[liblapi64_r.o]: 347 symbols imported.
LIBRARY: Shared object liblapi_r.a[liblapirdma64_r.o]: 2 symbols imported.
LIBRARY: Shared object liblapi_r.a[liblapishm64_r.o]: 6 symbols imported.
LIBRARY: Shared object liblapi_r.a[liblapiudp64_r.o]: 4 symbols imported.
LIBRARY: Shared object 0 symbols imported.
LIBRARY: Shared object 7586 symbols imported.
LIBRARY: Shared object libstdc++.a[]: 3769 symbols imported.
LIBRARY: Shared object libgcc_s.a[shr.o]: 114 symbols imported.
LIBRARY: Shared object libc.a[shr_64.o]: 2370 symbols imported.
LIBRARY: Shared object libc.a[posix_aio_64.o]: 17 symbols imported.
LIBRARY: Shared object libc.a[aio_64.o]: 11 symbols imported.
LIBRARY: Shared object libc.a[pse_64.o]: 5 symbols imported.
LIBRARY: Shared object libc.a[dl_64.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty_64.o]: 1 symbols imported.
LIBRARY: Shared object librtl.a[lazy42_64.o]: 3 symbols imported.
FILELIST: Number of previously inserted files processed: 15
(ld): initfini poe_remote_main
(ld): initfini _GLOBAL__FI_laplacianFoam _GLOBAL__FD_laplacianFoam
(ld): resolve
RESOLVE: 77 of 18932 symbols were kept.
(ld): addgl /usr/lib/glink64.o
ADDGL: Glink code added for 11 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol
-------------------------------------------------------------------------------- --------------
ld: 0711-317 ERROR: Undefined symbol: .main
.main [10] ER PR crt0_64.s(/lib/crt0_64.o)
00000090 .text R_RBR [34] .__start
ER: The return code is 8.
collect2: ld returned 8 exit status

I don't know the library including the symbol '.main'.

Any suggestions?

Best regards,

hjasak November 25, 2007 04:12

Your error messages look VERY
Your error messages look VERY strange - it looks like the linker crashed while trying to link the laplacianFoam executable.

For the reference, it is laplacianFoam.o that will contain the symbol main.

Could you try compiling helloWorld with this compiler? Did you build the compiler yourself or did you download it from somewhere?


matthias November 25, 2007 13:08

No, i used an existing gcc com
No, i used an existing gcc compiler (gcc-4.0.2) with the system linker of AIX. You cannot build the gnu binutils for an AIX system, because they are not portable to AIX, so i have to use the system ld.

OF 1.4 works fine, but compiling of OF-1.4.1-dev (only the applications, the libraries are OK) with the same settings like OF-1.4 has failed.

Applications like foamFlex++ are working without problems. Further i had big trouble with the native sed command under AIX. It seems that OF-1.4.1-dev can not build the right paths in the dependency files. The path always looks like:


While using gnu sed the problem has not occured.

I am trying to compile a newer version of gcc for AIX, maybe it solves the problem?!

hjasak November 27, 2007 04:13

The only sensible place to che
The only sensible place to check is wmake/rules/<your> as the mechanics of the rest remains very similar. The other indication is that your error seems to occur only when linking with libraries. Try building magU or something similarly simple and chase it all the way through.

The most indicative message from your report is

(ld): er full

so something nasty happened to your linker. Did you run out of disk space?

As for sed, we all know that AIX sed is rubbish. On various platforms I also har trouble with tar, gzip and similar, so no surprise there. Use Gnu tools and all will be well. (BTW, did you consider using a gnu linker?)


7islands November 27, 2007 09:53

Hi Matthias, Another strange
Hi Matthias,
Another strange thing I noticed is that the linking command line does not include the object file name to be linked, which should be something like Make/ibm64GccDpOpt/laplacianFoam.o...?!


matthias November 27, 2007 21:08

Hello Takuya, the missing c
Hello Takuya,

the missing command line Make/ibm64GccDpOpt/laplacianFoam.o already exists but i used copy and paste for including the message and thereby it must be something went wrong, sorry for that, my fault.

As mentioned earlier, the binutils which including the gnu linker are not portable to AIX. So far as i know it is a mission impossible to compile gnu ld on AIX systems. Only the native AIX linker works.

At the moment i am still trying to compile a new gcc version and i will also look for some useful AIX linker flags, maybe it helps.


msrinath80 November 30, 2007 13:13

Matthias, can you post the cha
Matthias, can you post the changes that you need to make to the OpenFOAM source (i.e. wmake rules, paths etc.) in order to compile it on AIX? It would be very useful. Thanks!

msrinath80 December 13, 2007 17:25

Matthias, Did you succeed in g
Matthias, Did you succeed in getting OpenFOAM to build on AIX? I would love to hear your experience in this regard.

matthias December 17, 2007 11:38

Yeah, I got it. Although it wa
Yeah, I got it. Although it was tricky, but finally I made it. I had to modify some parts of the source code, I will write a short HowTo in our wiki and send a link to this thread.

msrinath80 December 17, 2007 15:01

Thanks Matthias, your help is
Thanks Matthias, your help is much appreciated

msrinath80 January 6, 2008 06:56

Matthias, just a friendly remi
Matthias, just a friendly reminder. I would appreciate if you could post the changes you made to get OF to compile on AIX. Thanks.

matthias January 7, 2008 08:32

Hi Srinath, I checked out t
Hi Srinath,

I checked out the latest OF-1.4.1-dev version from sourceforge svn repository to test my little HowTo. I noticed that there were differences between my and the svn version. So that is the reason for the delay, I had to modify my instructions.

-We use an AIX 5.2 system for parallel computing only and not for development tasks
-The entire java stuff is not important for our work, so it doesn't work and I have no time to make it work
-the following instructions have been worked out for running openfoam on our aix system, I don't guarantee that OF will work on other AIX machines with these instructions
-we use the native IBM AIX parallel environment POE and not LAM or MPICH
-very important: you have to use another wmake/rules file for IBM AIX machines, the linux ones don't work, because there are differences between compiler and linker flags on linux and AIX machines
-I have used the gnu compiler 4.0.2 and the system linker to build OF, you can use every working gnu compiler greater then 4.0.1 but you cannot use the gnu linker, because the gnu linker and AIX are not compatible (problem with linking shared libraries)
-It is possible that you have to rebuild the gnu stuff like sed, grep, find and so on but it depends on your AIX system
-Finally, we have still problems with OF and the AIX system, if I want to build the solvers with parallel support I had to modify a line in our wmake/rules/ibm file which contains all the poe stuff but after including poe I can't build the apps (blockMesh, decomposeParDict etc..) without parallel support, for that I must remove the line in the wmake/rules/ibm file, that is very annoying.
-AND there are still big problems with the wmake scripting under our AIX system, I have NO solution for these problems, I created just a workaround but that is not the ultimate solution

Okay in the next listing I write the instructions!

matthias January 7, 2008 09:44

1 .OpenFOAM/bashrc # IBM RS
1 .OpenFOAM/bashrc

# IBM RS6000
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

elif [ "$machineTest" = "AIX" ]; then

export WM_ARCH=ibm64

2 .bashrc

elif [ .$WM_MPLIB = .POE ]; then

export POE_HOME=/usr/lpp/ppe.poe
export POE_ARCH_PATH=/usr/lpp/ppe.poe

AddPath $POE_ARCH_PATH/bin


3 create wmake/rules/ibm64Gcc4 directory
set correct rule files

4 building foamFlex

remove from wmake/rules/ibm64Gcc4/c++
in line begining with LINKEXE all the POE (MPI) stuff ,incl. lPstream

after foamFlex has been build add all the POE (MPI) stuff again, don't forgett lPstream

5 This is one of the problems mentioned earlier, I don't know if it concerns our machine only or if it is a general bug under AIX 5.2

when he is linking, then the message occurs:

"linking include files to ..../OpenFOAM/OpenFOAM-1.4.1-dev.1-dev/....."

I don't know the cause!!! My workaround is

in 'wmake/scripts/addCompile' comment out
sed -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% > $depName

and set the absolute Path (Caution: Please leave '.1-dev' from the path name)

sed -e s%$WM_PROJECT_DIR%/.../OpenFOAM/OpenFOAM-1.4% > $depName

!!! I don't know if you have to do that, so please try it out before you make changes in the addCompile file!!!

6 src/OpenFOAM/OSspecific/Unix/clockTime/clockTime.H

comment out line 41 and 43 so that #include <sys/time.h> is included

comment out
#include <execinfo.h>

void printSourceFileAndLine(...)



replace pow10(exp) with pow(10,exp)

9 src/malloc/fbsdmalloc

set environment variable OBJECT_MODE

export OBJECT_MODE=64

10 see number 5; now OF wanted to build the solvers and apps. Here I get the following error after wmake all:

...../OpenFOAM/OpenFOAM-1.4.1-dev/wmake/wmake[183]: : 0031-045 sigaction(SIGSEGV)
make: *** empty string invalid as file name. Stop.

I don't know the causes, it seems that the AIX system has trouble to properly execute the wmake scripts.

my workaround:

Build the important solver and apps on your own. You can go to the subdirectory and make a wmake by hand, thats all!
But please pay attention to my comments in the last listing regarding the building of solvers/apps with and without POE,MPI support

I hope this helps you! Good luck!


msrinath80 January 7, 2008 15:33

Thanks Matthias. I'll give it
Thanks Matthias. I'll give it a shot soon.

hannes January 8, 2008 09:06

Hi Srinath, please forget a
Hi Srinath,

please forget about the hack in Step 5 (addCompile script). We have found the problem. The environment on our machine was messed up with some values from the old version 1.4.

Best regards, Hannes

hannes January 8, 2008 13:29

Hi again, and the error in
Hi again,

and the error in step 10 can be removed by modifying the wmake script. Change line 183 from:

$make -k -f $WM_DIR/MakefileApps FOAM_APPS="`find . -maxdepth 1 \( -type d -a ! -name "." -a ! -name "Make" \) -printf "%f "`"


$make -k -f $WM_DIR/MakefileApps FOAM_APPS="$(find . -maxdepth 1 \( -type d -a ! -name "." -a ! -name "Make" \) -printf "%f ")"

The apostrophs ` ` have been replaced by $( )

Best regards, Hannes

msrinath80 January 8, 2008 18:25

Thank you Hannes.
Thank you Hannes.

shivasub March 24, 2008 11:16

Hello, I plan to install Op

I plan to install OpenFOAM on an AIX 5.3 system sometime soon(I don't have access to the machine yet). Have been going through some of the AIX threads and looking at the suggestions posted.

Has anyone tried using the AIX Toolbox for Linux Applications ? Is it helpful and does it make the job of installation any easier?


msrinath80 March 28, 2008 15:17

Shiva, The quickest way is

The quickest way is to install GNU/Linux on the AIX machine. Saves a lot of time and headache. The harder way is to try and do work like Matthias has described. If you are new to OpenFOAM, my suggestion is that you try and do at least one fresh build from source all by yourself (on GNU/Linux) to get a feel first. Compiling from source on GNU/Linux isn't trivial either. Follow the instructions[1] in the wiki. Personally, I've rebuilt OpenFOAM like 10-12 times from scratch and thus am reasonably comfortable with unexpected installation hiccups.


shivasub March 30, 2008 00:50

Hi Srinath, Thanks for the
Hi Srinath,

Thanks for the pointer. Unfortunately the machine on which I need to install OpenFOAM is not owned by my research group and hence I cannot replace the OS.

I have been using OpenFOAM for more than a year now and have built it before (though not 10 - 12 times ) on Linux machines. The ongoing attempt is first on AIX. Will post details of my attempts, failures and successes.


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