3

When trying to easy_installfabric (or easy_installpycrypto, which fabric depends on), I got the following linker error on Mac OS X:

ld: illegal text-relocation to ___gmp_binvert_limb_table in /usr/local/lib/libgmp.a(mp_minv_tab.o) from ___gmpn_divexact_1 in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Setup script exited with error: command 'clang' failed with exit status 1
Stuart Berg
  • 17,026
  • 12
  • 67
  • 99

1 Answers1

2

I was using a custom install of python, which apparently wasn't compatible with my standard install of libGMP. Building libGMP from source (in my own prefix location, used by my special python install) fixed the problem.

$ bunzip2 gmp-5.0.5.tar.bz2
$ tar -xf gmp-5.0.5.tar
$ cd gmp-5.0.5
$ ./configure --prefix=/path/to/my/special/prefix
$ make
$ make check
$ make install
$ easy_install pycrypto
$ easy_install fabric
Stuart Berg
  • 17,026
  • 12
  • 67
  • 99
  • This worked perfectly, thanks! I had "illegal text-relocation to ___gmp_binvert_limb_table" issues as well while doing `pip install fabric`. Small (probably obvious) note that the --prefix option to ./configure is... optional. The ./configure will work just as well without. – Greg Sadetsky Feb 26 '15 at 18:48
  • 1
    Oddly enough, my solution was kind of the opposite: `brew unlink gmp` --after that I could successfully `sudo pip install pycrypto` – MarkHu Dec 23 '16 at 01:39