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

[WIP] only mangle CC/etc if on mac and not told not to #175

Merged
merged 3 commits into from
May 15, 2020

Conversation

djsutherland
Copy link
Contributor

@djsutherland djsutherland commented May 13, 2020

As mentioned in conda-forge/pot-feedstock#9 (comment) and following up on #130 – always setting CC=g++ is the wrong thing to do, and also always doing the CFLAGS mangling on Mac, regardless of what compilers you're doing/etc, is also the wrong thing to do. This only sets CC on Mac, and allows you to bail out of doing any of this (as e.g. conda-forge will want) by setting POT_LEAVE_CC.

CC @ncourty

@djsutherland
Copy link
Contributor Author

(Rebased onto #176 to avoid the flake8 error.)

setup.py Outdated
if sys.platform.startswith('darwin'):
if sys.platform.startswith('darwin') and not os.environ.get('POT_LEAVE_CC', ''):
os.environ["CC"] = "g++"
os.environ["CXX"] = "g++"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to do this in the first place? POT does not compile with clang or icc?

Copy link
Contributor Author

@djsutherland djsutherland May 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it was intended to fix #118 (from #130) for people installing with the system compilers on Mac, but I don't really understand why this would be needed. It does work with clang in general, e.g. conda-forge's build uses clang, but not really the default system one.

@agramfort
Copy link
Collaborator

agramfort commented May 13, 2020 via email

@djsutherland
Copy link
Contributor Author

I don't know why this would ever be generally needed; my worry is that the current behavior is over-reacting to one user's broken build system. But @ncourty can clarify maybe.

@rflamary rflamary changed the title only mangle CC/etc if on mac and not told not to [WIP] only mangle CC/etc if on mac and not told not to May 14, 2020
@ncourty
Copy link
Collaborator

ncourty commented May 14, 2020

Hello all. Yes, I do not think changing the CC flag is needed anymore. I remember it was an old solution to OSX installation problems before clang becomes the main c++ compiler on OSX. Clearly it is a reminiscence from the past, I guess we can remove it now ?

@agramfort
Copy link
Collaborator

agramfort commented May 14, 2020 via email

@rflamary
Copy link
Collaborator

good for me

@rflamary
Copy link
Collaborator

OK now this PR is just removing the flags and it still works in CI. Since @djsutherland basically had to remove it for it to build for conda I guess we should merge it if everyone is OK with it.

@ncourty
Copy link
Collaborator

ncourty commented May 15, 2020

ok with this !

@rflamary rflamary merged commit 37456eb into PythonOT:master May 15, 2020
@djsutherland
Copy link
Contributor Author

For the record, I don't love the isysroot stuff either, and will probably patch it away on conda-forge. But I think it's probably not too bad in the vast majority of situations.

@haampie
Copy link

haampie commented Aug 31, 2021

Can you maybe make a new release that includes this change? It's been more than a year.

@haampie
Copy link

haampie commented Aug 31, 2021

Or how about a 0.7.1 release that just cherry-picks this PR, that'd be even better.

@haampie haampie mentioned this pull request Aug 31, 2021
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.

5 participants