This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC build issues - struggling


On Wed, Dec 29, 2010 at 4:43 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 29 December 2010 13:09, Dan Track wrote:
>> On Wed, Dec 29, 2010 at 12:20 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>> On 29 December 2010 11:11, Dan Track wrote:
>>>>
>>>> --with-gmp="/opt/gcc"
>>>> --with-gmp-include="/opt/gcc/include"
>>> ...
>>>> -L/opt/gcc/lib -lmpc -lmpfr -lgmp -rdynamic -ldl ?-lz
>>>>
>>>> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld:
>>>> cannot find -lgmp
>>> ...
>>>> I have gmp installed in
>>>> /app/gcc/usr/lib.
>>>
>>> Use the right --with-gmp option.
>>>
>>
>> Hi,
>>
>> Thanks for your suggestion, I made the recommended change and removed
>> the old config. However I’ve still got the same error, is there
>> something else required?
>>
>> Here’s what I’ve been doing
>>
>> cd /opt/mon
>> tar –xzf gcc-4.5.2.tar.gz
>> cd gcc-4.5.2
>>
>> then the following commands
>>
>>
>> Configure:
>>
>> ./configure --enable-threads=posix --prefix=/opt/gcc
>
> The installation instructions strongly recommend NOT configuring in
> the source tree, but in a separate directory. That allows you to just
> remove the build directory and start again if you mess up the config
> or want to change it. The source tree will be untouched
> e.g.
> cd /opt/mon
> tar –xzf gcc-4.5.2.tar.gz
> mkdir objdir
> cd objdir
> ../gcc-4.5.2/configure ...
>
> --enable-threads=posix is the default for GNU/Linux, it's not
> necessary to request it explicitly (but harmless)
>
>
>> --with-local-prefix=/opt/gcc/usr/local
>> --infodir=/opt/gcc/usr/share/info --mandir=/opt/gcc/usr/share/man
>> --libdir=/opt/gcc/usr/lib64 --libexecdir=/opt/gcc/usr/lib64
>> --enable-languages=c,c++,objc,obj-c++ --enable-checking=release
>> --with-gxx-include-dir=/opt/gcc/usr/include/c++/4.1.2 --enable-ssp
>
> Why are you giving the cxx-include-dir as 4.1.2 for a 4.5.2 installation?
>
>> --disable-libssp --disable-libgcj --with-slibdir=/opt/gcc/lib64
>> --with-system-zlib --enable-shared --enable-__cxa_atexit
>> --enable-libstdcxx-allocator=new --program-suffix=
>> --enable-version-specific-runtime-libs --without-system-libunwind
>> --with-cpu=generic --host=x86_64-suse-linux --enable-bootstrap
>> --enable-shared --enable-threads=posix --enable-checking=release
>> --with-system-zlib --enable-__cxa_atexit
>
> Most of these options are redundant
>
>> --disable-libunwind-exceptions --enable-gnu-unique-object
>> --enable-linker-build-id LDFLAGS="-L/opt/gcc/lib ?-L/opt/gcc/usr/lib
>> -L/opt/utils/lib -L/opt/utils/usr/lib"
>> CPPFLAGS="-I/opt/utils/usr/include" --host=x86_64-suse-linux
>> --target=x86_64-suse-linux --build=x86_64-suse-linux
>> --with-tune=generic --with-arch_32=i686 --with-gmp="/opt/gcc"
>
> I thought you said you have gmp in /app/gcc/usr/lib ?
>
> Why are you still using --with-gmp=/opt/gcc ?
>
> Are the installed libgmp.so libraries the right architecture for the
> gcc build you're trying, i.e. 64-bit?
>
>> CC=/opt/utils/usr/bin/gcc CXX=/opt/utils/usr/bin/g++ CFLAGS="-g3 -O0
>> -I/opt/utils/usr/include" BOOT_LDFLAGS="-L/opt/gcc/lib
>> -L/opt/gcc/usr/lib -L/opt/utils/lib -L/opt/utils/usr/lib"
>
> Do you actually need all these environment variables?
> I suggest keeping it simple instead of giving dozens of redundant or
> unnecessary options.
>
> You probably only need half those configure options, if that.
>
> Set LD_LIBRARY_PATH so libgmp.so can be found at build time:
> export LD_LIBRARY_PATH=/app/gcc/usr/lib
>
> Try a much simpler configure:
> ./configure --enable-threads=posix --prefix=/opt/gcc
> --enable-languages=c,c++,objc,obj-c++ --enable-ssp
> --disable-libssp --disable-libgcj
> --enable-libstdcxx-allocator=new --without-system-libunwind
> --with-cpu=generic --host=x86_64-suse-linux
> --with-system-zlib
> --disable-libunwind-exceptions --enable-gnu-unique-object
> --enable-linker-build-id
> --host=x86_64-suse-linux
> --target=x86_64-suse-linux --build=x86_64-suse-linux
> --with-tune=generic --with-arch_32=i686 --with-gmp="/app/gcc/usr"
> CC=/opt/utils/usr/bin/gcc CXX=/opt/utils/usr/bin/g++ CFLAGS="-g3 -O0"
>
> Unless you're really messed your system up, you don't need to set
> CFLAGS to find headers in /opt/utils/include
>
> If you're still struggling, I'd suggest simply downloading my makefile from
> http://www.kayari.plus.com/gcc/config-gcc.mk
>
> then saying "gmake -n -f config-gcc.mk PREFIX=/opt/gcc"
> The -n flag will cause make to print out all the commands I consider
> necessary to configure gcc (with C and C++ support) - you should be
> able to figure out the extra steps needed to include ObjC and add
> whatever extra configure options you want.
>

Hi,

Thanks for the detailed response. Due to the server layout I can't
install anywhere except in /opt. Apologies, the original gmp layout
was a mistake, I can confirm that my gmp is in the following location:

file /opt/gcc/usr/lib/libgmp.so
/opt/gcc/usr/lib/libgmp.so: symbolic link to `libgmp.so.3.5.2'

file /opt/gcc/usr/lib/libgmp.so.3.5.2
/opt/gcc/usr/lib/libgmp.so.3.5.2: ELF 64-bit LSB shared object,
x86-64, version 1 (SYSV), not stripped

My server is:
uname -a
Linux sn37v98 2.6.16.60-0.69.1-smp #1 SMP Fri Sep 17 17:07:54 UTC 2010
x86_64 x86_64 x86_64 GNU/Linux

With regards to the LD_LIBRARY_PATH, I’ve generally not liked its use.
I know it will work when I set it with the location, but I would
prefer to pass the details via the configure script. Is there a way to
do, it given the –with-gmp doesn’t work for the second stage?

Also I’ve compiled the same gcc with just a prefix location and
nothing else in the configure argument except the environment
variables but it still didn’t build, I had to set LD_LIBRARY_PATH to
make it find mpr, gmp etc...

The various environment variables set:

>> CC=/opt/utils/usr/bin/gcc CXX=/opt/utils/usr/bin/g++ CFLAGS="-g3 -O0
>> -I/opt/utils/usr/include" BOOT_LDFLAGS="-L/opt/gcc/lib
>> -L/opt/gcc/usr/lib -L/opt/utils/lib -L/opt/utils/usr/lib"

were done to aid in finding mpc etc, which are located in another location i.e.:
/opt/gcc/lib and
/opt/gcc/lib64

I’ll cut down the configure options to reflect some of your changes.

Any help would be appreciated.

Many thanks
Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]