Skip to content

use CXX/CC environment variables to set the compiler commands#10

Merged
linev merged 1 commit into
gsi-ee:masterfrom
HLinde:master
Nov 25, 2025
Merged

use CXX/CC environment variables to set the compiler commands#10
linev merged 1 commit into
gsi-ee:masterfrom
HLinde:master

Conversation

@HLinde
Copy link
Copy Markdown
Contributor

@HLinde HLinde commented Nov 24, 2025

Hi!

For the build process on conda-forge the issue came up, that conda-forge actually provides the compiler that should be used for packaging via the CXX environment variable. See also the discussion

I can build the packages now by applying a patch before building, but maybe you want to take over that behaviour instead?
It only affects the "make" based build on Linux when I test if Go4 can run Go4ExampleSimple and Go4ExampleUserSource. It's not necessary for building Go4 itself with CMake.

The previous setting to g++/clang++ is now the fallback default value.

previous setting to g++/clang++ is now the fallback default value
@linev linev self-assigned this Nov 25, 2025
@linev
Copy link
Copy Markdown
Collaborator

linev commented Nov 25, 2025

Since several years we recommend to use cmake for go4 compilation.
Also for all examples we provide cmake files.

I see no problem to merge PR.
The only I am curios of - how far to the past syntax like CXX ?= g++ supported by makefiles?

@linev linev merged commit 2d9250c into gsi-ee:master Nov 25, 2025
1 check passed
@HLinde
Copy link
Copy Markdown
Contributor Author

HLinde commented Nov 25, 2025

Ok, thank you! But then I should maybe also add a test for cmake compilation of the user analysis.

The syntax is apparently possible since make Version 3.77, from the NEWS file of that version:

  • Implement BSD make's "?=" variable assignment operator. The variable
    is assigned the specified value only if that variable is not already
    defined.

@linev
Copy link
Copy Markdown
Collaborator

linev commented Nov 25, 2025

The syntax is apparently possible since make Version 3.77, from the NEWS file of that version:

So it pretty old feature

@linev
Copy link
Copy Markdown
Collaborator

linev commented Nov 25, 2025

But then I should maybe also add a test for cmake compilation of the user analysis.

Yes, you can do it as well.
But all analyses examples compiled by default with go4.

@HLinde
Copy link
Copy Markdown
Contributor Author

HLinde commented Nov 25, 2025

Ah, sorry it was not clear what I'm using the examples for.
I copied them to another folder in order to test building and running an analysis as a "user" after installing the package.
So now I test one example with make and one example with cmake:
https://github.com/conda-forge/staged-recipes/pull/30301/files#diff-12195140c17f424408007f926c586e559c38213864b882f2aa99b39c4adeef13
(This script is running in a virtual environment that has the package installed after the packaging finished.)

@linev
Copy link
Copy Markdown
Collaborator

linev commented Nov 25, 2025

Yes, this is also valid approach.

I expect most of user analysis using old Makefiles - so one need to properly support them.

Grate that you are doing this

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 this pull request may close these issues.

2 participants