Here is the update. It took 1.5 hours to compile on my Opteron (just C and
C++). The tests did not pass successfully, but that does not matter. I did
a 'make install' and put in all in the location I indicated in my original
post (see below). I made a module for the installation, and it looks like
this:

------
#%Module
proc ModulesHelp { } {
        puts stderr "
        Sets up environment to use the GCC 6.3.0 build
        See man pages for more information.
        "
}

conflict gcc
#prereq ...

append-path LIBDIR           /opt/IN/gcc-6.3.0
append-path PATH             /opt/IN/gcc-6.3.0/bin
append-path LD_LIBRARY_PATH  /opt/IN/gcc-6.3.0/lib64
prepend-path MANPATH         /opt/IN/gcc-6.3.0/share/man/
append-path LD_RUN_PATH      /opt/IN/gcc-6.3.0/lib64
------

I tested it and it worked:

iznogoud at bigpapa:~> module load gcc6.3.0
iznogoud at bigpapa:~> izno_gcc hrt.c -lrt
iznogoud at bigpapa:~> ### Above is the hrt.c test I made for Rick earlier
iznogoud at bigpapa:~> ./a.out 
Usage: ./a.out <sleep-secs> <freq-nanosecs>
iznogoud at bigpapa:~> izno_gcc -v 
Using built-in specs.
COLLECT_GCC=izno_gcc
COLLECT_LTO_WRAPPER=/opt/IN/gcc-6.3.0/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/opt/IN/gcc-6.3.0 --program-prefix=izno_ --disable-multilib --enable-stage1-checking=all --enable-languages=c,c++ --disable-bootstartp --with-system-zlib
Thread model: posix
gcc version 6.3.0 (GCC) 
iznogoud at bigpapa:~>

It works. But some more points need to be made. The executable above was
compiled with GCC 6.3.0, and I know this because I used the "-v" switch
while compiling/linking with expected results (I will not paste them here).
But this is what I noticed, which is not a problem (look below):

iznogoud at bigpapa:~> ldd a.out
        linux-vdso.so.1 (0x00007ffff4bff000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f14bbf67000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f14bbb9d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f14bb980000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f14bc191000)
iznogoud at bigpapa:~> 

 
Also, you were interested in C++. It was built successfully:

iznogoud at bigpapa:~/test> make 
izno_g++     -D_GNU_SOURCE    -g -fPIC -O0  -c STLfile.cpp
izno_g++     -D_GNU_SOURCE    -g -fPIC -O0  -c -I . main.cpp -lm
izno_g++     -D_GNU_SOURCE    STLfile.o main.o octree.o
iznogoud at bigpapa:~/test>

iznogoud at bigpapa:~/test> ldd a.out
        linux-vdso.so.1 (0x00007fffa9dff000)
        libstdc++.so.6 => /opt/IN/gcc-6.3.0/lib64/libstdc++.so.6 (0x00007f849a859000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f849a535000)
        libgcc_s.so.1 => /opt/IN/gcc-6.3.0/lib64/libgcc_s.so.1 (0x00007f849a31f000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f8499f56000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f849abdb000)
iznogoud at bigpapa:~/test>

And this code worked as expected as well.

I think you have all you need to build the pieces of GCC that you want and
a way to drop it into an existing distro without conflicts. You are welcome.



On Mon, Jan 30, 2017 at 01:50:21PM +0000, Iznogoud wrote:
> > 
> > I bit this bullet again now and built a very recent version of gcc7.
> > It took over 8 hours on my Vizio laptop.  If there's a way to get it to
> > just build the C and C++ compilers, I'm not aware of it.
> > 
> 
> I figured I'd give it a shot. I took the gcc-6.3.0 tarball, as gcc-7.x is
> still unreleased. I am doing this on Slackware64 14.1 on kernel 3.10.17.
> 
> To build just what you want, use this first switch at configure:
> 
> ./configure --enable-languages=c,c++ \
>             --prefix=/opt/gcc-6.3.0 --program-prefix=izno_ \
>             --with-system-zlib --disable-multilib
> 
> The prefix is where I dump binaries and libraries that will become modules
> (as I described earlier). The program-prefix is so that I avoid conflicts
> with the existing gcc, g++ and so on when the gcc=6.3.0 module is loaded.
> I do not use the Zlib that came with the distribution because it fails to
> build (this took me a while to isolate). I disable building the 32-bit
> stuff with the last switch.
> 
> It configured. I put 3 threads to the compiling task ('make -j 3') as I am
> doing other stuff on this system right now and that is what I could spare.
> Will report back on results.
> 
> 
> > 
> > I've never done anything with Intel's C++ compiler.  Mostly I use Clang,
> > GCC, and a little bit of Microsoft.
> >
> 
> As a side note, Intel has done an incredible amount of work to bring good
> compilers and other tools to life, and some of them for free. (I think, and
> I could be wrong, that this is in support of computer installationas at
> government HPC facilities where, to my knowledge, almost everything is on
> Intel hardware.) The C, C++ and Fortran compilers are very good, on both
> Linux and Microsoft Visual Studio.
> 
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list