Use CPM for pulling in units, remove conan from conda build path#3777
Use CPM for pulling in units, remove conan from conda build path#3777
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.
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.
Is SKBUILD active for all our builds, both PyPI and conda-forge?
There was a problem hiding this comment.
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.
So this is not disabling threading but using another kind?
There was a problem hiding this comment.
Yes, this is what works via clang compilers
There was a problem hiding this comment.
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.
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.
Why do we only use scipp-cpm if we also use conan? Seems the wrong way around.
There was a problem hiding this comment.
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.
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.
Does this need to be conditional like include(scipp-cpm)?
There was a problem hiding this comment.
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.