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

Wheel distribution compiles cython files with -O2 despite long compil… #798

Merged
merged 3 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
-e NRN_NIGHTLY_UPLOAD \
-e NRN_RELEASE_UPLOAD \
-e NEURON_WHEEL_VERSION \
-e NRN_BUILD_FOR_UPLOAD=1 \
'neuronsimulator/neuron_wheel' \
packaging/python/build_wheels.bash linux $(python.version)
displayName: 'Building ManyLinux Wheel'
Expand Down Expand Up @@ -99,6 +100,7 @@ jobs:
export MACOSX_DEPLOYMENT_TARGET=10.9
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export NRN_BUILD_FOR_UPLOAD=1
packaging/python/build_wheels.bash osx $(python.version)
displayName: 'Build MacOS Wheel'

Expand Down
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,20 @@ def setup_package():
"share/lib/python/neuron/rxd/geometry3d",
numpy.get_include()
]

# Cython files take a long time to compile with O2 so default O0
# But pay the price if uploading distribution
extra_compile_args=["-O0"]
if "NRN_BUILD_FOR_UPLOAD" in os.environ:
extra_compile_args=["-O2"]
print("RX3D extra_compile_args %s" % str(extra_compile_args))

rxd_params = extension_common_params.copy()
rxd_params['libraries'].append("rxdmath")
rxd_params.update(dict(
extra_compile_args=["-O0"], # cython files take too long to compile with O3
# Cython files take a long time to compile with O2 but this
# is a distribution...
extra_compile_args=extra_compile_args,
extra_link_args=["-Wl,-rpath,{}".format(REL_RPATH + "/../../.data/lib/")]
))

Expand Down