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
use scikit-build-core #755
base: main
Are you sure you want to change the base?
Conversation
512034a
to
29203be
Compare
29203be
to
a19d21f
Compare
a661602
to
e41aa50
Compare
b184ce1
to
bc89a30
Compare
If we want to switch, why not |
TIL, thanks! I think the main reason for using |
0458d9a
to
df25566
Compare
df25566
to
82a6e79
Compare
This seems to work fine and is ready for a first look @inducer. I'm not sure what the best way to replace/reimplement the |
What functionality exactly? Generally the configuration can be done in
|
pyproject.toml
Outdated
PYOPENCL_TRACE = {env="CL_TRACE", default="OFF"} | ||
PYOPENCL_ENABLE_GL = {env="CL_ENABLE_GL", default="OFF"} | ||
PYOPENCL_USE_SHIPPED_EXT = {env="CL_USE_SHIPPED_EXT", default="OFF"} | ||
OpenCL_INCLUDE_DIR = {env="CL_INC_DIR"} | ||
PYOPENCL_CL_LIB_DIRS = {env="CL_LIB_DIR"} | ||
OpenCL_LIBRARY = {env="CL_LIBNAME"} |
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.
These should also be defined in CMakeLists.txt
as option(PYOPENCL_TRACE "Enable tracing functionality" OFF)
? At least that's idiomatic from what I recall..
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.
Done in 34a47d9
export CL_INC_DIR="$CONDA_PREFIX/include" | ||
export CL_LIB_DIR="$CONDA_PREFIX/lib" | ||
export CL_LIBNAME=OpenCL |
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.
Could this logic be in CMakeLists.txt
? Something like if($ENV{CONDA_PREFIX}) set(CL_INC_DIR "${CONDA_PREFIX}/include")
?
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'm not sure, it feels a bit strange for the CMakeLists.txt
file to know about conda.
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 agree, but maybe the logic could be made conditional on there being an OpenCL library in the conda env? If there is, I think there is an overwhelming likelihood it should be used. And PyOpenCL's documentation talks about conda as a means to install, so it's not like the two projects are totally unrelated.
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.
For context, on my system (cmake 3.29.3) there are a few cmake modules that look at CONDA_PREFIX
in particular: GNUInstallDirs.cmake
, UnixPaths.cmake
and FindPython/Support.cmake
.
So I don't think there's anything strange about teaching the build a bit more about the platform, which in this case is conda
.
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.
Also, looking at FindOpenCL.cmake
, it seems like we can set OCL_ROOT=$CONDA_PREFIX
to let it find the right folders itself.
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.
TIL, thanks. conda support was added in 9b3c600
More specifically, I meant an easy-ish way for the user to configure the build, similar to the
Yeah, that is an option for replacing |
I think ditching the |
Here are the OpenCL config options that we have been discussing (all except nr. 4 should work with the current state of this PR):
If I understood correctly, option 4 isn't really desired. Are there any other options we should add/remove? (e.g., perhaps Besides the question above, this is ready for a second look (in particular, regarding the next steps). |
This appears to fix #753.
TODO:
Please squash