cocoa-xu / evision

Evision: An OpenCV-Erlang/Elixir binding
https://evision.app
Apache License 2.0
327 stars 22 forks source link

An error occur when compiling on Jetson (Linux, aarch64) #37

Closed zacky1972 closed 2 years ago

zacky1972 commented 2 years ago

Hi,

I compiled evision on NVIDIA Jetson AGX Xavier (Ubuntu 18.04 Linux Kernel 4.9.201-tegra, aarch64), but the following error occurred:

==> evision
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   117    0   117    0     0    393      0 --:--:-- --:--:-- --:--:--   393
100 89.8M    0 89.8M    0     0  9401k      0 --:--:--  0:00:09 --:--:-- 14.4M
CMake Error: The source directory "/mnt/nvme/home/zacky/evision/_build/dev/lib/evision/cmake_opencv_4.5.5/BUILD_OPENEXR=ON" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:96: recipe for target '/mnt/nvme/home/zacky/evision/_build/dev/lib/evision/cmake_opencv_4.5.5/modules/python_bindings_generator/headers.txt' failed
make: *** [/mnt/nvme/home/zacky/evision/_build/dev/lib/evision/cmake_opencv_4.5.5/modules/python_bindings_generator/headers.txt] Error 1
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. If you are using
Ubuntu or any other Debian-based system, install the packages
"build-essential". Also install "erlang-dev" package if not
included in your Erlang/OTP version. If you're on Fedora, run
"dnf group install 'Development Tools'".

Are Linux and aarch64 not supported?

zacky1972 commented 2 years ago

I found the issue: erlang-dev package isn't installed.

zacky1972 commented 2 years ago

I couldn't solve it even though I installed build-essential and erlang-dev.

The same error still occurred.

cocoa-xu commented 2 years ago

Hi @zacky1972, I encountered this issue before, and may I know the CMake version on the NVIDIA Jetson AGX Xavier?

It seems that the CMake on your device concatenates the path to the source code and some compile options because it doesn't support the -S option.

"/mnt/nvme/home/zacky/evision/_build/dev/lib/evision/cmake_opencv_4.5.5/BUILD_OPENEXR=ON"

According to the docs on the CMake website, CMake didn't have the -S option to specify the source directory for versions <=3.12. It was available since 3.13.

I'll update the Makefile accordingly!

cocoa-xu commented 2 years ago

I've addressed this issue in #39. I adjusted the CMake commands to the most basic ones, and now the minimal required CMake version is 3.1 for the bindings part.

And the minimal version required by OpenCV will decide the actual minimal required version of CMake. For OpenCV 4.5.5, the minimal required version is 3.5.1.

zacky1972 commented 2 years ago

Ah...

cmake --version
cmake version 3.10.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
zacky1972 commented 2 years ago

🎉

$ cmake --version
cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
zacky1972 commented 2 years ago

I did it! Thank you!

cocoa-xu commented 2 years ago

The build script on the main branch should now work with CMake >= 3.5.1. But it's (almost) always good to have a newer version! ;)