public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to test uninstalled GCC 4.8 C and Fortran compilers?
@ 2014-01-11  1:47 David Bernier
  2014-01-11 11:55 ` Brian Drummond
  2014-01-11 12:47 ` Jonathan Wakely
  0 siblings, 2 replies; 3+ messages in thread
From: David Bernier @ 2014-01-11  1:47 UTC (permalink / raw)
  To: gcc-help

It seems that I've successfully built gcc-4.8
in a sub-directory of my $HOME directory,
after obtaining the source code
through git.

As there were problems with `make' the first time
around with java, the second time around I only
enabled the languages C, C++ and Fortran; that
was done in options to the "configure" script:


$ git checkout -b gcc-4_8-branch origin/gcc-4_8-branch
$ cd gcc
$ ./configure --enable-languages=c,c++,fortran
$ make

< Here I snip the output of "build", except the last few lines, copied
below... >

libtool: link: /usr/local/x86_64-unknown-linux-gnu/bin/ranlib
.libs/libatomic.a
libtool: link: ( cd ".libs" && rm -f "libatomic.la" && ln -s
"../libatomic.la" "libatomic.la" )
true  DO=all multi-do # make
make[8]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/32/libatomic'
make[7]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/32/libatomic'
make[6]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/32/libatomic'
make[5]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/libatomic'
make[4]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/libatomic'
make[3]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/libatomic'
make[2]: Leaving directory
`/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/libatomic'
make[1]: Leaving directory `/home/david/local_gcc/gcc'


--

I don't want to install in the default directories
the C and Fortran compilers for the time being.

I'd like to test the GCC 4.8 C and Fortran compilers for
now.  I suppose I could do that from the
/home/david/local_gcc/gcc directory or a sub-directory,
or else perhaps install GCC 4.8 in a
non-standard directory, so as not to interfere with
the "System" gcc, i.e.:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) .

I have the GCC 4.8.2 manual with me, but I've only
used the gcc C compiler that comes with my Linux
distribution, CentOS 6.5 .

I would welcome advice on how to test the GCC 4.8
C and Fortran compilers that were built in
my home directory's sub-directory, i.e.
/home/david/local_gcc/gcc .



Thanks for the help.


David Bernier



Below, I've listed the contents of the
(GCC 4.8) build directory $HOME/local_gcc/gcc .

$ ls -l

total 4596
-rw-rw-r--.  1 david david   38475 Jan 10 12:16 ABOUT-NLS
drwxrwxr-x.  7 david david    4096 Jan 10 13:36 boehm-gc
drwxrwxr-x.  4 david david    4096 Jan 10 13:41
build-x86_64-unknown-linux-gnu
-rw-rw-r--.  1 david david  552710 Jan 10 13:36 ChangeLog
-rw-rw-r--.  1 david david    3262 Jan 10 12:16 ChangeLog.tree-ssa
-rw-rw-r--.  1 david david      10 Jan 10 15:23 compare
-rwxrwxr-x.  1 david david    3707 Jan 10 12:16 compile
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 config
-rwxrwxr-x.  1 david david   44850 Jan 10 13:36 config.guess
-rw-rw-r--.  1 david david   29212 Jan 10 18:30 config.log
-rw-rw-r--.  1 david david   25398 Jan 10 12:16 config-ml.in
-rwxrwxr-x.  1 david david   14916 Jan 10 12:16 config.rpath
-rwxrwxr-x.  1 david david   33361 Jan 10 18:30 config.status
-rwxrwxr-x.  1 david david   35686 Jan 10 13:36 config.sub
-rwxrwxr-x.  1 david david  471491 Jan 10 13:36 configure
-rw-rw-r--.  1 david david  103198 Jan 10 13:36 configure.ac
drwxrwxr-x.  5 david david    4096 Jan 10 13:36 contrib
-rw-rw-r--.  1 david david   18002 Jan 10 12:16 COPYING
-rw-rw-r--.  1 david david   35147 Jan 10 12:16 COPYING3
-rw-rw-r--.  1 david david    7639 Jan 10 12:16 COPYING3.LIB
-rw-rw-r--.  1 david david   26527 Jan 10 12:16 COPYING.LIB
-rw-rw-r--.  1 david david    3324 Jan 10 12:16 COPYING.RUNTIME
-rwxrwxr-x.  1 david david   18615 Jan 10 12:16 depcomp
drwxrwxr-x.  3 david david    4096 Jan 10 13:36 fixincludes
drwxrwxr-x. 18 david david   20480 Jan 10 13:36 gcc
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 gnattools
drwxrwxr-x. 28 david david    4096 Jan 10 18:35
host-x86_64-unknown-linux-gnu
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 include
drwxrwxr-x.  2 david david    4096 Jan 10 12:16 INSTALL
-rwxrwxr-x.  1 david david   13663 Jan 10 12:16 install-sh
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 intl
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 libada
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libatomic
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 libbacktrace
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libcpp
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libdecnumber
drwxrwxr-x.  8 david david    4096 Jan 10 13:36 libffi
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libgcc
drwxrwxr-x.  9 david david    4096 Jan 10 13:36 libgfortran
drwxrwxr-x.  6 david david    4096 Jan 10 13:36 libgo
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libgomp
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libiberty
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libitm
drwxrwxr-x. 15 david david    4096 Jan 10 13:36 libjava
drwxrwxr-x.  3 david david    4096 Jan 10 13:36 libmudflap
drwxrwxr-x.  4 david david    4096 Jan 10 13:36 libobjc
drwxrwxr-x.  5 david david    4096 Jan 10 13:36 libquadmath
drwxrwxr-x.  7 david david    4096 Jan 10 13:36 libsanitizer
drwxrwxr-x.  3 david david    4096 Jan 10 13:36 libssp
drwxrwxr-x. 11 david david    4096 Jan 10 13:36 libstdc++-v3
-rwxrwxr-x.  1 david david    3370 Jan 10 12:16 libtool-ldflags
-rw-rw-r--.  1 david david  263658 Jan 10 13:36 libtool.m4
-rw-rw-r--.  1 david david    1768 Jan 10 12:16 ltgcc.m4
-rw-rw-r--.  1 david david  249709 Jan 10 12:16 ltmain.sh
-rw-rw-r--.  1 david david    6126 Jan 10 12:16 lt~obsolete.m4
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 lto-plugin
-rw-rw-r--.  1 david david   11950 Jan 10 12:16 ltoptions.m4
-rw-rw-r--.  1 david david    4372 Jan 10 12:16 ltsugar.m4
-rw-rw-r--.  1 david david     703 Jan 10 12:16 ltversion.m4
-rw-rw-r--.  1 david david   23258 Jan 10 13:36 MAINTAINERS
drwxrwxr-x.  2 david david    4096 Jan 10 13:36 maintainer-scripts
-rw-rw-r--.  1 david david  736606 Jan 10 18:30 Makefile
-rw-rw-r--.  1 david david   26999 Jan 10 13:36 Makefile.def
-rw-rw-r--.  1 david david 1545138 Jan 10 13:36 Makefile.in
-rw-rw-r--.  1 david david   68387 Jan 10 13:36 Makefile.tpl
-rwxrwxr-x.  1 david david   11419 Jan 10 12:16 missing
-rwxrwxr-x.  1 david david    2179 Jan 10 12:16 mkdep
-rwxrwxr-x.  1 david david    3538 Jan 10 12:16 mkinstalldirs
-rwxrwxr-x.  1 david david    2648 Jan 10 12:16 move-if-change
drwxrwxr-x.  7 david david    4096 Jan 10 15:00
prev-x86_64-unknown-linux-gnu
-rw-rw-r--.  1 david david    1026 Jan 10 12:16 README
-rw-rw-r--.  1 david david      13 Jan 10 18:30 serdep.tmp
drwxrwxr-x.  7 david david    4096 Jan 10 14:03
stage1-x86_64-unknown-linux-gnu
-rw-rw-r--.  1 david david       7 Jan 10 18:35 stage_current
-rw-rw-r--.  1 david david       7 Jan 10 13:40 stage_final
-rw-rw-r--.  1 david david       7 Jan 10 18:35 stage_last
-rwxrwxr-x.  1 david david    2265 Jan 10 12:16 symlink-tree
drwxrwxr-x. 18 david david    4096 Jan 10 18:46 x86_64-unknown-linux-gnu
-rwxrwxr-x.  1 david david    6179 Jan 10 12:16 ylwrap
drwxrwxr-x. 14 david david    4096 Jan 10 13:36 zlib

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to test uninstalled GCC 4.8 C and Fortran compilers?
  2014-01-11  1:47 How to test uninstalled GCC 4.8 C and Fortran compilers? David Bernier
@ 2014-01-11 11:55 ` Brian Drummond
  2014-01-11 12:47 ` Jonathan Wakely
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Drummond @ 2014-01-11 11:55 UTC (permalink / raw)
  To: gcc-help

On Fri, 2014-01-10 at 20:47 -0500, David Bernier wrote:
> It seems that I've successfully built gcc-4.8
> in a sub-directory of my $HOME directory,

> $ ./configure --enable-languages=c,c++,fortran
> $ make
...
> make[2]: Leaving directory
> `/home/david/local_gcc/gcc/x86_64-unknown-linux-gnu/libatomic'
> make[1]: Leaving directory `/home/david/local_gcc/gcc'

Looks like a successful make, as you say.

> I don't want to install in the default directories
> the C and Fortran compilers for the time being.

Smart move... you don't want "make install" to rm the previous compiler
then find a problem with the new one. Trust me on this...

Easiest way is to add a prefix to some alternative install location,
e.g.  --prefix=/opt/experiment/gcc 
to the configure command and rebuild. 

Then "make install" will install to /opt/experiment/gcc instead of the
default. (You may need to create the /opt/experiment/gcc folder, and run
"make install" with permissions to write to it)

Then before you test, you add /opt/experiment/gcc/bin to $PATH, e.g.
export PATH=/opt/experiment/gcc/bin:$PATH

- Brian



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to test uninstalled GCC 4.8 C and Fortran compilers?
  2014-01-11  1:47 How to test uninstalled GCC 4.8 C and Fortran compilers? David Bernier
  2014-01-11 11:55 ` Brian Drummond
