Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm attempting to compile GCC 4.5.2 as part of the Linux from Scratch book (http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html). My configure is as follows:

./configure \
    --target=$LFS_TGT --prefix=/tools \
    --disable-nls --disable-shared --disable-multilib \
    --disable-decimal-float --disable-threads \
    --disable-libmudflap --disable-libssp \
    --disable-libgomp --enable-languages=c \
    --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
    --without-ppl --without-cloog

When I attempt to make I get the error (after digging around in config.logs):

error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory

I have gmp in a subdirectory and got to this point after successfully compiling it. How can I point GCC to use this library?

I'm going through LFS in an attempt to get myself more familiar with Linux behaviour. I've jumped over a fair few hurdles but this particular case is stumping me.

If it's relevant: I'm using an Ubuntu 11 host. Any ideas?

With thanks.

share|improve this question
add comment

2 Answers

Add the path to GMP using the below switch, add that to your configure statement.

--with-gmp=$(PWD)/gmp
share|improve this answer
    
If I'm reading the configuration docs correctly --with-gmp is equivalent to --with-gmp-include and --with-gmp-lib (can't test this until the morning) –  Rushyo May 19 '11 at 18:40
    
This is what ./configure --help says -- --with-gmp-include=PATH specify directory for installed GMP include files --with-gmp-lib=PATH specify directory for the installed GMP library so you actually need to point to the include directory and libs directory or alternately you could just point to the parent directory with the above option –  freethinker May 20 '11 at 0:28
    
I'm already doing so, however, as indicated. –  Rushyo May 20 '11 at 6:35
    
look at your config.log and see whats going wrong, may be you should post the errors from config.log here –  freethinker May 20 '11 at 7:55
    
That's where the error came from... (also, tried --with-gmp instead. No change). The file does definitely exist in the location I've specified. –  Rushyo May 20 '11 at 8:36
show 1 more comment
up vote 0 down vote accepted

I'm fairly sure the issue was caused by my (dumb) decision to use a combined source + build directory. Cleaning up my environment and re-building to a different folder has addressed this issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.