two gccs
Patrick Begou
Patrick.Begou@univ-grenoble-alpes.fr
Sun Oct 17 15:57:07 GMT 2021
Yes this is the software. I think you are running Linux (speaking of
$PATH) and this software is packaged for many distributions and largely
used from laptop to supercompters.
I use it for a while on CentOS Linux:
CentOS6/RHEL6 rpm: environment-modules-3.2.10-2.el6.x86_64
CentOS7/RHEL7 rpm: environment-modules-3.2.10-10.el7.x86_64
CentOS8/RHEL8 rpm: environment-modules-4.1.4-4.el8.x86_64
Ubuntu 20.4 : environment-modules 4.4.1-1
etc...
A module file can be as simple as this example for gcc10 installed in
/opt/GCC10.2/Compilers on my cluster:
#%Module1.0#####################################################################
##
## gnu gcc 10.2 modulefile
##
## modulefiles/
##
proc ModulesHelp { } {
puts stderr "\t Use gnu compilers 10.2"
}
module-whatis "Use Gnu gcc 10.2 compilers suite"
# for Tcl script use only
set gccHome /opt/GCC10.2/Compilers
setenv GCCHOME $gccHome
prepend-path MANPATH $gccHome/share/man
prepend-path PATH $gccHome/bin
prepend-path LD_LIBRARY_PATH $gccHome/lib
prepend-path LD_LIBRARY_PATH $gccHome/lib64
if [ module-info mode load ] {
puts stderr "\tLoaded Gnu 10.2 compilers (gcc, g++, gfortran)"
}
There is a system location where these file must be (for system wide
use): /usr/share/Modules for CentOS/RHEL and you can create sub-directories.
Module files can also be located in a private directory for a user. In
this case use:
module use /my/private/module/files/directory
Then basic commands are:
module avail => list available modules
module load foo => loads module foo
module unload foo => unload the module foo
module purge => unload all the modules
module list => show the currently loaded modules
This a very powerfull tool and I never get any trouble with it on Redhat
and RedHat-like systems that I use.
Patrick
Le 17/10/2021 à 16:44, Dan Kegel a écrit :
> Patrick, are you referring to http://modules.sourceforge.net
> <http://modules.sourceforge.net> ?
>
> (Not all build systems are especially happy with its use
> of LD_LIBRARY_PATH, I think, fwiw.)
>
> Bill,
> can you describe your situation a little better?
>
> - Dan
>
> Patrick Begou via Gcc-help <gcc-help@gcc.gnu.org
> <mailto:gcc-help@gcc.gnu.org>> schrieb am So., 17. Okt. 2021, 01:59:
>
> Le 17/10/2021 à 04:16, Bill Cunningham via Gcc-help a écrit :
> > I am partially complete with a build of gcc-11.2.0. The thing is
> > that I need the system to recognize the gcc driver I am calling
> on. I
> > will also be working on two glibcs, but first thing first.
> >
> > There is the system gcc, and the test gcc. Of course I can only
> > get the system gcc to work. Can the $PATH variable be changed to
> > access the test gcc, which btw, is not fully complete? Or can sym
> > links be used in a very skillful manner. I have read both these ways
> > can, somehow, be used. But I would think gcc runtime switches would
> > work. The system is considering these two gccs as different as their
> > triplets are different.
> >
> >
> To uses several flavor of a same software, have a look at the
> environment module. On my cluster It allows users to select gcc6, gcc9
> or gcc10 flavor easily in production, setting PATH,
> LD_LIBRARY_PATH,....etc. with "module load" / "module unload"
> commands.
>
> Patrick
>
More information about the Gcc-help
mailing list