I am trying to install Giza++ and Moses on Ubuntu 12.10 64bit. While make I keep on getting the same problem:
Finished building giza
cp ../lib/libgiza.a /usr/local/lib/
................................
giza-pgplot.o -L/usr/X11R6//lib -lX11 -L/usr/X11R6//lib -lcairo -lm -L/usr/local /lib/x86_64/ -lgfortran
/usr/bin/ld: giza-fortran.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
giza-fortran.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [../lib/libpgplot.so] Error 1
make[1]: Leaving directory `/home/maria/moses/giza/build'
make: *** [install] Error 2 "
Googling did not help much. I would be very grateful for any tip of how to solve this problem. What should I do to recompile it with -fPIC?
This problem existed only with the giza check out from the svn. This one from tar.gz http://code.google.com/p/giza-pp/downloads/list installed without any problems. Whatever it was...
Related
I've getting the following linking error while compiling mlpack:
[ 37%] Linking CXX shared library ../../lib/libmlpack.so
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib/libiberty.a(cplus-dem.o): warning: relocation against `libiberty_demanglers' in read-only section `.text'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib/libiberty.a(cp-demangle.o): relocation R_X86_64_PC32 against symbol `cplus_demangle_builtin_types' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [src/mlpack/CMakeFiles/mlpack.dir/build.make:1040: lib/libmlpack.so.3.4] Error 1
make[1]: *** [CMakeFiles/Makefile2:2106: src/mlpack/CMakeFiles/mlpack.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
It seems I need to recompile libiberty.a library with -fPIC flag. How do I do that?
I found this bug report on the issue. In my case I was able to fix things by downgrading a few packages (as described in the report):
binutils 2.36.1-3
gcc 11.1.0-3
gcc-libs 11.1.0-3
gcc fortran-11.1.0-3
Ultimately this should be resolved when binutils gets updated.
I was trying to install Armadillo in my Ubuntu 14.04.
I run cmake . command in the terminal at the folder where the Armadillo files are located and then run make command. I got the following errors.
/usr/bin/ld: /usr/local/lib/libsuperlu.a(util.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object;
recompile with -fPIC
/usr/local/lib/libsuperlu.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libarmadillo.so.7.800.1] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
How can I rectify this?
The library at /usr/local/lib/libsuperlu.a on your system was most likely not built with -fPIC and you are presumably trying to build a shared library that uses code from libsuperlu.a. If this is your situation, then the compiler is telling you that the code in libsuperlu.a is not relocatable, but your shared library needs it to be. You will need to build your own libsuperlu.a and ensure that all of its object files are compiled with the -fPIC flag, since the libsuperlu.a you currently have installed in /usr/local/lib won't work for you.
Because of old Das u-boot from HEAD branch that do not have gcc 5 yet, I am planning on using gcc 4.8 or 4.9 as a default compiler instead of 5.2.
GCC required virtual/libc glibc-2.22. glibc-2.22 complied successfully with 5.2. Unfortunately, it failed at do_compile with the error: ld: cannot find -lgcc with gcc 4.8 and 4.9
arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/yocto/hio-jethro/build-hio/tmp/sysroots/hio-imx6dl-board-tcbootstrap -nostdlib -nostartfiles -r -o /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.map.o '-Wl,-(' /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/dl-allobjs.os /yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.mapT
/yocto/hio-jethro/build-hio/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc-cross-initial-arm/gcc/arm-poky-linux-gnueabi/5.2.0/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
make[2]: *** [/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/build-arm-poky-linux-gnueabi/elf/librtld.map] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/git/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/yocto/hio-jethro/build-hio/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glibc/2.22-r0/git'
make: *** [all] Error 2
ERROR: oe_runmake failed
Am I looking at the right error? and How do I add -lgcc?
Edit:
I have checked with Fido Branch and everything is working fine. I might just need replace gcc and glibc with Fido's
How did you tell it to use GCC 4? The paths are still referencing 5.2.0, which suggests that you didn't change it correctly. The correct way to change GCC version is to set GCCVERSION, ie GCCVERSION="4.%".
Also u-boot in jethro supports gcc5 just fine, so why are you using an old release?
While trying to make the memcached gem, i am getting the following error:
*linking shared-object rlibmemcached.so
/usr/bin/ld: skipping incompatible /ghostcache/nightly_build/components/ruby-memcached/akamai/ruby-memcached/memcached-1.8.0/ext/lib/libmemcached_gem.a when searching for -lmemcached_gem
/usr/bin/ld: skipping incompatible /ghostcache/nightly_build/components/ruby-memcached/akamai/ruby-memcached/memcached-1.8.0/ext/lib/libmemcached_gem.a when searching for -lmemcached_gem
/usr/bin/ld: cannot find -lmemcached_gem
collect2: ld returned 1 exit status
make[2]: *** [rlibmemcached.so] Error 1*
Looks like there is some platform issue. The libmemcached_gem.a library does exist in that path. I tried building by passing -m32 and -m64, but it fails for the same reason.
Any help will be much appreciated.
I try to build graphviz from git http://github.com/ellson/graphviz/
It stop building with this message
make[2]: Leaving directory `/home/peter/work/sdk/graphviz/graphviz-src/graphviz/cmd/gvedit'
CXX gvedit-moc_csettings.o
CXX gvedit-moc_imageviewer.o
CXX gvedit-moc_mainwindow.o
CXX gvedit-moc_mdichild.o
CXX gvedit-qrc_mdi.o
CXXLD gvedit
/usr/bin/ld: gvedit-mainwindow.o: undefined reference to symbol 'agseterrf'
/home/peter/work/sdk/graphviz/graphviz-src/graphviz/lib/cgraph/.libs/libcgraph.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [gvedit] Error 1
make[1]: Leaving directory `/home/peter/work/sdk/graphviz/graphviz-src/graphviz/cmd/gvedit'
make: *** [all-recursive] Error 1
Can you point me to the problem?
I found this issue on the github repo: https://github.com/ellson/graphviz/issues/1
It appears there is some issue with the perl plugin, for me building with
./configure --enable-perl=no
was enough to fix the issue (and I didn't lose any functionality I need).