-
Notifications
You must be signed in to change notification settings - Fork 21
Use CPM for pulling in units, remove conan from conda build path #3777
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
Conversation
cebdaf9 to
c3685b0
Compare
|
All builds for conda and cibuildwheel passed in https://github.com/scipp/scipp/actions/runs/18698001628 and this is ready for another review. |
SimonHeybrock
left a comment
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.
Looks good, small questions.
CMakeLists.txt
Outdated
| # conda don't seem to play well with this. | ||
| set(CMAKE_CXX_SCAN_FOR_MODULES 0) | ||
|
|
||
| if(APPLE AND NOT SKBUILD) |
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.
Is SKBUILD active for all our builds, both PyPI and conda-forge?
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.
no, SKBUILD is only for pypi wheel building.
CMakeLists.txt
Outdated
| set(CMAKE_THREAD_LIBS_INIT "-lpthread") | ||
| set(CMAKE_HAVE_THREADS_LIBRARY 1) | ||
| set(CMAKE_USE_WIN32_THREADS_INIT 0) | ||
| set(CMAKE_USE_PTHREADS_INIT 1) | ||
| set(THREADS_PREFER_PTHREAD_FLAG ON) |
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.
So this is not disabling threading but using another kind?
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.
Yes, this is what works via clang compilers
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.
What does it actually do? Does it change how TBB works? I don't think we use std::thread anywhere ourselves.
CMakeLists.txt
Outdated
| set(CMAKE_THREAD_LIBS_INIT "-lpthread") | ||
| set(CMAKE_HAVE_THREADS_LIBRARY 1) | ||
| set(CMAKE_USE_WIN32_THREADS_INIT 0) | ||
| set(CMAKE_USE_PTHREADS_INIT 1) | ||
| set(THREADS_PREFER_PTHREAD_FLAG ON) |
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.
What does it actually do? Does it change how TBB works? I don't think we use std::thread anywhere ourselves.
| include(scipp-conan) | ||
| find_package(LLNL-Units REQUIRED) | ||
| # cpm installs llnl units for conda and wheels both | ||
| include(scipp-cpm) |
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.
Why do we only use scipp-cpm if we also use conan? Seems the wrong way around.
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 I understand, this if clause is just skipping all network calls, conan and cpm are both not included as they both fetch remote sources.
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.
Can you rename the variable? SKIP_CONAN sounds like it only controls conan, not network access.
| FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-conan.cmake" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-cpm.cmake" |
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.
Does this need to be conditional like include(scipp-cpm)?
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 guess we can remove from conan and cpm.cmake as if you are building for nix you don't need both of them, but I'm not even sure what will survive (cpm/conan/something else) by the time I am done with this 😓
|
I was trying to recreate the state where I was getting the threads not found error, but I can't recreate the issue :/ I can just remove the whole threading bit from this PR then :) The logs from one of the conda build failures are below: Details |
|
The builds for conda and pypi are available in the last commit https://github.com/scipp/scipp/actions/runs/18720040713?pr=3777 |
No description provided.