gem5-users@gem5.org

The gem5 Users mailing list

View all threads

Can I use another c++ compiler to build gem5 ?

RR
Renju Rajeev
Tue, Jul 5, 2022 1:30 AM

Hello Experts,

I am trying to use a different compiler other than gcc to compile gem5.
Is there a way to edit the Sconscript or some other config file to do this
easily ?
I want to set CC=<my new compiler>
The purpose is to add some instrumentation code while compiling to collect
coverage info.

--
Thanks
Renju

Hello Experts, I am trying to use a different compiler other than gcc to compile gem5. Is there a way to edit the Sconscript or some other config file to do this easily ? I want to set CC=<my new compiler> The purpose is to add some instrumentation code while compiling to collect coverage info. -- Thanks Renju
HN
Hoa Nguyen
Wed, Jul 6, 2022 4:16 AM

Hi,

I'm not sure if there's a way of compiling gem5 using clang via scons in a
system having both clang and gcc. However, the compiler tests do test
compiling gem5 in containers having either gcc or clang as the primary
compiler.

https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/tests/compiler-tests.sh

Regards,
Hoa Nguyen

On Mon, Jul 4, 2022, 18:33 Renju Rajeev rrajeev@pdx.edu wrote:

Hello Experts,

I am trying to use a different compiler other than gcc to compile gem5.
Is there a way to edit the Sconscript or some other config file to do this
easily ?
I want to set CC=<my new compiler>
The purpose is to add some instrumentation code while compiling to collect
coverage info.

--
Thanks
Renju


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Hi, I'm not sure if there's a way of compiling gem5 using clang via scons in a system having both clang and gcc. However, the compiler tests do test compiling gem5 in containers having either gcc or clang as the primary compiler. https://gem5.googlesource.com/public/gem5/+/refs/heads/stable/tests/compiler-tests.sh Regards, Hoa Nguyen On Mon, Jul 4, 2022, 18:33 Renju Rajeev <rrajeev@pdx.edu> wrote: > Hello Experts, > > I am trying to use a different compiler other than gcc to compile gem5. > Is there a way to edit the Sconscript or some other config file to do this > easily ? > I want to set CC=<my new compiler> > The purpose is to add some instrumentation code while compiling to collect > coverage info. > > > -- > Thanks > Renju > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org >
GB
gabriel.busnot@arteris.com
Wed, Jul 6, 2022 6:58 AM

Hi,

Here is a patch from my personal modifications to SConstruct. It makes scons use the system-wide cc/c++ aliases that you can rebind to your liking with, e.g., update-alternatives on ubuntu. I’ve tested it successfully with several flavors of gcc/clang together with the ld or lld linker (the later being noticeably faster on my system). In any case, you can adapt the patch to hardcode your compiler in it. Beware with the compiler version checking that is a bit picky ;)

Gabriel

Hi, Here is a patch from my personal modifications to SConstruct. It makes scons use the system-wide cc/c++ aliases that you can rebind to your liking with, e.g., update-alternatives on ubuntu. I’ve tested it successfully with several flavors of gcc/clang together with the ld or lld linker (the later being noticeably faster on my system). In any case, you can adapt the patch to hardcode your compiler in it. Beware with the compiler version checking that is a bit picky ;) Gabriel
RR
Renju Rajeev
Sun, Jul 10, 2022 8:36 PM

thank you everyone.
the patch which Gabriel sent has worked, and my compile has passed.

On Wed, Jul 6, 2022 at 12:02 AM gabriel.busnot@arteris.com wrote:

Hi,

Here is a patch from my personal modifications to SConstruct. It makes
scons use the system-wide cc/c++ aliases that you can rebind to your liking
with, e.g., update-alternatives on ubuntu. I’ve tested it successfully with
several flavors of gcc/clang together with the ld or lld linker (the later
being noticeably faster on my system). In any case, you can adapt the patch
to hardcode your compiler in it. Beware with the compiler version checking
that is a bit picky ;)

Gabriel


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

--
Thanks
Renju

thank you everyone. the patch which Gabriel sent has worked, and my compile has passed. On Wed, Jul 6, 2022 at 12:02 AM <gabriel.busnot@arteris.com> wrote: > Hi, > > Here is a patch from my personal modifications to SConstruct. It makes > scons use the system-wide cc/c++ aliases that you can rebind to your liking > with, e.g., update-alternatives on ubuntu. I’ve tested it successfully with > several flavors of gcc/clang together with the ld or lld linker (the later > being noticeably faster on my system). In any case, you can adapt the patch > to hardcode your compiler in it. Beware with the compiler version checking > that is a bit picky ;) > > Gabriel > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org > -- Thanks Renju