Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

Could NOT find Python MacOS #69

Closed fanfanPopo closed 4 years ago

fanfanPopo commented 5 years ago

Hello, I'm trying to build cura-build-environment on my MAC and I have this error. Apparently it doesn't find Python3. However, at the begining of the build, Python3.5.2 was successfully built. I checked again and Python 3 is installed (and so is Python2) on my MAC. Does Anyone knows how to fix this ? Thanks

[ 76%] Performing configure step for 'Arcus'
CMake Warning (dev) at CMakeLists.txt:19 (set):
  implicitly converting '' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/Cellar/cmake/3.14.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Python3 (missing: Development) (found suitable version
  "3.5.2", minimum required is "3.4")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.14.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.14.4/share/cmake/Modules/FindPython/Support.cmake:1177 (find_package_handle_standard_args)
  /usr/local/Cellar/cmake/3.14.4/share/cmake/Modules/FindPython3.cmake:181 (include)
  cmake/FindSIP.cmake:53 (find_package)
  CMakeLists.txt:38 (find_package)
Ghostkeeper commented 5 years ago

I'm actually having the same problem here on Ubuntu right now. My workaround is to remove the word "development" from this line here: https://github.com/Ultimaker/libArcus/blob/734d2eac9c5341eef683c8c41f603573373743c2/CMakeLists.txt#L35

You can edit it in the (lib)Arcus-prefix folder. Running CMake again on the main cura-build-environment folder should allow it to continue.

You'll also have to make a similar change to libSavitar.

fanfanPopo commented 5 years ago

Ok thanks, it worked. Now I have an other error which is

[ 83%] Performing build step for 'Arcus'
[ 35%] Built target Arcus
[ 41%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart0.cpp.o
In file included from /xxx/cura-build-environment/build/Arcus-prefix/src/Arcus-build/python/sipArcuspart0.cpp:10:
In file included from /xxx/cura-build-environment/build/Arcus-prefix/src/Arcus-build/python/sipAPIArcus.h:10:
/usr/local/include/sip.h:32:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
make[5]: *** [CMakeFiles/python_module_Arcus.dir/python/sipArcuspart0.cpp.o] Error 1
make[4]: *** [CMakeFiles/python_module_Arcus.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [Arcus-prefix/src/Arcus-stamp/Arcus-build] Error 2
make[1]: *** [CMakeFiles/Arcus.dir/all] Error 2
make: *** [all] Error 2

Well Python is installed and Python.h is existing. Don't know what to do ?

Ghostkeeper commented 5 years ago

:smile: Well that's the Python development headers missing then.

On Ubuntu we can install libpython3-dev to get these headers in. Maybe Brew has something similar?

Anyway, we should fix this development environment so that it takes the development headers in automatically as well, but it doesn't seem to reproduce this way on our build server or on the Docker container for CI that we're using.

LipuFei commented 5 years ago

@fanfanPopo When you build the cura-build-environment with cmake, you also need to use the CMAKE_PREFIX_PATH flag. For example:

cmake \
  -DCMAKE_INSTALL_PREFIX=<path-to-install> \
  -DCMAKE_PREFIX_PATH=<path-to-install> \
  ...

This will make sure that the components that are built later will find their dependencies.

LipuFei commented 4 years ago

Closing this issue due to inactivity.