Python3 compile of OCL gives only 2.7

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
sliptonic
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Python3 compile of OCL gives only 2.7

Post by sliptonic »

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
Veteran
Posts: 2655
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Python3 compile of OCL gives only 2.7

Post by herbk »

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
Veteran
Posts: 3453
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Python3 compile of OCL gives only 2.7

Post by sliptonic »

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
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Python3 compile of OCL gives only 2.7

Post by mlampert »

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
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python3 compile of OCL gives only 2.7

Post by sgrogan »

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
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Python3 compile of OCL gives only 2.7

Post by kkremitzki »

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.
Post Reply