Open jwatson-CO-edu opened 5 years ago
Just open cmake-gui, activate advanced and grouped, and chose a different python interpreter and python library.
Then click configure and then generate to change the makefiles.
Close cmake gui and build pythonocc as usual with
make -j 8
Oh, the install instructions did not call for cmake-gui
, but I did some learning and got the following results:
cmake-gui
at the correct installation of Python. However ...OCE_INCLUDE_PATH
and OCE_LIB_PATH
as instructed. Although their values were the same as above, I received make
errors indicating an incorrect OCE path.PYTHON_EXECUTABLE
, PYTHON_INCLUDE_DIR
, and PYTHON_LIBRARY
are supposed to be. tl;dr
I used the following cmake
command:
cmake -DOCE_INCLUDE_PATH=$HOME/libs/OCE/include/oce \
-DOCE_LIB_PATH=$HOME/libs/OCE/lib \
-DPYTHON_EXECUTABLE=/usr/bin/python3.6 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so \
..
And was able to successfully build, install, then import from OCC in Py3.
Overall the build process for this project is very straightforward, except for this snag. I think if you provided some direction for Py3 users, it would be perfect.
I followed the below steps for installing OCE/Python-OCC, and to my dismay I found that the build process targets Python2 instead of Python3. My lab's standard is Python 3.6+. The instructions do not seem to address this issue.
cmake -DOCE_INSTALL_PREFIX:PATH=$HOME/libs/OCE \ -DOCE_WITH_FREEIMAGE:BOOL=ON \ -DOCE_WITH_GL2PS:BOOL=ON \ -DOCE_DRAW:BOOL=ON \ -DOCE_WITH_FREEIMAGE:BOOL=ON \ -DOCE_WITH_GL2PS:BOOL=ON \ -DOCE_ADD_HEADERS:BOOL=ON \ -DOCE_COPY_HEADERS_BUILD:BOOL=ON \ ..
make -j8 make install
git clone git://github.com/tpaviot/pythonocc-core.git cd pythonocc-core mkdir cmake-build && cd $_
cmake -DOCE_INCLUDE_PATH=$HOME/libs/OCE/include/oce \ -DOCE_LIB_PATH=$HOME/libs/OCE/lib \ ..
make -j8 sudo make install