Re: Trouble Finding GCC
Bill Deegan <[email protected]> Mon, 16 Sep 2024 11:32:38 -0700
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CHEbHpP8UjiKxwkaHeLTUpO3Z5Tyaaq9PonvZkedYhatQ@mail.gmail.com> |
--===============0917303633031334148==
Content-Type: multipart/alternative; boundary="000000000000d926b7062240cc5d"
--000000000000d926b7062240cc5d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Your solution is not quite correct.
Not even sure what this is supposed to do:
main =3D Environment(tools=3D[
'default', 'git', TempFileSpawn, EnvDefaults, MakeActionTool,
ConfigFile, AddLocalRPATH, SwitchingHeaders, TagImpliesTool, Blob
])
unless all the tools after default are some local tools? They're not part
of SCons..
You should be able to simplify this:
main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))
main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))
To:
main.Tool(SCons.Tool.FindTool(['gcc', 'clang','g++', 'clang++']], main))
Though that or your original logic could potentially yield configuring gcc
and clang++ together which probably wouldn't be great..
On Mon, Sep 16, 2024 at 11:06=E2=80=AFAM Waqar, Faaiq G <faaiq.waqar@gatech=
.edu>
wrote:
> Thank you for your response, and making me aware of this question from th=
e
> FAQ.
> So the gcc I am using is located in is /usr/bin/gcc. I added the followin=
g
> lines to my SConscript based my rudimentary understanding of the FAQ
> solution:
>
> main =3D Environment(tools=3D[
> 'default', 'git', TempFileSpawn, EnvDefaults, MakeActionTool,
> ConfigFile, AddLocalRPATH, SwitchingHeaders, TagImpliesTool, Blob
> ])
>
> ->main.AppendENVPath('PATH', '/usr/bin/gcc')
> ->main.Tool("gcc")
>
> main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))
> main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))
>
> I am still running into the issue, I assume because I am not using this
> correctly. Any advice? Thank you again for your time
> -----Original Message-----
> From: Mats Wichmann <[email protected]>
> Sent: Monday, September 16, 2024 1:54 PM
> To: SCons users mailing list <[email protected]>; Waqar, Faaiq G <
> [email protected]>
> Subject: Re: [Scons-users] Trouble Finding GCC
>
> [You don't often get email from [email protected]. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On 9/16/24 11:51, Waqar, Faaiq G wrote:
> > Hello Scons Community,
> >
> > I am working on the tool Gem5, working within a container (using
> > Apptainer) to set up all necessary dependencies. Within my SConscript
> > file, I have the following lines
> >
> > main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))
> >
> > main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))
> >
> > Which unfortunately throw the following error:
> >
> > main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))
> >
> > File "/usr/lib/python3/dist-packages/SCons/Environment.py", line 203=
3:
> >
> > tool(self)
> >
> > I am able to run GCC outside this with no problems, and which gcc
> > returns the path to the version of gcc I am intending on using. I have
> > had no luck finding this issue online, so I was wondering if anyone
> > knows why this might be happening. I appreciate any insights you can
> > provide. Thank you!
>
> Presumably this is an instance of one of the oldest problems in the book,
> with some notes here:
>
>
> https://scons.org/faq.html#Why_doesn.27t_SCons_find_my_compiler.2BAC8-lin=
ker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line
> .
>
>
> Where is your gcc located?
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
--000000000000d926b7062240cc5d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Your solution is not quite correct.</div><div><br></d=
iv><div>Not even sure what this is supposed to do: <br></div><div>main =3D =
Environment(tools=3D[<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 'default', 'git', TempFileSpawn=
, EnvDefaults, MakeActionTool,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ConfigFile, AddLocalRPATH, SwitchingHeaders, Ta=
gImpliesTool, Blob<br>
=C2=A0 =C2=A0 ])</div><div><br></div><div>unless all the tools after defaul=
t are some local tools? They're not part of SCons..</div><div><br><span=
class=3D"gmail-im">
</span></div><div><span class=3D"gmail-im">You should be able to simplify t=
his:<br></span></div><div><span class=3D"gmail-im">main.Tool(SCons.Tool.Fin=
dTool(['gcc', 'clang'], main))</span></div><div><span class=
=3D"gmail-im"></span></div><div><span class=3D"gmail-im">
main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))</s=
pan></div><br><div>To:</div><div><span class=3D"gmail-im">main.Tool(SCons.T=
ool.FindTool(['gcc', 'clang'</span><span class=3D"gmail-im"=
>,'g++', 'clang++']</span><span class=3D"gmail-im">], main)=
)</span></div><div><span class=3D"gmail-im">Though that or your original lo=
gic could potentially yield configuring gcc and clang++ together which prob=
ably wouldn't be great..</span></div><div><span class=3D"gmail-im"><br>=
</span></div><div><span class=3D"gmail-im"><br></span></div><div><span clas=
s=3D"gmail-im">
</span></div><div><br></div><div><br></div></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Sep 16, 2024 at 11:06=E2=
=80=AFAM Waqar, Faaiq G <<a href=3D"mailto:[email protected]">faaiq=
[email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote"=
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">Thank you for your response, and making me aware of this q=
uestion from the FAQ.<br>
So the gcc I am using is located in is /usr/bin/gcc. I added the following =
lines to my SConscript based my rudimentary understanding of the FAQ soluti=
on:<br>
<br>
main =3D Environment(tools=3D[<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 'default', 'git', TempFileSpawn=
, EnvDefaults, MakeActionTool,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ConfigFile, AddLocalRPATH, SwitchingHeaders, Ta=
gImpliesTool, Blob<br>
=C2=A0 =C2=A0 ])<br>
<br>
->main.AppendENVPath('PATH', '/usr/bin/gcc')<br>
->main.Tool("gcc")<br>
<br>
main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))<br>
main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))<br=
>
<br>
I am still running into the issue, I assume because I am not using this cor=
rectly. Any advice? Thank you again for your time<br>
-----Original Message-----<br>
From: Mats Wichmann <<a href=3D"mailto:[email protected]" target=3D"_blan=
k">[email protected]</a>> <br>
Sent: Monday, September 16, 2024 1:54 PM<br>
To: SCons users mailing list <<a href=3D"mailto:[email protected]" t=
arget=3D"_blank">[email protected]</a>>; Waqar, Faaiq G <<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a>><br>
Subject: Re: [Scons-users] Trouble Finding GCC<br>
<br>
[You don't often get email from <a href=3D"mailto:[email protected]" tar=
get=3D"_blank">[email protected]</a>. Learn why this is important at <a href=
=3D"https://aka.ms/LearnAboutSenderIdentification" rel=3D"noreferrer" targe=
t=3D"_blank">https://aka.ms/LearnAboutSenderIdentification</a> ]<br>
<br>
On 9/16/24 11:51, Waqar, Faaiq G wrote:<br>
> Hello Scons Community,<br>
><br>
> I am working on the tool Gem5, working within a container (using<br>
> Apptainer) to set up all necessary dependencies. Within my SConscript =
<br>
> file, I have the following lines<br>
><br>
> main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))=
<br>
><br>
> main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main=
))<br>
><br>
> Which unfortunately throw the following error:<br>
><br>
> main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))=
<br>
><br>
>=C2=A0 =C2=A0 File "/usr/lib/python3/dist-packages/SCons/Environme=
nt.py", line 2033:<br>
><br>
>=C2=A0 =C2=A0 =C2=A0 tool(self)<br>
><br>
> I am able to run GCC outside this with no problems, and which gcc <br>
> returns the path to the version of gcc I am intending on using. I have=
<br>
> had no luck finding this issue online, so I was wondering if anyone <b=
r>
> knows why this might be happening. I appreciate any insights you can <=
br>
> provide. Thank you!<br>
<br>
Presumably this is an instance of one of the oldest problems in the book, w=
ith some notes here:<br>
<br>
<a href=3D"https://scons.org/faq.html#Why_doesn.27t_SCons_find_my_compiler.=
2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line=
" rel=3D"noreferrer" target=3D"_blank">https://scons.org/faq.html#Why_doesn=
.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_jus=
t_fine_from_the_command_line</a>.<br>
<br>
<br>
Where is your gcc located?<br>
_______________________________________________<br>
Scons-users mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Scons-users@scon=
s.org</a><br>
<a href=3D"https://pairlist4.pair.net/mailman/listinfo/scons-users" rel=3D"=
noreferrer" target=3D"_blank">https://pairlist4.pair.net/mailman/listinfo/s=
cons-users</a><br>
</blockquote></div>
--000000000000d926b7062240cc5d--
--===============0917303633031334148==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
--===============0917303633031334148==--