[Scons-users] Trouble Finding GCC
Bill Deegan
bill at baddogconsulting.com
Mon Sep 16 14:32:38 EDT 2024
Your solution is not quite correct.
Not even sure what this is supposed to do:
main = Environment(tools=[
'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 AM Waqar, Faaiq G <faaiq.waqar at gatech.edu>
wrote:
> Thank you for your response, and making me aware of this question from the
> FAQ.
> 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
> solution:
>
> main = Environment(tools=[
> '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 <mats at wichmann.us>
> Sent: Monday, September 16, 2024 1:54 PM
> To: SCons users mailing list <scons-users at scons.org>; Waqar, Faaiq G <
> faaiq.waqar at gatech.edu>
> Subject: Re: [Scons-users] Trouble Finding GCC
>
> [You don't often get email from mats at wichmann.us. 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 2033:
> >
> > 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-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line
> .
>
>
> Where is your gcc located?
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240916/bf319f01/attachment.htm>
More information about the Scons-users
mailing list