Open vicentebolea opened 6 months ago
@hmaarrfk
Thanks!
Can you please provide a cmake file and c file that you are trying to compile.
My guess looking at the upstream repo was that the CMakeFiles might have been a secondary concern. I only learned the standard mistakes after years....
sorry, i think i have my own code. but i'm having a hard time.
The first thing i'm noticing is that you didn't create a conda environment:
/home/vicente/.miniconda3/lib/cmake/Blosc2/Blosc2Config.cmake
it is finding the base enviroment
or smoething 's Blosc2Config.cmake
.
you are also starting from miniconda3
, so I'm worried there are some transition issues between Anaconda -> conda-forge.
Can you create an environment with:
mamba create --name dev --channel conda-forge --override-channels c-blosc2 cmake compilers
mamba create --name dev --channel conda-forge --override-channels c-blosc2 cmake compilers make
wget https://raw.githubusercontent.com/Blosc/c-blosc2/main/examples/simple.c
cat > CMakeLists.txt << EOF
cmake_minimum_required(VERSION 3.12)
project(ExampleBlosc2)
# Find the blosc2 library
find_package(Blosc2 REQUIRED)
# Define the executable
add_executable(simple simple.c)
# Link the blosc2 library
target_link_libraries(simple PRIVATE blosc2)
EOF
mamba activate dev
mkdir build
cd build
cmake ${CMAKE_ARGS} ..
make
Note that I had to use Blosc2
and not blosc2
@hmaarrfk thanks for the help. Few things:
CMAKE_PREFIX_PATH
when it is loaded.I am sort of new to conda, is it mamba much faster?
I will close this as I can see that conda expects cmake users to use the cmake provided by conda. Otherwise, we have to set the CMAKE_PREFIX_PATH properly.
I will close this as I can see that conda expects cmake users to use the cmake provided by conda. Otherwise, we have to set the CMAKE_PREFIX_PATH properly.
I think in general you are using an "environment" so you need to let your operating system know about it.
It would be theoretically conceivable to use system cmake, but once you start jumping into conda-forge, why use anything else ;)
Regarding conda vs mamba, it shouldn't make a big difference these days, for me, it is just muscle memory. https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
glad things are working!
I think that this might warrant a good page in our docs if it doesn't exist. i'm going to re-open to remember to do it at some time.
I can really understand how frustrating it must have been to be like "but i have cmake installed!!!"
@hmaarrfk thanks!
Some users might be just like me that we are in env where we cannot really change the cmake that we use but depend in conda to install some libs. The workaround seems very simple:
prefix_path="$(conda info --json | jq '.active_prefix')"
export CMAKE_PREFIX_PATH="${prefix_path}:$CMAKE_PREFIX_PATH"
we cannot really change the cmake
can you elaborate on this scenerio? why must you use a custom cmake? (beyond developing features for CMake itself.)
We provide our own cmake binaries for instance, or we depend in a particular version (we have a matrix of cmake versions that we want to try), or we use other package managers for the majority of the deps and conda for small subset of it.
Ah yes, this seems like a rather advanced workflow.
I would suggest maybe depending on conda-forge's cmake if you can. Try it out, it might be better than you think.
But regardless, if you want to write a little blurb about it that would be good.
For example, we have maintainer documentation (aimed at writing feedstocks) https://conda-forge.org/docs/maintainer/knowledge_base/#using-cmake
But maybe you want to write a section in the user documentation with your findings.
Integration within larger software is really important to me!
Solution to issue cannot be found in the documentation.
Issue
In Linux and windows
Output
We have two solutions here:
Installed packages
Environment info