* gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu @ 2011-11-04 18:25 Sinkler, Wharton 2011-11-04 23:41 ` Jonathan Wakely 2011-11-04 23:44 ` Ian Lance Taylor 0 siblings, 2 replies; 12+ messages in thread From: Sinkler, Wharton @ 2011-11-04 18:25 UTC (permalink / raw) To: gcc-help I have been trying unsuccessfully to install gcc-4.6.2, on a Redhat Linux VM. The configure step seems to work fine. I'm using the following configure options (installing 4.6.2 from a 'gcc_build' directory as suggested on the website; I already installed the required dependencies under /usr/local as indicated): ../gcc-4.6.2/configure --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --with-ppl=/usr/local --with-cloog=/usr/local \ LDFLAGS="-L/usr/local/lib -Xlinker -R/usr/local/lib" CONFIG_SHELL=/bin/bash -enable-languages=c,c++,fortran Under 'make' I am getting the following error: checking for suffix of object files... configure: error: in `/home/E341484/gnu-install/gcc_build/i686-pc-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. I found more detail on the make failure in the file ./i686-pc-linux-gnu/libgcc/config.log, which shows an error occurring at this statement: configure:3028: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -V >&5 xgcc: error: unrecognized option '-V' xgcc: fatal error: no input files compilation terminated. I think this is really the cause of the problem. I think the upper-case V might be an error, and should be a lower case '-v'. If I run this command with the 'V' changed to 'v', it executes successfully, returning an assortment of information, including info on the gcc version (and no error). Is this a bug in the Makefile? Is the upper-case '-V' supposed to be a '-v', or am I missing something? If the 'V' should be a 'v', any suggestions how to fix this in the Makefile? Thanks! Wharton Sinkler ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-04 18:25 gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu Sinkler, Wharton @ 2011-11-04 23:41 ` Jonathan Wakely 2011-11-04 23:44 ` Ian Lance Taylor 1 sibling, 0 replies; 12+ messages in thread From: Jonathan Wakely @ 2011-11-04 23:41 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: gcc-help On 4 November 2011 18:25, Sinkler, Wharton wrote: > I have been trying unsuccessfully to install gcc-4.6.2, on a Redhat Linux VM. The configure step seems to work fine. I'm using the following configure options (installing 4.6.2 from a 'gcc_build' directory as suggested on the website; I already installed the required dependencies under /usr/local as indicated): > > ../gcc-4.6.2/configure --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --with-ppl=/usr/local --with-cloog=/usr/local \ > LDFLAGS="-L/usr/local/lib -Xlinker -R/usr/local/lib" CONFIG_SHELL=/bin/bash -enable-languages=c,c++,fortran > > Under 'make' I am getting the following error: > > checking for suffix of object files... configure: error: in `/home/E341484/gnu-install/gcc_build/i686-pc-linux-gnu/libgcc': > configure: error: cannot compute suffix of object files: cannot compile > See `config.log' for more details. > > I found more detail on the make failure in the file ./i686-pc-linux-gnu/libgcc/config.log, which shows an error occurring at this statement: > > configure:3028: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -V >&5 > xgcc: error: unrecognized option '-V' > xgcc: fatal error: no input files > compilation terminated. > > I think this is really the cause of the problem. No it isn't, 'configure' is supposed to fail at various points, that's how it determines what your platform supports and what it doesn't. That error is non-fatal and is not why your build failed, this is why it failed: http://gcc.gnu.org/wiki/FAQ#configure_suffix This is the simplest way to build gcc: http://advogato.org/person/redi/diary/253.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-04 18:25 gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu Sinkler, Wharton 2011-11-04 23:41 ` Jonathan Wakely @ 2011-11-04 23:44 ` Ian Lance Taylor 2011-11-06 21:39 ` Sinkler, Wharton 1 sibling, 1 reply; 12+ messages in thread From: Ian Lance Taylor @ 2011-11-04 23:44 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: gcc-help "Sinkler, Wharton" <Wharton.Sinkler@uop.com> writes: > I found more detail on the make failure in the file ./i686-pc-linux-gnu/libgcc/config.log, which shows an error occurring at this statement: > > configure:3028: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -V >&5 > xgcc: error: unrecognized option '-V' > xgcc: fatal error: no input files > compilation terminated. This is not the problem. This is a result of the configure script testing whether the compiler supports the -V option. You are looking in the right place, but you need to look for the last error in the config.log file. Ian ^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-04 23:44 ` Ian Lance Taylor @ 2011-11-06 21:39 ` Sinkler, Wharton 2011-11-06 23:11 ` Jonathan Wakely 0 siblings, 1 reply; 12+ messages in thread From: Sinkler, Wharton @ 2011-11-06 21:39 UTC (permalink / raw) To: Ian Lance Taylor; +Cc: gcc-help Ian, The very last thing recognizable as an error in the gcc_build/i686-pc-linux-gnu/libgcc/config.log file is this: configure:3246: checking for suffix of object files configure:3268: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -c -g -O2 conftest.c >&5 /home/E341484/gnu-install/gcc_build/./gcc/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory configure:3272: $? = 1 This seems to suggest I'm missing libcloog.so.0. However I have installed this already: ls -l /usr/local/lib/libcloog* lrwxrwxrwx 1 root root 17 Nov 2 07:04 /usr/local/lib/libcloog.so.0 -> libcloog.so.0.0.0 -rwxr-xr-x 1 root root 323388 Nov 2 07:04 /usr/local/lib/libcloog.so.0.0.0 (in addition to .a and .1a and .so as well in the same place). The path to these is specified in the configure command (with --with-cloog=/usr/local ). So shouldn't it be found? In another post from Johnathan Wakely, he sent some links to these web pages: http://gcc.gnu.org/wiki/FAQ#configure_suffix http://advogato.org/person/redi/diary/253.html This suggests the 'cannot compute object file suffix' error is related to not having the prerequisites in place. I have however installed all of them (gmp-4.3.2, mpc-0.9, mpfr-3.1.0 in addition to ppl-0.11.2 and clog-ppl-0.15.11), and their locations are all specified in the configure statement (--with-gmp=/usr/local --with-mpc=/usr/local etc.). The 2nd link suggests using the ./contrib./download_prerequisites script to get the correct prerequisites in the correct places, which I then did (after freshly re-expanding everything from the .tar file and deleting everything from the gcc_build directory). I then ran: ../gcc-4.6.2/configure -enable-languages=c,c++,fortran make but this also failed with the errors described below (suggests I have conflicting versions of gmp: do I need to find and get rid of gmp-3.x.x to get this to work?). gcc -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -o cc1 c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o i386-c.o \ cc1-checksum.o main.o tree-browser.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lppl_c -lppl -lpwl -lgmpxx -L/home/E341484/gnu-install/gcc_build/./gmp/.libs -L/home/E341484/gnu-install/gcc_build/./mpfr/.libs -L/home/E341484/gnu-install/gcc_build/./mpc/src/.libs -lmpc -lmpfr -lgmp -rdynamic -ldl -L../zlib -lz /usr/bin/ld: warning: libgmpxx.so.4, needed by /usr/local/lib/libppl_c.so, may conflict with libgmpxx.so.3 /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libgmpxx.so: undefined reference to `__gmp_doprnt_mpf' collect2: ld returned 1 exit status Thanks, Wharton -----Original Message----- From: Ian Lance Taylor [mailto:iant@google.com] Sent: Friday, November 04, 2011 6:44 PM To: Sinkler, Wharton Cc: gcc-help@gcc.gnu.org Subject: Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu "Sinkler, Wharton" <Wharton.Sinkler@uop.com> writes: > I found more detail on the make failure in the file ./i686-pc-linux-gnu/libgcc/config.log, which shows an error occurring at this statement: > > configure:3028: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -V >&5 > xgcc: error: unrecognized option '-V' > xgcc: fatal error: no input files > compilation terminated. This is not the problem. This is a result of the configure script testing whether the compiler supports the -V option. You are looking in the right place, but you need to look for the last error in the config.log file. Ian ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-06 21:39 ` Sinkler, Wharton @ 2011-11-06 23:11 ` Jonathan Wakely 2011-11-07 17:10 ` Sinkler, Wharton 0 siblings, 1 reply; 12+ messages in thread From: Jonathan Wakely @ 2011-11-06 23:11 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: Ian Lance Taylor, gcc-help On 6 November 2011 21:38, Sinkler, Wharton wrote: > > The very last thing recognizable as an error in the gcc_build/i686-pc-linux-gnu/libgcc/config.log file is this: > > configure:3246: checking for suffix of object files > configure:3268: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -c -g -O2 conftest.c >&5 > /home/E341484/gnu-install/gcc_build/./gcc/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory > configure:3272: $? = 1 > > This seems to suggest I'm missing libcloog.so.0. However I have installed this already: > > ls -l /usr/local/lib/libcloog* > lrwxrwxrwx 1 root root 17 Nov 2 07:04 /usr/local/lib/libcloog.so.0 -> libcloog.so.0.0.0 > -rwxr-xr-x 1 root root 323388 Nov 2 07:04 /usr/local/lib/libcloog.so.0.0.0 > > (in addition to .a and .1a and .so as well in the same place). The path to these is specified in the configure command (with --with-cloog=/usr/local ). > > So shouldn't it be found? > > In another post from Johnathan Wakely, he sent some links to these web pages: > > http://gcc.gnu.org/wiki/FAQ#configure_suffix > http://advogato.org/person/redi/diary/253.html > > This suggests the 'cannot compute object file suffix' error is related to not having the prerequisites in place. No, that's not what it says. It says having them in place is not enough, the dynamic linker needs to find them. If you have them installed but not in the dynamic linker's search path then it will not find them. > I have however installed all of them (gmp-4.3.2, mpc-0.9, mpfr-3.1.0 in addition to ppl-0.11.2 and clog-ppl-0.15.11), and their locations are all specified in the configure statement (--with-gmp=/usr/local --with-mpc=/usr/local etc.). > > The 2nd link suggests using the ./contrib./download_prerequisites script to get the correct prerequisites in the correct places, which I then did (after freshly re-expanding everything from the .tar file and deleting everything from the gcc_build directory). > > I then ran: > > ../gcc-4.6.2/configure -enable-languages=c,c++,fortran > make > > but this also failed with the errors described below (suggests I have conflicting versions of gmp: do I need to find and get rid of gmp-3.x.x to get this to work?). Yes, that would solve the problem. ^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-06 23:11 ` Jonathan Wakely @ 2011-11-07 17:10 ` Sinkler, Wharton 2011-11-07 17:21 ` Jonathan Wakely 0 siblings, 1 reply; 12+ messages in thread From: Sinkler, Wharton @ 2011-11-07 17:10 UTC (permalink / raw) To: Jonathan Wakely; +Cc: Ian Lance Taylor, gcc-help Thanks to all. I got it built successfully after setting the LD_LIBRARY_PATH environment variable in the terminal: export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} If you are interested, I am hereby volunteering to contribute a short writeup of the successful installation process on my system. I think this could be helpful to people wanting to install gcc, but not as versed in Unix and working with compilers and linkers. One thing which I would recommend is to put links on the installation pages (http://gcc.gnu.org/install/) to some of FAQ and tutorial pages. Let me know if you would entertain my editing of the html files and emailing these back your way. Wharton -----Original Message----- From: Jonathan Wakely [mailto:jwakely.gcc@gmail.com] Sent: Sunday, November 06, 2011 5:11 PM To: Sinkler, Wharton Cc: Ian Lance Taylor; gcc-help@gcc.gnu.org Subject: Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu On 6 November 2011 21:38, Sinkler, Wharton wrote: > > The very last thing recognizable as an error in the gcc_build/i686-pc-linux-gnu/libgcc/config.log file is this: > > configure:3246: checking for suffix of object files > configure:3268: /home/E341484/gnu-install/gcc_build/./gcc/xgcc -B/home/E341484/gnu-install/gcc_build/./gcc/ -B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem /usr/local/i686-pc-linux-gnu/sys-include -c -g -O2 conftest.c >&5 > /home/E341484/gnu-install/gcc_build/./gcc/cc1: error while loading shared libraries: libcloog.so.0: cannot open shared object file: No such file or directory > configure:3272: $? = 1 > > This seems to suggest I'm missing libcloog.so.0. However I have installed this already: > > ls -l /usr/local/lib/libcloog* > lrwxrwxrwx 1 root root 17 Nov 2 07:04 /usr/local/lib/libcloog.so.0 -> libcloog.so.0.0.0 > -rwxr-xr-x 1 root root 323388 Nov 2 07:04 /usr/local/lib/libcloog.so.0.0.0 > > (in addition to .a and .1a and .so as well in the same place). The path to these is specified in the configure command (with --with-cloog=/usr/local ). > > So shouldn't it be found? > > In another post from Johnathan Wakely, he sent some links to these web pages: > > http://gcc.gnu.org/wiki/FAQ#configure_suffix > http://advogato.org/person/redi/diary/253.html > > This suggests the 'cannot compute object file suffix' error is related to not having the prerequisites in place. No, that's not what it says. It says having them in place is not enough, the dynamic linker needs to find them. If you have them installed but not in the dynamic linker's search path then it will not find them. > I have however installed all of them (gmp-4.3.2, mpc-0.9, mpfr-3.1.0 in addition to ppl-0.11.2 and clog-ppl-0.15.11), and their locations are all specified in the configure statement (--with-gmp=/usr/local --with-mpc=/usr/local etc.). > > The 2nd link suggests using the ./contrib./download_prerequisites script to get the correct prerequisites in the correct places, which I then did (after freshly re-expanding everything from the .tar file and deleting everything from the gcc_build directory). > > I then ran: > > ../gcc-4.6.2/configure -enable-languages=c,c++,fortran > make > > but this also failed with the errors described below (suggests I have conflicting versions of gmp: do I need to find and get rid of gmp-3.x.x to get this to work?). Yes, that would solve the problem. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 17:10 ` Sinkler, Wharton @ 2011-11-07 17:21 ` Jonathan Wakely 2011-11-07 17:25 ` Jonathan Wakely 0 siblings, 1 reply; 12+ messages in thread From: Jonathan Wakely @ 2011-11-07 17:21 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: Ian Lance Taylor, gcc-help On 7 November 2011 17:08, Sinkler, Wharton wrote: > Thanks to all. I got it built successfully after setting the LD_LIBRARY_PATH environment variable in the terminal: > > export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} > > If you are interested, I am hereby volunteering to contribute a short writeup of the successful installation process on my system. I think this could be helpful to people wanting to install gcc, but not as versed in Unix and working with compilers and linkers. > > One thing which I would recommend is to put links on the installation pages (http://gcc.gnu.org/install/) to some of FAQ and tutorial pages. > > Let me know if you would entertain my editing of the html files and emailing these back your way. Feel free to edit the wiki, but I'm curious what could be explained in simpler terms than http://advogato.org/person/redi/diary/253.html (less patronising terms, maybe, but what about those instructions is not clear?) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 17:21 ` Jonathan Wakely @ 2011-11-07 17:25 ` Jonathan Wakely 2011-11-07 17:30 ` Andrew Haley 0 siblings, 1 reply; 12+ messages in thread From: Jonathan Wakely @ 2011-11-07 17:25 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: Ian Lance Taylor, gcc-help On 7 November 2011 17:21, Jonathan Wakely wrote: > On 7 November 2011 17:08, Sinkler, Wharton wrote: >> Thanks to all. I got it built successfully after setting the LD_LIBRARY_PATH environment variable in the terminal: >> >> export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} >> >> If you are interested, I am hereby volunteering to contribute a short writeup of the successful installation process on my system. I think this could be helpful to people wanting to install gcc, but not as versed in Unix and working with compilers and linkers. >> >> One thing which I would recommend is to put links on the installation pages (http://gcc.gnu.org/install/) to some of FAQ and tutorial pages. >> >> Let me know if you would entertain my editing of the html files and emailing these back your way. > > Feel free to edit the wiki, but I'm curious what could be explained in > simpler terms than http://advogato.org/person/redi/diary/253.html > > (less patronising terms, maybe, but what about those instructions is not clear?) > N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I hope any writeup which suggests doing that will be rejected. The simplest solution is to install GCC from pre-built packages from someone who knows what they're doing, the next best is to link to gmp, mpfr and mpc statically so LD_LIBRARY_PATH is not needed. The worst, least reliable method is to require LD_LIBRARY_PATH to be set when running the compiler. Unfortunately everyone who tries to build the compiler thinks that installing gmp, mpfr and mpc in /some/path/to/libs is a good idea, then gets stuck, then discovers that LD_LIBRARY_PATH unsticks them, and thinks that's a good solution. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 17:25 ` Jonathan Wakely @ 2011-11-07 17:30 ` Andrew Haley 2011-11-07 17:40 ` Jonathan Wakely 0 siblings, 1 reply; 12+ messages in thread From: Andrew Haley @ 2011-11-07 17:30 UTC (permalink / raw) To: gcc-help On 11/07/2011 05:25 PM, Jonathan Wakely wrote: > N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I > hope any writeup which suggests doing that will be rejected. The > simplest solution is to install GCC from pre-built packages from > someone who knows what they're doing, the next best is to link to gmp, > mpfr and mpc statically so LD_LIBRARY_PATH is not needed. Indeed. Run ./contrib/download_prerequisites in the top-level dir and then build gcc. Andrew. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 17:30 ` Andrew Haley @ 2011-11-07 17:40 ` Jonathan Wakely 2011-11-07 20:28 ` Sinkler, Wharton 0 siblings, 1 reply; 12+ messages in thread From: Jonathan Wakely @ 2011-11-07 17:40 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: gcc-help On 7 November 2011 17:29, Andrew Haley wrote: > On 11/07/2011 05:25 PM, Jonathan Wakely wrote: >> N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I >> hope any writeup which suggests doing that will be rejected. The >> simplest solution is to install GCC from pre-built packages from >> someone who knows what they're doing, the next best is to link to gmp, >> mpfr and mpc statically so LD_LIBRARY_PATH is not needed. > > Indeed. Run ./contrib/download_prerequisites in the top-level dir and > then build gcc. Which is exactly what my blog post says to do. I used to give instructions to unpack the prerequisites manually, but wrote a new version after learning of the download_prerequisites script from Andrew, and that new version is about as simple as it can be: # the version you will build gccver=4.6.2 # where you put the downloaded source packages pkgdir=$HOME # where you will build gcc rootdir=$HOME/gcc-tmp # where you want to install gcc prefix=/opt/gcc-${gccver} # the languages you want gcc to support langs=c,c++ mkdir ${rootdir} cd ${rootdir} tar xzf ${pkgdir}/gcc-${gccver}.tar.gz cd gcc-${gccver} ./contrib/download_prerequisites cd .. mkdir objdir cd objdir ${rootdir}/gcc-${gccver}/configure --prefix=${prefix} --enable-languages=${langs} make make install Is it the variables that make it complicated? Without them you'd need to keep editing bits of the text if you're trying to build a different version to the one in the example, but here you go, if you prefer: mkdir tmpdir cd tmpdir UNPACK THE SOURCE ARCHIVE cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir ../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 --enable-languages=c,c++ make make install How do you intend to write that up to be any simpler? The version with variables is more flexible, because it makes it should be clear that all the user-adjustable bits are the variables at the start, the rest should be done verbatim. ^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 17:40 ` Jonathan Wakely @ 2011-11-07 20:28 ` Sinkler, Wharton 2011-11-07 20:48 ` Jonathan Wakely 0 siblings, 1 reply; 12+ messages in thread From: Sinkler, Wharton @ 2011-11-07 20:28 UTC (permalink / raw) To: Jonathan Wakely; +Cc: gcc-help Jonathan, It should be simple. But to be fair, there's no mention of the ./contrib/download_prerequisites on the installation website (gcc.gnu.org/install) which is probably the first thing people wanting to install gcc will find. Also, the prerequisites page essentially tells you to download and install the support libraries, and to put them into the library search path using --with-gmp=/ (etc.). It even gives you links to the tar.gz files. The default installation the puts them on /usr/local. Anyway, doing all that did not work initially, then sort of did work by setting the LD_LIBRARY_PATH. However, I am having problems with the compilers, possibly since I've gummed things up pretty well at this point. So I'd like to redo everything using the ./contrib./download_prerequisites script. When I do that now, the make fails because I have two versions of gmp on the system, one in /usr/lib (version 3) and the other on /usr/local/lib (version 4). Here's the error: /usr/bin/ld: warning: libgmpxx.so.4, needed by /usr/local/lib/libppl_c.so, may conflict with libgmpxx.so.3 /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libgmpxx.so: undefined reference to `__gmp_doprnt_mpf' collect2: ld returned 1 exit status What is your recommendation concerning how to deal with this? Should I uninstall then re-install gmp-4.3.2 with --prefix=/usr/lib? I would assume I need to uninstall gmp-3.3.3 first, but would appreciate any recommendations on how to do that cleanly. Thanks again, Wharton -----Original Message----- From: Jonathan Wakely [mailto:jwakely.gcc@gmail.com] Sent: Monday, November 07, 2011 11:40 AM To: Sinkler, Wharton Cc: gcc-help@gcc.gnu.org Subject: Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu On 7 November 2011 17:29, Andrew Haley wrote: > On 11/07/2011 05:25 PM, Jonathan Wakely wrote: >> N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I >> hope any writeup which suggests doing that will be rejected. The >> simplest solution is to install GCC from pre-built packages from >> someone who knows what they're doing, the next best is to link to gmp, >> mpfr and mpc statically so LD_LIBRARY_PATH is not needed. > > Indeed. Run ./contrib/download_prerequisites in the top-level dir and > then build gcc. Which is exactly what my blog post says to do. I used to give instructions to unpack the prerequisites manually, but wrote a new version after learning of the download_prerequisites script from Andrew, and that new version is about as simple as it can be: # the version you will build gccver=4.6.2 # where you put the downloaded source packages pkgdir=$HOME # where you will build gcc rootdir=$HOME/gcc-tmp # where you want to install gcc prefix=/opt/gcc-${gccver} # the languages you want gcc to support langs=c,c++ mkdir ${rootdir} cd ${rootdir} tar xzf ${pkgdir}/gcc-${gccver}.tar.gz cd gcc-${gccver} ./contrib/download_prerequisites cd .. mkdir objdir cd objdir ${rootdir}/gcc-${gccver}/configure --prefix=${prefix} --enable-languages=${langs} make make install Is it the variables that make it complicated? Without them you'd need to keep editing bits of the text if you're trying to build a different version to the one in the example, but here you go, if you prefer: mkdir tmpdir cd tmpdir UNPACK THE SOURCE ARCHIVE cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir ../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 --enable-languages=c,c++ make make install How do you intend to write that up to be any simpler? The version with variables is more flexible, because it makes it should be clear that all the user-adjustable bits are the variables at the start, the rest should be done verbatim. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu 2011-11-07 20:28 ` Sinkler, Wharton @ 2011-11-07 20:48 ` Jonathan Wakely 0 siblings, 0 replies; 12+ messages in thread From: Jonathan Wakely @ 2011-11-07 20:48 UTC (permalink / raw) To: Sinkler, Wharton; +Cc: gcc-help On 7 November 2011 20:28, Sinkler, Wharton wrote: > Jonathan, > > It should be simple. But to be fair, there's no mention of the ./contrib/download_prerequisites on the installation website (gcc.gnu.org/install) which is probably the first thing people wanting to install gcc will find. > > Also, the prerequisites page essentially tells you to download and install the support libraries, and to put them into the library search path using --with-gmp=/ (etc.). (That's not quite what it says, but nevermind.) It also says "Alternatively, if a GMP source distribution is found in a subdirectory of your GCC sources named gmp, it will be built together with GCC. " I'll update those docs to suggest using the download_prerequisites script. > It even gives you links to the tar.gz files. The default installation the puts them on /usr/local. Most people don't have root access so can't install to /usr/local anyway. If you have root access on a *nix machine there's an assumption you know what you're doing. If you don't know what you're doing: stop trying to install software from source as root - you're fairly likely to destroy your system. > Anyway, doing all that did not work initially, then sort of did work by setting the LD_LIBRARY_PATH. However, I am having problems with the compilers, possibly since I've gummed things up pretty well at this point. > > So I'd like to redo everything using the ./contrib./download_prerequisites script. When I do that now, the make fails because I have two versions of gmp on the system, one in /usr/lib (version 3) and the other on /usr/local/lib (version 4). Here's the error: > > /usr/bin/ld: warning: libgmpxx.so.4, needed by /usr/local/lib/libppl_c.so, may conflict with libgmpxx.so.3 > /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libgmpxx.so: undefined reference to `__gmp_doprnt_mpf' > collect2: ld returned 1 exit status You seem to be building ppl and cloog. Do you actually need them? If not, building gcc without them will be easier. > What is your recommendation concerning how to deal with this? Should I uninstall then re-install gmp-4.3.2 with --prefix=/usr/lib? I would assume I need to uninstall gmp-3.3.3 first, but would appreciate any recommendations on how to do that cleanly. You will definitely break something if you just start installing things to /usr and overwriting system libraries. Don't even think about it. As you appear to be on a Red Hat based system you can probably remove the existing package with something like: yum erase gmp-devel Once you've done that stop working as 'root' immediately, before you break something. When the old libgmpxx.so has been removed you should be able to build gcc. You could then reinstall the erased packages if you need them, but I'm guessing you don't. ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-11-07 20:48 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-11-04 18:25 gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu Sinkler, Wharton 2011-11-04 23:41 ` Jonathan Wakely 2011-11-04 23:44 ` Ian Lance Taylor 2011-11-06 21:39 ` Sinkler, Wharton 2011-11-06 23:11 ` Jonathan Wakely 2011-11-07 17:10 ` Sinkler, Wharton 2011-11-07 17:21 ` Jonathan Wakely 2011-11-07 17:25 ` Jonathan Wakely 2011-11-07 17:30 ` Andrew Haley 2011-11-07 17:40 ` Jonathan Wakely 2011-11-07 20:28 ` Sinkler, Wharton 2011-11-07 20:48 ` Jonathan Wakely
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).