pygrib icon indicating copy to clipboard operation
pygrib copied to clipboard

Pygrib compiling error "error adding symbols: Bad value collect2: error: ld returned 1 exit status"

Open envhyf opened this issue 6 years ago • 0 comments

I tried to manually install the pygrib package in my Cent OS 5.x system. I have already set grib_api successfully and edited the setup.cfg to point out the lib direction.

However, the error appeared in the process of python setup.py build as follows:

/disk2/hyf/lib/binutils-2.25/bin/ld: /diskx/hyf/lib/grib_api/lib/libgrib_api.a(grib_index.o): relocation R_X86_6
4_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/diskx/hyf/lib/grib_api/lib/libgrib_api.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

I noticed that I installed the grib_api library with the flag of "--disable-shared", detailed as follows

./configure --prefix=$DIR/grib_api --with-jasper=$DIR/jasper --disable-shared # --enable-sharedv
make
make install

Thus, I wondered that is it necessary to install pygrib with "--disable-shared" flag, and how to achieve that? I am not familiar with setup.py file.

envhyf avatar Mar 03 '19 09:03 envhyf