Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Native #1530

Merged
merged 35 commits into from
Sep 15, 2022
Merged

Apple Native #1530

merged 35 commits into from
Sep 15, 2022

Conversation

pierotofy
Copy link
Member

@pierotofy pierotofy commented Sep 6, 2022

Changes that allow ODM to compile/run natively on MacOS. Tested on M1 so far. I will test on Intel soon too.

I'm debating how to best package this for deployment, and how to automate M1 builds (GitHub runners do not provide M1 runners, we would need to rent one, which I'd rather not...).

image

One needs to install dependencies via homebrew, including:

homebrew install tbb@2020 gdal [email protected] [...]

I didn't write down the full list (ups).

@pierotofy
Copy link
Member Author

Closes #1314

@pierotofy
Copy link
Member Author

Runs end-to-end:

image

@pierotofy
Copy link
Member Author

pierotofy commented Sep 10, 2022

Compilation steps:

Install:

  • XCode
  • Homebrew

Then run:

brew install cmake gcc@12 [email protected] tbb@2020 eigen gdal boost cgal libomp
brew link tbb@2020

python3.8 -m pip install virtualenv
python3.8 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

cd SuperBuild
mkdir build
cmake ..
make -j8

Finally:

cd /tmp
pip download GDAL
tar -xpzf GDAL-3.5.1.tar.gz
cd GDAL-3.5.1
python setup.py build_ext --gdal-config /opt/homebrew/bin/gdal-config
python setup.py build
python setup.py install

Smoke test:

./run.sh --help

@pierotofy
Copy link
Member Author

pierotofy commented Sep 10, 2022

Code signing./ notarization is also a terrible mess, I'm unable to see how this could be automated with ease. Several tools that should allow one to make an automated build require UI interaction to allow permission / ask passwords (e.g. access to the keychain).

@pierotofy pierotofy marked this pull request as ready for review September 15, 2022 21:28
@pierotofy
Copy link
Member Author

Good to go.

@pierotofy pierotofy merged commit deb5327 into OpenDroneMap:master Sep 15, 2022
@ckato3
Copy link

ckato3 commented Nov 5, 2022

In Native Install (MacOS), . /run.sh is not running.

It stops at "from opensfm.sensors import sensor_data".

I think it is because there are no files or folders for opensfm, sensors, sensor_data, etc. in the odm folder.

I am new to python, so I don't know how to solve this problem.
What should I do?

======
Coffee241:ODM ckato$ ./run.sh --help
Traceback (most recent call last):
File "/Users/ckato/ODM/run.py", line 12, in
from opendm import system
File "/Users/ckato/ODM/opendm/system.py", line 15, in
from opendm import types # WC++
File "/Users/ckato/ODM/opendm/types.py", line 18, in
from opendm.photo import ODM_Photo
File "/Users/ckato/ODM/opendm/photo.py", line 25, in
from opensfm.sensors import sensor_data
ModuleNotFoundError: No module named 'opensfm'

@pierotofy
Copy link
Member Author

The recommended way to run ODM on Apple is by using docker. 👍

@ckato3
Copy link

ckato3 commented Nov 5, 2022

I understand that Python beginners should use a docker...

I got an M1 Mac and am considering using docker to run ODM.
But during the docker build, gcc is killed during the OpenSfM build.
I think it is because my M1 Mac has only 8 GB memory.

I will let you know the detailed situation later, since I cannot use M1 Mac until the end of the week.

@winstonford
Copy link

winstonford commented Jan 14, 2023

I get same error "ModuleNotFoundError: No module named 'opensfm'
Following docs here https://opensfm.org/docs/building.html I believe I broke path to python.
Now on smoke test I get error:
"No module named 'numpy.core._multiarray_umath'"

Intel Core i5
MacOS 12.6.2
Homebrew 3.6.18
package-id: com.apple.pkg.CLTools_Executables
version: 13.4.0.0.1.1651278267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants