forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Bug fix for py-cython with python 3.10+ (installs in subdir local
)
#186
Merged
climbfuji
merged 8 commits into
JCSDA:jcsda_emc_spack_stack
from
climbfuji:feature/updates_bugfixes_py_shapely
Nov 1, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
645871b
py-shapely: add v1.8.3 (#32218)
adamjstewart 3ea62b8
py-shapely: add v1.8.5 (#33259)
adamjstewart 1ad96b2
Bug fix for py-cython when using [email protected]
climbfuji fb75bc6
Black-format var/spack/repos/builtin/packages/py-cython/package.py
climbfuji f390fb4
Improve solution for finding bin and lib directory in py-cython
climbfuji 994773a
Add lib64 option, yet another workaround
climbfuji 18d71ec
Black-format var/spack/repos/builtin/packages/py-cython/package.py
climbfuji c97b38d
Merge branch 'jcsda_emc_spack_stack' into feature/updates_bugfixes_py…
climbfuji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
import os | ||
|
||
from spack.package import * | ||
|
||
|
||
|
@@ -46,6 +48,23 @@ class PyCython(PythonPackage): | |
depends_on("py-setuptools", type=("build", "run")) | ||
depends_on("[email protected]:", type="test") | ||
|
||
@property | ||
def prefix(self): | ||
prefix = super(PyCython, self).prefix | ||
if os.path.isdir(os.path.join(prefix, "local", "bin")) and not os.path.isdir( | ||
os.path.join(prefix, "bin") | ||
): | ||
prefix.bin = os.path.join(prefix, "local", "bin") | ||
if os.path.isdir(os.path.join(prefix, "local", "lib")) and not os.path.isdir( | ||
os.path.join(prefix, "lib") | ||
): | ||
prefix.lib = os.path.join(prefix, "local", "lib") | ||
elif os.path.isdir(os.path.join(prefix, "local", "lib64")) and not os.path.isdir( | ||
os.path.join(prefix, "lib64") | ||
): | ||
prefix.lib = os.path.join(prefix, "local", "lib64") | ||
return prefix | ||
|
||
@property | ||
def command(self): | ||
"""Returns the Cython command""" | ||
|
@@ -56,3 +75,7 @@ def command(self): | |
def build_test(self): | ||
# Warning: full suite of unit tests takes a very long time | ||
python("runtests.py", "-j", str(make_jobs)) | ||
|
||
def setup_dependent_build_environment(self, env, dependent_spec): | ||
env.prepend_path("PATH", self.prefix.bin) | ||
env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,8 @@ class PyShapely(PythonPackage): | |
# the hacky logic in [email protected] looks for libgeos_c.so in the miniconda | ||
# install tree ... need to comment that out so that spack's libgeos_c.so is found. | ||
# Also need to add logic to find libgeos_c.so from spack geos modules, if loaded. | ||
patch("shapely-1.8.0-geos.py.patch", when="@1.8.0:1.8.3") | ||
# This patch only works for 1.8.0/1.8.1, but may also be needed for 1.8.2-1.8.5 | ||
patch("shapely-1.8.0-geos.py.patch", when="@1.8.0:1.8.1") | ||
|
||
@when("^[email protected]:") | ||
def patch(self): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't help if you're on an OS that uses
lib64
instead oflib
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, added an additional
elif
clause to cover this. Don't like any of these solutions, but the solutions you mentioned above aren't available in the authoritative spack repo yet.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you'll also need to do what you're doing here for every Python package in Spack...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know ... my strategy is to have this fixed temporarily (because it's the only package in our fairly comprehensive software stack that has this problem) and then get the clean solution from spack once that is available.