From: "Patrick Bégou" <Patrick.Begou@legi.grenoble-inp.fr>
To: gcc-help@gcc.gnu.org
Subject: Re: multiple installed versions of gcc -- automatically set rpath ??
Date: Fri, 29 May 2020 11:28:54 +0200 [thread overview]
Message-ID: <56beea81-438e-116e-44de-68984b5867b2@legi.grenoble-inp.fr> (raw)
In-Reply-To: <CAPF-yOaZNV244jxWgvDAqnA+MYpg5BuQhcqNkEb_xg6wjDcnjA@mail.gmail.com>
May be you can rely on the tool module-environment with linux. It allow
you to set environments to use different versions of a same application.
It is used on the french HPC centers and I use it to manage several
paraview version and... several gcc/gfortran versions (4, 7, 9) on my
servers and on the cluster. It is available in all linux distribution.
Just load your tailored module (setting PATH, LD_LIBRARY_PATH....) to
activate the gcc version needed and compile/execute
On redhat 7 based OS look at environment-modules-3.2.10-10.el7.x86_64
Patrick
Le 29/05/2020 à 05:07, Dan Kegel a écrit :
> https://stackoverflow.com/questions/13334300/how-to-build-and-install-gcc-with-built-in-rpath
> is a bit dated, but might be helpful. It says in part:
> 
> Using --with-boot-ldflags="-Wl,-rpath,/some/path" on the configure
> step seems to work for me on gcc 4.8.3. The docs discuss this a bit
> https://gcc.gnu.org/install/configure.html
>
>
> - Dan
>
> On Thu, May 28, 2020 at 7:55 PM Patrick Herbst via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
>> I have the base gcc that came with my distro and i'd like to have the
>> option of using a newer version without replacing the older one.
>>
>> I'd like to install the newer version in a different path, like /opt.
>>
>> I run into a problem though when compiling with the newer version in
>> /opt, it links against the libstdc++ in /opt, but at runtime the
>> executable tries to link with the systems version in /usr/lib.
>>
>> Is there a way to have the gcc in /opt automatically set the rpath
>> when linking so that executables can run against the /opt libstdc++?
>>
next prev parent reply other threads:[~2020-05-29 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 2:54 Patrick Herbst
2020-05-29 3:07 ` Dan Kegel
2020-05-29 9:28 ` Patrick Bégou [this message]
2020-05-29 11:02 ` Thomas Doczkal
2020-05-29 11:22 ` Jonathan Wakely
2020-05-29 11:33 ` Jonathan Wakely
2020-05-29 17:23 ` Jonathan Wakely
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=56beea81-438e-116e-44de-68984b5867b2@legi.grenoble-inp.fr \
--to=patrick.begou@legi.grenoble-inp.fr \
--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).