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

Refactor setup.py #229

Merged
merged 12 commits into from
Mar 10, 2021
Merged

Refactor setup.py #229

merged 12 commits into from
Mar 10, 2021

Conversation

brownj85
Copy link
Collaborator

@brownj85 brownj85 commented Mar 4, 2021

Context:
If the user sets the CFLAGS environment variable, the build fails.

Description of the Change:
User-provided CFLAGS will not override the flags necessary for compilation (in particular -fopenmp). General improvements to the readability of the build script. Will no longer attempt to build without Cython, since it's not possible to do so (libwalrus.cpp does not exist).

Benefits:
Fixes bug, nicer build script.

Possible Drawbacks:
None

Related GitHub Issues:
Fixes #198.

@brownj85 brownj85 changed the title Fix build cflags Refactor setup.py Mar 5, 2021
@brownj85 brownj85 marked this pull request as ready for review March 5, 2021 17:35
@josh146
Copy link
Member

josh146 commented Mar 8, 2021

Hey @brownj85, thanks for this! the new setup.py looks a lot cleaner.

I just want to check if this is ready for review, as I can see that the linux build is failing.

@brownj85
Copy link
Collaborator Author

brownj85 commented Mar 9, 2021

Hey @brownj85, thanks for this! the new setup.py looks a lot cleaner.

I just want to check if this is ready for review, as I can see that the linux build is failing.

Hey @josh146, I noticed that - but it doesn't seem to be related to this PR. I re-ran it on master, which passed previously, and it failed: https://app.circleci.com/pipelines/github/XanaduAI/thewalrus/1034/workflows/ad44f38f-423c-4bcb-b979-c87cb42d05cd/jobs/3188.

@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #229 (a44c440) into master (d17451a) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #229   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        21    +1     
  Lines         1187      1200   +13     
=========================================
+ Hits          1187      1200   +13     
Impacted Files Coverage Δ
thewalrus/__init__.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d17451a...a44c440. Read the comment docs.

@josh146
Copy link
Member

josh146 commented Mar 10, 2021

it doesn't seem to be related to this PR. I re-ran it on master, which passed previously, and it failed

Weird 🤔 Was this fixed by bumping the CircleCI docker image to 3.6.12?

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Much more readable @brownj85

setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
config["include_dirs"].append(EIGEN_INCLUDE_DIR)
else:
config["include_dirs"].extend(
("/usr/include/eigen3", "/usr/local/include/eigen3")
Copy link
Member

Choose a reason for hiding this comment

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

We could define above

EIGEN_INCLUDE_DIR = ("/usr/include/eigen3", "/usr/local/include/eigen3", os.environ.get("EIGEN_INCLUDE_DIR")

to avoid the if statement here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, the issue with this is that if Eigen is installed in the system and the user provides a custom path, there's no way to know which one the compiler will pick. The if statement ensures that the user-provided Eigen headers will always be used

@brownj85 brownj85 merged commit 655e089 into master Mar 10, 2021
@brownj85 brownj85 deleted the fix-build-cflags branch March 10, 2021 23:54
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.

FTBFS with more stiff CFLAGS
2 participants