public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Begou <Patrick.Begou@univ-grenoble-alpes.fr>
To: Dan Kegel <dank@kegel.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: two gccs
Date: Sun, 17 Oct 2021 17:57:07 +0200	[thread overview]
Message-ID: <147167fb-5c08-9677-89c2-06a1c4d01d0d@univ-grenoble-alpes.fr> (raw)
In-Reply-To: <CAPF-yOboZ7CN3m5Yzfaer7-eNBW64W4pssPgCF0FiX1YKZBjSg@mail.gmail.com>

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
>


      reply	other threads:[~2021-10-17 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-17  2:16 Bill Cunningham
2021-10-17  4:27 ` Dan Kegel
2021-10-17  8:58 ` Patrick Begou
2021-10-17 14:44   ` Dan Kegel
2021-10-17 15:57     ` Patrick Begou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=147167fb-5c08-9677-89c2-06a1c4d01d0d@univ-grenoble-alpes.fr \
    --to=patrick.begou@univ-grenoble-alpes.fr \
    --cc=dank@kegel.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).