ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit

Showing 1-5 of 5 messages
ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit Quan Wei 7/3/12 8:39 AM
Hello,everyone.

      I have test install omnetpp 4.1 on Ubuntu 10.04(Lucid) x86_64 bit. I encounter this bug when I type "make". I have cost one whole day trying to resolve this problem, but there is no idea. So I turn to help here.  My akaroa version is 2.7.9. And the exact error informantion is shown as follows.

      Thanks for any useful infrmation.


===== Compiling queueinglib ====
cd /usr/src/omnetpp-4.1/samples/queueinglib && make
make[2]: Entering directory `/usr/src/omnetpp-4.1/samples/queueinglib'
g++ -shared -fPIC -o out/gcc-release//libqueueinglib.so  out/gcc-release//Allocate.o out/gcc-release//Classifier.o out/gcc-release//Clone.o out/gcc-release//Deallocate.o out/gcc-release//Delay.o out/gcc-release//Fork.o out/gcc-release//Job.o out/gcc-release//JobList.o out/gcc-release//Join.o out/gcc-release//Merge.o out/gcc-release//PassiveQueue.o out/gcc-release//Queue.o out/gcc-release//ResourceBasedQueue.o out/gcc-release//ResourcePool.o out/gcc-release//Router.o out/gcc-release//SelectionStrategies.o out/gcc-release//Server.o out/gcc-release//Sink.o out/gcc-release//Source.o out/gcc-release//Job_m.o   -L"/usr/src/omnetpp-4.1/lib/gcc" -L"/usr/src/omnetpp-4.1/lib" -loppenvir -loppsim -ldl -lstdc++  -L/usr/local/akaroa/lib -lakaroa -lfl -Wl,-rpath,/usr/src/omnetpp-4.1/lib -Wl,-r path,.
/usr/bin/ld: /usr/local/akaroa/lib/libakaroa.a(random.o): relocation R_X86_64_32 against `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/local/akaroa/lib/libakaroa.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [out/gcc-release//libqueueinglib.so] Error 1
make[2]: Leaving directory `/usr/src/omnetpp-4.1/samples/queueinglib'
make[1]: *** [queueinglib] Error 2
make[1]: Leaving directory `/usr/src/omnetpp-4.1'
make: *** [allmodes] Error 2
root@cheewii-desktop:/usr/src/omnetpp-4.1#
Re: ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit Rudolf Hornig 7/3/12 8:46 AM
The solution is already written on your output:

"can not be used when making a shared object; recompile with -fPIC"

i.e. you MUST compile your akaroa.a library using the -fPIC option to generate position independent code (as omnet is built usin PIC so all other libraries linked to it must also compiled that way).

Somehow you must add the -fPIC flad to the compiler's command line during the akaroa build process.

Rudolf
Re: ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit Quan Wei 7/3/12 8:51 AM
 You mean recompling akaroa, not omnetpp. Thanks for your help, I will have a try tomorrow. Hope it successful.
Re: ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit Quan Wei 7/3/12 6:40 PM
Dear,
 
First, thanks for  Rudolf Hornig's help.

I have test  recompling akaroa with "-fPIC" by add the flag in the Makefile.config_tools, whuch is shown as follows:


#
#   Compilers and compilation flags
#
CC = gcc
CFLAGS = -g -Wno-deprecated -fPIC

CPLUS = g++
#CPLUS_FLAGS = -g -O
CPLUS_FLAGS = -g -Wno-deprecated -fPIC

#   No optimisation
CPLUS_NOOPT_FLAGS = -g -fPIC

And then I recompile Omnet++, I am glad to see the error go away. :)

However, a similar error occurs next. The error informantion is shown as follows:

/gcc" -L"/usr/src/omnetpp-4.1/lib" -loppenvir -loppsim -ldl -lstdc++  -L/usr/local/akaroa/lib -lakaroa -lfl -Wl,-rpath,/usr/src/omnetpp-4.1/lib -Wl,-rpath,.
/usr/bin/ld: /usr/local/akaroa/lib/libakaroa.a(md5c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/akaroa/lib/libakaroa.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [out/gcc-release//libqueueinglib.so] Error 1
make[2]: Leaving directory `/usr/src/omnetpp-4.1/samples/queueinglib'
make[1]: *** [queueinglib] Error 2
make[1]: Leaving directory `/usr/src/omnetpp-4.1'
make: *** [allmodes] Error 2
root@cheewii-desktop:/usr/src/omnetpp-4.1# 

 I have test modify the Makefile in the src/auth (because md5c.o is in this dir) by adding flag "-fPIC", but the error still exsit. :(
 
How to reslove it?

Best Regards,
Re: ERROR during compling omentpp4.1 on Ubuntu 10.04(Lucid) x86_64 bit Quan Wei 7/3/12 7:59 PM
This problem is resloved, and I found a small bug in akaroa. 

Please refer to the special report from: https://groups.google.com/forum/?fromgroups#!topic/omnetpp/9Y3X5tg42aQ