Python3 compile of OCL gives only 2.7

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
sliptonic
Posts: 1991
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Python3 compile of OCL gives only 2.7

Postby sliptonic » Tue Apr 09, 2019 1:23 pm

I'm trying to install OpenCamLib on linux mint. I have previously compiled and installed for python 2.7 and everything works.

I created a new out of source build directory and use this line to build:
cmake -DBUILD_PY_LIB=1 -DUSE_PY_3=1 -DBUILD_CXX_LIB=0 ../opencamlib && make -j3

But it only seems to find python2.7 libraries
https://pastebin.com/91KV4nEu

I don't get any errors and Python3, python3-dev are installed and working.

I tried manually flushing the ccache and even blew away and recloned the repo.

What am I missing?
herbk
Posts: 1955
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Python3 compile of OCL gives only 2.7

Postby herbk » Wed Apr 10, 2019 7:42 am

Hi sliptonic,

i try to compile OCL for OpenSuse atm, i'm using the OpenSuse built system for it to be sure that all source pakages are availible. I use the old source from OS 43.3 and kompiled it for OS 15.0 and 15.1, - for both the build is shown as succeeded and i can install it at my system (OS 15.1).

The problem i have: FC dont find OCL. But that's not new to me, also at OS 42.3 (which get's outdated at June) i can install OCL but FC don't find.
Is that a prob of a wrong path? ( i think so) Where do FC look for OCL? May be i can fix it, if it's just that...
Gruß Herbert
User avatar
sliptonic
Posts: 1991
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Python3 compile of OCL gives only 2.7

Postby sliptonic » Wed Apr 10, 2019 1:08 pm

I assume that FreeCAD isn't doing anything special to find python modules. It's searching the paths in sys.path and then any directories defined in the environment variable PYTHONPATH.

PYTONPATH is meant for you to add custom directories to be searched and that's the easiest way to fix it for a local install. If you're trying to fix it for everyone, you need to get the install to put the files into a directory in sys.path.

https://bic-berkeley.github.io/psych-21 ... _path.html
mlampert
Posts: 1491
Joined: Fri Sep 16, 2016 9:28 pm

Re: Python3 compile of OCL gives only 2.7

Postby mlampert » Wed Apr 10, 2019 7:01 pm

I looked into this and it might be libboost that pulls in py2.7 - maybe check the dependencies on the libboost-python-dev package?
User avatar
sgrogan
Posts: 6167
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python3 compile of OCL gives only 2.7

Postby sgrogan » Wed Apr 10, 2019 8:23 pm

mlampert wrote:
Wed Apr 10, 2019 7:01 pm
I looked into this and it might be libboost that pulls in py2.7 - maybe check the dependencies on the libboost-python-dev package?
from sliptonics log

Code: Select all

-- Boost_LIBRARIES = /usr/lib/x86_64-linux-gnu/libboost_python.so
see here: https://packages.ubuntu.com/bionic/amd6 ... v/filelist
"fight the good fight"
User avatar
kkremitzki
Posts: 2170
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Python3 compile of OCL gives only 2.7

Postby kkremitzki » Wed Apr 10, 2019 9:50 pm

Yeah, I tried to compile this myself and seemed to get Python 3 fine, but that was on Debian Sid... maybe some Boost CMake flag needs to be used?
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.