Giter Site home page Giter Site logo

Pip wheels for Mac M1 (arm64) about pycolmap HOT 10 CLOSED

colmap avatar colmap commented on July 2, 2024
Pip wheels for Mac M1 (arm64)

from pycolmap.

Comments (10)

sarlinpe avatar sarlinpe commented on July 2, 2024

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.

renatobusatto avatar renatobusatto commented on July 2, 2024

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.

sarlinpe avatar sarlinpe commented on July 2, 2024

Can you please instead describe in details what steps you took to make it work so others can reproduce it?

from pycolmap.

renatobusatto avatar renatobusatto commented on July 2, 2024

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.

chekhovana avatar chekhovana commented on July 2, 2024

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.

yliuiuc1990 avatar yliuiuc1990 commented on July 2, 2024

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.

yliuiuc1990 avatar yliuiuc1990 commented on July 2, 2024

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.

CGCooke avatar CGCooke commented on July 2, 2024

(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.

siyanhu avatar siyanhu commented on July 2, 2024

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.

sarlinpe avatar sarlinpe commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.