Cmake issue
SehongOh opened this issue · comments
Hello,
I was trying to install BanditPAM and following the steps that you offer.
When I tried to install Carma, I typed "cmake --build . --config Release --target install".
But, I got this error "make: *** No rule to make target `install'. Stop.".
Could you let me know how to fix it?
Thanks
Hi, thanks for filing an issue.
That's strange you're encountering a bug -- I'm able to install carma successfully on my M1 Mac. From /BanditPAM/headers/carma
:
mkdir build && cd build && cmake -DCARMA_INSTALL_LIB=ON .. && sudo cmake --build . --config Release --target install
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- carma: enable arma no debug: OFF
-- carma: enable extra debug: OFF
-- carma: enable soft steal: OFF
-- carma: enable hard steal: OFF
-- carma: don't require owndata: OFF
-- carma: don't require f-contiguous: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/motiwari/Desktop/BanditPAM/headers/carma/build
Password:
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/carma/cmake/carmaCarmaTargets.cmake
-- Installing: /usr/local/share/carma/cmake/carmaHeaderTargets.cmake
-- Installing: /usr/local/share/carma/cmake/carmaConfig.cmake
-- Installing: /usr/local/share/carma/cmake/carmaConfigVersion.cmake
-- Installing: /usr/local/share/carma/cmake/carmaDependencyTargets.cmake
-- Installing: /usr/local/include/carma/carma
-- Up-to-date: /usr/local/include/carma/carma_bits
-- Installing: /usr/local/include/carma/carma_bits/typecheck.h
-- Installing: /usr/local/include/carma/carma_bits/cnalloc.h
-- Installing: /usr/local/include/carma/carma_bits/numpytoarma.h
-- Installing: /usr/local/include/carma/carma_bits/armatonumpy.h
-- Installing: /usr/local/include/carma/carma_bits/debug.h
-- Installing: /usr/local/include/carma/carma_bits/converters.h
-- Installing: /usr/local/include/carma/carma_bits/config.h
-- Installing: /usr/local/include/carma/carma_bits/exceptions.h
-- Installing: /usr/local/include/carma/carma_bits/numpyapi.h
-- Installing: /usr/local/include/carma/carma_bits/arraystore.h
-- Installing: /usr/local/include/carma/carma_bits/nparray.h
-- Installing: /usr/local/include/carma/carma_bits/cnumpy.h
-- Installing: /usr/local/include/carma/carma_bits/generated_config.h
One of the things I notice is that you're trying to run cmake
from outside of a build
directory, which is not recommended.
Could you provide more details? What commands did you run when you cloned the repo locally? What OS are you on? And is there a reason you're trying to install from source, instead of installing the pip
package from PyPI?
Thank you for answering.
I am using Mac OS with M1
Do you mean that I can just use BanditPAM by installing it with "pip install BanditPAM"?
I installed it but when I run the example code, the error occurs.
Traceback (most recent call last):
File "/Users/ohsehong/Documents/Research/Kmedoids/BanditPAM/Kmedoids.py", line 1, in
from banditpam import KMedoids
ImportError: dlopen(/opt/homebrew/lib/python3.11/site-packages/banditpam.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace (_omp_get_max_threads)
Ah ok -- the error about symbol not found in flat namespace
is a known issue that I haven't been able to reproduce or figure out, despite significant trying. In your case, it makes sense to install from source.
Could you ensure your carma
git submodule is at commit 75057dd
? What happens what you type git status
from inside BanditPAM/headers/carma
? Also, did you run git submodule update --init --recursive
from BanditPAM
first?
This is also an error when I tried to install it on my Windows.
Do I need to install the below things before running "pip install banditpam"?
A C++ compiler; we recommend LLVM's clang: via the LLVM installation instructions
OpenMP: if using LLVM's clang, then OpenMP is already enabled
CMake: via the CMake installation instructions
Armadillo: via the Armadillo installation instructions
CARMA: via the instructions in the quickstart
How did you download the BanditPAM source code? It looks like you may have downloaded a zip file of the source -- instead, could you run git clone https://github.com/motiwari/BanditPAM.git
? This will properly preserve the .git
folder of the repository and allow you to run git submodule update --init --recursive
.
When you downloaded the source code as a zip, it doesn't preserve the .git
folder, which is why your git submodule update --init --recursive
command is failing and carma
isn't being initialized correctly.
Unfortunately we don't support Windows builds right now; we're working on it, but it will be some time until we can ship a Windows build.
Not a problem, I'm happy to help! And this may help us debug the issue you're having with pip install banditpam
about some symbols not being found.
It looks like you're making progress. Now, the carma
installation is failing because it can't find OpenMP, although your second screenshot suggests it's installed. Could you try updating libomp
via `brew?
If the issue still persists, you may need to try this, this, this, or updating cmake
.
E.g. cmake -DCARMA_INSTALL_LIB=ON -DOpenMP_libomp_LIBRARY -DCMAKE_SHARED_LINKER_FLAGS ..
Hello, I was not able to make it. I tried to install the package with my friend's Mac, but the same error happened.
But, I can use it on Colab.
Thanks for the response; I'm sorry I couldn't help more. I'm glad you found a workaround.