@ 2014-01-11 12:47 ` Jonathan Wakely
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2014-01-11 12:47 UTC (permalink / raw)
  To: David Bernier; +Cc: gcc-help

On 11 January 2014 01:47, David Bernier wrote:
>
> As there were problems with `make' the first time
> around with java, the second time around I only
> enabled the languages C, C++ and Fortran; that
> was done in options to the "configure" script:
>
>
> $ git checkout -b gcc-4_8-branch origin/gcc-4_8-branch
> $ cd gcc
> $ ./configure --enable-languages=c,c++,fortran
> $ make

It's recommended to do the build outside the source directory, see
http://gcc.gnu.org/wiki/InstallingGCC

The advantage is that if you mess the build up then the source
directory is untouched, so you can just remove the entire build
directory and start again in an empty directory.


> I don't want to install in the default directories
> the C and Fortran compilers for the time being.

The default installation prefix is /usr/local, so it wouldn't replace
your system compiler (which is good, because replacing the system
compiler is usually a bad idea).

> I'd like to test the GCC 4.8 C and Fortran compilers for
> now.  I suppose I could do that from the
> /home/david/local_gcc/gcc directory or a sub-directory,
> or else perhaps install GCC 4.8 in a
> non-standard directory, so as not to interfere with
> the "System" gcc, i.e.:
> gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) .
>
> I have the GCC 4.8.2 manual with me, but I've only
> used the gcc C compiler that comes with my Linux
> distribution, CentOS 6.5 .
>
> I would welcome advice on how to test the GCC 4.8
> C and Fortran compilers that were built in
> my home directory's sub-directory, i.e.
> /home/david/local_gcc/gcc .

I asume you mean do your own tests, not run the testsuite (which would
be simply "make check" in the build dir).

You can install it to a temporary directory by overriding the
installation prefix with DESTDIR e.g.

mkdir $HOME/gcc_tmp_dir
make install DESTDIR=$HOME/gcc_tmp_dir've finished testing

When you've finished testing you can just remove that directory, or
move it somewhere else.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-11 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-11  1:47 How to test uninstalled GCC 4.8 C and Fortran compilers? David Bernier
2014-01-11 11:55 ` Brian Drummond
2014-01-11 12:47 ` 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).