Comments (10)
I do not have access to a Macbook Pro M1, so I cannot help without detailed logs and error outputs. I do not know if anyone has tried so far. You likely need to build COLMAP and pycolmap from source - see colmap/colmap#1423
from pycolmap.
I finally managed to build on a MacBook Pro M1. I am not sure how I could contribute to this project, is it enough to share the .whl file?
from pycolmap.
Can you please instead describe in details what steps you took to make it work so others can reproduce it?
from pycolmap.
I am using Homebrew and Miniforge.
First I had to install qt5 using Homebrew:
brew install qt5
And create a python 3.9 environment:
conda create -n myenv python=3.9
conda activate myenv
Then build Colmap:
conda install cmake boost eigen freeimage glog gflags metis suitesparse ceres-solver glew cgal
git clone -b dev [email protected]:colmap/colmap.git
cd colmap
mkdir build
cd build
cmake .. -DBOOST_STATIC=OFF -DQt5_DIR="/opt/homebrew/opt/qt@5/lib/cmake/Qt5" -DCGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/myenv/hloc/lib/cmake/CGAL"
make
make install
sudo install_name_tool -add_rpath /opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib /usr/local/bin/colmap
cd ../..
# Test with colmap -h
Then build pycolmap:
git clone --recursive [email protected]:colmap/pycolmap.git
cd pycolmap
export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5/lib/cmake/Qt5"
export CGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib/cmake/CGAL"
pip install -v .
from pycolmap.
I tried to build colmap following your steps. Everything went ok, but when I tried to start it, I got the following error:
ERROR: flag 'flagfile' was defined more than once (in files '/tmp/gflags-20211021-3963-1mi18ai/gflags-2.2.2/src/gflags.cc' and '/Users/runner/miniforge3/conda-bld/gflags_1599590635449/work/src/gflags.cc').
Could you guess what might be the problem?
from pycolmap.
I was able to build, but got an error when trying to import pycomap:
>>> import pycolmap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/PATH_TO_PYTHON/python3.9/site-packages/pycolmap.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '___kmpc_barrier'
Any idea what went wrong? I used the dev branch of colmap as of today (7/15/2022). Should I use a different version of colmap for ToT pycolmap?
from pycolmap.
I was able to build, but got an error when trying to import pycomap:
>>> import pycolmap Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen(/PATH_TO_PYTHON/python3.9/site-packages/pycolmap.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '___kmpc_barrier'
Any idea what went wrong? I used the dev branch of colmap as of today (7/15/2022). Should I use a different version of colmap for ToT pycolmap?
I was able to resolve this error by disabling OpenMP, i.e. change the ON in this line of CMakeLIst.txt of colmap repo to OFF:
option(OPENMP_ENABLED "Whether to enable OpenMP parallelization" OFF)
Not sure about the performance penalty this incurs.
from pycolmap.
(Apple M2)
I tried this, and I was able to successfully compile COLMAP.
However, I was unable to compile pycolmap.
I got the error "clang: error: no such file or directory: 'NOTFOUND'"
I am using Homebrew and Miniforge.
First I had to install qt5 using Homebrew:
brew install qt5
And create a python 3.9 environment:conda create -n myenv python=3.9
conda activate myenv
Then build Colmap:
conda install cmake boost eigen freeimage glog gflags metis suitesparse ceres-solver glew cgal git clone -b dev [email protected]:colmap/colmap.git cd colmap mkdir build cd build cmake .. -DBOOST_STATIC=OFF -DQt5_DIR="/opt/homebrew/opt/qt@5/lib/cmake/Qt5" -DCGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/myenv/hloc/lib/cmake/CGAL" make make install sudo install_name_tool -add_rpath /opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib /usr/local/bin/colmap cd ../.. # Test with colmap -h
Then build pycolmap:
git clone --recursive [email protected]:colmap/pycolmap.git cd pycolmap export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5/lib/cmake/Qt5" export CGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib/cmake/CGAL" pip install -v .
from pycolmap.
I am using Homebrew and Miniforge.
First I had to install qt5 using Homebrew:
brew install qt5
And create a python 3.9 environment:conda create -n myenv python=3.9
conda activate myenv
Then build Colmap:
conda install cmake boost eigen freeimage glog gflags metis suitesparse ceres-solver glew cgal git clone -b dev [email protected]:colmap/colmap.git cd colmap mkdir build cd build cmake .. -DBOOST_STATIC=OFF -DQt5_DIR="/opt/homebrew/opt/qt@5/lib/cmake/Qt5" -DCGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/myenv/hloc/lib/cmake/CGAL" make make install sudo install_name_tool -add_rpath /opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib /usr/local/bin/colmap cd ../.. # Test with colmap -h
Then build pycolmap:
git clone --recursive [email protected]:colmap/pycolmap.git cd pycolmap export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5/lib/cmake/Qt5" export CGAL_DATA_DIR="/opt/homebrew/Caskroom/miniforge/base/envs/myenv/lib/cmake/CGAL" pip install -v .
There are some mark-ups here:
[1] CGAL_DATA_DIR should be the true cgal path under your miniforge dir path. For example mine is "Users/myname/miniforge3/envs/py309slam/include/CGAL".
[2] to add rpath I use /Users/myname/miniforge3/envs/py309slam/lib. Same as [1], it should be within your own miniforge dir.
[3] I removed all installed libraries before the above steps following the direction in https://apple.stackexchange.com/questions/198623/uninstall-all-programs-installed-by-homebrew.
[4] conda install Flann should be added.
from pycolmap.
We now have wheels for macOS M1 - they will be published on PyPI in the next release (in a few days). See package/install-colmap-macos.sh
for an example of how to build dependencies locally.
from pycolmap.
Related Issues (20)
- ubuntu20.04 successfully installed colmap, but pycolmap failed to install HOT 3
- Data corruption when loading several reconstructions (Reconstruction object is destroyed by garbage collector, while accessing it's children objects)) HOT 10
- Is the model_aligner feature from COLMAP exposed in pycolmap? HOT 5
- pybind unable to convert pycolmap.Reconstruction.points3D HOT 4
- master branch doesn't have setup.py file HOT 8
- confusion regarding image idx in fused.ply.vis HOT 2
- Error when building from source HOT 2
- bug while install pycolmap HOT 6
- Is there an Easy Debugging Method for COLMAP within Pycolmap? HOT 2
- `'pycolmap.Image' object has no attribute 'rotmat'` HOT 3
- AttributeError: module 'pycolmap' has no attribute 'Database' HOT 2
- Trying to install pycolmap either via the pip or via source not working HOT 4
- camera.img_from_cam not working HOT 1
- May I ask about the changes in the new version? HOT 1
- AttributeError: module 'pycolmap' has no attribute 'patch_match_stereo' HOT 2
- Type hints for python? HOT 4
- Are Point3D and Image 0 indexed? HOT 2
- Error when importing pycolmap HOT 5
- How to set up scaling sparse models to realistic sizes? HOT 1
- When should a class be bound with shared_ptr as its holder? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycolmap.