build GNU GCC 4.3.1

This is a discussion on build GNU GCC 4.3.1 within the Tech Board forums, part of the Community Boards category; Hi everyone, Trying to experiment with C++0x , which will be the new C++ standard by next year, I've downloaded ...

  1. #1
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248

    Question build GNU GCC 4.3.1

    Hi everyone,

    Trying to experiment with C++0x , which will be the new C++ standard by next year, I've downloaded the tarball of the gnu gcc compiler under development. But I'm stuck at the installation...

    Anyone, HELP!

    I did, according to the description http://gcc.gnu.org/install/configure.html , the following things:

    1. get the MPL (multiple precision library) including source --> OK
    2. get the MPFRCPP (which requires MPFR and GMP) --> OK
    3. make the object-dir separated from the src dir (for testing) --> OK
    4. from within the object-dir : `src dir`/configure --> OK

    now just to be sure, I have checked the Makefile which has been generated by the 'configure' command. this contains the following lines:
    # Directory where sources are, from where we are.
    srcdir = ../gcc
    gcc_docdir = ../gcc/doc

    # Directory where sources are, absolute.
    abs_srcdir = /usr/share/gcc-4.3.1/gcc_objectdir/../gcc
    abs_docdir = /usr/share/gcc-4.3.1/gcc_objectdir/../gcc/doc

    # Top build directory for this package, relative to here.
    top_builddir = .

    # objdir is set by configure.
    # It's normally the absolute path to the current directory.
    objdir = /usr/share/gcc-4.3.1/gcc_objectdir
    and these are exactly the directories I've created. So it all seems to be OK.

    BUT:

    I get the following error:

    build/genmodes -h > tmp-modes.h
    /bin/sh: build/genmodes: No such file or directory


    Then when I look in the Makefile just mentioned (the Makefile created in the 'object-dir' by the command 'configure'), I see these lines:
    insn-modes.c: s-modes; @true
    insn-modes.h: s-modes-h; @true
    min-insn-modes.c: s-modes-m; @true

    s-modes: build/genmodes$(build_exeext)
    $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
    $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c
    $(STAMP) s-modes

    s-modes-h: build/genmodes$(build_exeext)
    $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
    $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
    $(STAMP) s-modes-h

    s-modes-m: build/genmodes$(build_exeext)
    $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
    $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
    $(STAMP) s-modes-m

    There is no file or directory which is called genmodes in the directory "build" (which itself does exist)!!

    sniff..... anyone an idea? I don't put any options with 'make' , and I'm just installing it as a native compiler.

    Thanks sooooo much in advance.

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,181
    That smells like a regression...

    What environment are you building for?
    How did you configure the build?
    Are you building from a child directory?

    Also, have you looked into the configure used by others who've built successfully?

    Anyway, historically if you ran './gcc/gcc/configure' instead of './gcc/configure', or if you ran './gcc/configure' in the source directory or a chlid of the source directory you'd get the same error.

    Also, I've always gotten best results with putting the source somewhere like '/usr/testbed/gcc_source' and running configure as '../gcc_source/configure' from /usr/testbed/gcc_build'.

    Soma

  3. #3
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248
    Thanks, this is also what Brian Dessent from gnu tells me http://gcc.gnu.org/ml/gcc-help/2008-06/msg00077.html
    , but I think I did get this point from the manual and I've done it ok. This is my directory structure:

    /usr/share/gcc-4.3.1/gcc <--- contains all the .c and .h files
    /usr/share/gcc-4.3.1/gcc_objectdir <--- from which I entered the command 'make'

    So there seems to be a correct distinction between these two directories. I did make the mistake to enter the command '../gcc/make' , but since there is no Makefile in this directory, it cannot do anything wrong.

    But I'll try again.... and I'll let you know. Thanks a lot!

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,181
    From the look of things you still aren't getting it.

    Image this... er... virtual terminal session:

    Code:
    > cd /usr/testbed
    > ls
         gcc-4.3.1.tar.bz2         file        ?????
    > tar -xjf gcc-4.3.1.tar.bz2
    > ls
         gcc-4.3.1                 dir         ?????
         gcc-4.3.1.tar.bz2         file        ?????
    > mkdir mybuild
    > ls
         gcc-4.3.1                 dir         ?????
         mybuild                   dir         ?????
         gcc-4.3.1.tar.bz2         file        ?????
    > cd mybuild
    > ../gcc-4.3.1/configure --blah --blahblah
    > make CFLAGS="BLAH"
    Soma

  5. #5
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248
    But that is exactly what I'm doing, except that I don't enter any option for the commands 'configure' and make. This wasn't necessary according to the installation instructions.

    I've attached a copy of the terminal output.

    Thanks..

    EDIT: this is the screen output from my first attempt.
    Attached Files Attached Files
    Last edited by MarkZWEERS; 08-10-2008 at 08:22 AM.

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Did you...

    > Start from a cleanly unpacked source dir without any remnants of failed
    attempts.

  7. #7
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248
    yes, for my second attempt I removed the entire directory "/usr/share/gcc-4.3.1"

    Then I unpacked the tarball again in "/usr/share/" , with this new directory structure:

    /usr/share/gcc-4.3.1/gcc <--- contains all the .c and .h files
    /usr/lib/gcc/gcc_4.3.1/ <--- from which I entered
    1). the command '/usr/share/gcc-4.3.1/gcc/configure'
    2). the command 'make'

    same errors...

    I'm using Debian Etch, I have installed GCC 4.1 with its binary 'g++' in the directory '/usr/bin'
    My system is a x86 ordinary two-year old laptop, nothing special.

    thanks..

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    wait, what are you doing in /usr/lib?

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,181
    But that is exactly what I'm doing, except that I don't enter any option for the commands 'configure' and make.
    It doesn't seem so; in fact it looks as if you are completely ignoring the instructions.

    Then I unpacked the tarball again in "/usr/share/"
    Which should give you the subdirectory 'gcc-4.3.1' as '/usr/share/gcc-4.3.1'.

    With this in mind:

    You do not create a child directory in '/usr/share/gcc-4.3.1'.
    You do not run '/usr/share/gcc-4.3.1/gcc/configure'.
    You do not build under any previous GCC installation directory.
    You do not build under the directory where you want the new GCC installed.

    You do start with a fresh repository.
    You do start with a clean build directory.
    You do create a sibling directory '/usr/share/mygccbuild'.
    You do run '/usr/share/gcc-4.3.1/configure'.

    Note: The correct script '/usr/share/gcc-4.3.1/configure' is a world away from the script '/usr/share/gcc-4.3.1/gcc/configure' that you are running.

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. PlaySound
    By cangel in forum C++ Programming
    Replies: 16
    Last Post: 10-08-2009, 05:29 PM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. GNU Build System and referring to Libraries
    By orwb in forum Linux Programming
    Replies: 7
    Last Post: 12-06-2007, 02:41 AM
  4. Boom, Headoshot!!
    By mrafcho001 in forum A Brief History of Cprogramming.com
    Replies: 50
    Last Post: 07-21-2005, 08:28 PM
  5. Modifying the GNU GCC 2.95 compiler
    By shp in forum Linux Programming
    Replies: 2
    Last Post: 03-07-2004, 09:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21