Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't Override User's CC and CPP Environment Variables #1811

Open
ninotarantino opened this issue Dec 5, 2024 · 3 comments · May be fixed by #1812
Open

Don't Override User's CC and CPP Environment Variables #1811

ninotarantino opened this issue Dec 5, 2024 · 3 comments · May be fixed by #1812

Comments

@ninotarantino
Copy link
Contributor

ninotarantino commented Dec 5, 2024

Background

In the FSL we use spack to manage our software packages. So even though we're on Rocky 8, we can use GCC 12.2 via spack, for example. But when we tried to do this, we'd get a weird build error when building Trick:

In file included from parse_format.c:3:
/usr/include/stdio.h:33:10: fatal error: stddef.h: No such file or directory
 #include <stddef.h>

So we just stuck with the system-installed GCC 8.5.

Cause

Several of the makefiles in trick_source/data_products/* hard-code the following:

CC = cc
CPP = c++

So the makefiles are stomping on the new compiler versions that we're trying to load via spack (or any other package manager). Because spack isn't actually updating $PATH for cc, it's just setting $CC and $CPP, this means that we're calling the system /usr/bin/cc rather than the /path/to/gcc12/cc that we should be. We're mixing compiler versions for different parts of Trick, and eventually the build fails.

Solution

We should be able to change those makefile lines to

CC ?= cc
CPP ?= c++

That way, if a user loads a new GCC via a package manager, Trick will use that GCC. Otherwise, we'll default to whatever's first on the user's path (probably the system-installed version).

FYI: @sharmeye @ddj116 @hchen99. I have some local fixes but I don't think I have permission to push a new branch to Trick.

@hchen99
Copy link
Contributor

hchen99 commented Dec 5, 2024

@ninotarantino Thank you for bringing this to our attention and suggesting a solution. A branch has been created for this issue, and you're welcome to push your changes there. We'll review them and merge the branch into master.

@ninotarantino
Copy link
Contributor Author

Hey @hchen99, looks like I don't have the right permissions to push to any branch. I just forked Trick and submitted the changes here: https://github.com/ninotarantino/trick/tree/1811-dont-override-users-cc-and-cpp-env-for-data_products.

@hchen99
Copy link
Contributor

hchen99 commented Dec 5, 2024

@ninotarantino Sorry that I didn't realize you can't push to any branch. But I believe you can still make a pull request using your forked Trick. Please let us know if you have issue with that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants