OpenCamLib is not working! Fixed for python 2.7

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
freman
Posts: 746
Joined: Tue Nov 27, 2018 10:30 pm

Re: OpenCamLib is not working!

Postby freman » Sat Jun 01, 2019 7:40 am

I just installed the python-debug packages ( I guess this is the result of using git head versions of OpenCamLib and may not be performance optimal ).

Code: Select all

  Installing       : python3-test-3.7.3-3.fc29.x86_64                                                                    1/6 
  Installing       : python3-idle-3.7.3-3.fc29.x86_64                                                                    2/6 
  Installing       : python2-tools-2.7.15-11.fc29.x86_64                                                                 3/6 
  Installing       : python2-test-2.7.15-11.fc29.x86_64                                                                  4/6 
  Installing       : python2-debug-2.7.15-11.fc29.x86_64                                                                 5/6 
  Installing       : python3-debug-3.7.3-3.fc29.x86_64                                                                   6/6 
 
This does NOT change the output I posted above.

I have not found similar packages for boost-python*
User avatar
freman
Posts: 746
Joined: Tue Nov 27, 2018 10:30 pm

Re: OpenCamLib is not working!

Postby freman » Sat Jun 01, 2019 7:47 am

Is the solution here to turn off debug build. This is presumably not useful unless actually debugging the code.
Does that mean it is using debug versions, or is this just cmake sniffing the system?

Is this an oops at the ocl project end, or is this what you for sitting on the bleeding edge of a razor ?
User avatar
sgrogan
Posts: 5469
Joined: Wed Oct 22, 2014 5:02 pm

Re: OpenCamLib is not working!

Postby sgrogan » Sat Jun 01, 2019 1:21 pm

freman wrote:
Sat Jun 01, 2019 7:47 am
Is the solution here to turn off debug build. This is presumably not useful unless actually debugging the code.
Does that mean it is using debug versions, or is this just cmake sniffing the system?
The debug build is not necessary, it will work with a FreeCAD debug build.
You also don't need the Py3 stuff.
I would delete the Build directory and try setting
CMAKE_CONFIGURATION_TYPES = Release
BUILD_CXX_LIB = False

Then try to configure again. It looks like ocl is trying to use the same directroy for the Python libs and the C++ libs which is causing a problem.
User avatar
freman
Posts: 746
Joined: Tue Nov 27, 2018 10:30 pm

Re: OpenCamLib is not working!

Postby freman » Sat Jun 01, 2019 2:03 pm

Thanks, I think this double use is an aberration of cmake-gui.

If I delete everything , do a new git clone and run cmake alone or with the envvars you suggest I get a succesful cmake and make will progress.

However, I get this on console from which cmake was run. Fedora disables or restricts certain things if this is "critical" maybe it matters. Don't know what it's trying to do the system but Fed is stricter than most.

Code: Select all

#cmake-gui
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
Error: could not load cache
Error creating proxy: The connection is closed (g-io-error-quark, 18)
Error creating proxy: The connection is closed (g-io-error-quark, 18)

** (cmake-gui:24905): CRITICAL **: 15:05:39.406: Failed to get connection to xfconfd: The connection is closed

(cmake-gui:24905): dconf-WARNING **: 15:05:39.659: failed to commit changes to dconf: The connection is closed
Having done make and make install of the downloaded files, I used cmake-gui to turn off CXX build and add PY stuff and run configure. I exited and ran make and make install:

Code: Select all

Install the project...
-- Install configuration: ""
-- Installing: /usr/lib64/python2.7/site-packages/ocl.so
-- Up-to-date: /usr/lib/python2.7/site-packages
-- Installing: /usr/lib/python2.7/site-packages/pyocl.py
-- Installing: /usr/lib/python2.7/site-packages/camvtk.py
-- Installing: /usr/lib/python2.7/site-packages/procmemory.py
-- Installing: /usr/lib/python2.7/site-packages/STLTools.py
It seems like that has produced the python bindings. Now to see whether FreeCAD can find them.

Yes, running the same file I used before I no longer get the "opencamlib not working". On the face of it that seems like a workaround.
User avatar
sgrogan
Posts: 5469
Joined: Wed Oct 22, 2014 5:02 pm

Re: OpenCamLib is not working!

Postby sgrogan » Sat Jun 01, 2019 2:24 pm

Good that it's working, but what a mess. Where did ocl.so end up being installed?
Never mind, I just need to read your post :oops:
User avatar
freman
Posts: 746
Joined: Tue Nov 27, 2018 10:30 pm

Re: OpenCamLib is not working!

Postby freman » Sat Jun 01, 2019 2:40 pm

So I see two issues here. It seems that config inherited by git-clone is not set up to create the python bindings. It does work as far as it goes an maybe no one up there is doing python derivatives, just making their cxx libs.

So is this a cmake issue or a problem which OpenCamLib team should fix ( ie be told about )?

Why does cmake end up stuffing it all in the same subdirs and tripping itself up? Does that require a mod upstream?

At least there is now a workaround for this persistent problem which seems to hit a lot of people. What is the way to fixing that?

/usr/lib64/python2.7/site-packages is in the FreeCAD sys.path so all seems to be found.
User avatar
zach
Posts: 29
Joined: Thu Apr 04, 2019 4:56 pm
Location: Texas

Re: OpenCamLib is not working!

Postby zach » Sat Jun 01, 2019 3:18 pm

freman wrote:
Sat Jun 01, 2019 2:40 pm
So I see two issues here. It seems that config inherited by git-clone is not set up to create the python bindings. It does work as far as it goes an maybe no one up there is doing python derivatives, just making their cxx libs.

So is this a cmake issue or a problem which OpenCamLib team should fix ( ie be told about )?

Why does cmake end up stuffing it all in the same subdirs and tripping itself up? Does that require a mod upstream?

At least there is now a workaround for this persistent problem which seems to hit a lot of people. What is the way to fixing that?

/usr/lib64/python2.7/site-packages is in the FreeCAD sys.path so all seems to be found.
It looks like it is an issue with how OCL has defined their CMake configuration. Two CMake flags, BUILD_CXX_LIB and BUILD_PY_LIB, are causing a conflict. As part of my GSoC 2019 project I'll be working on a fix for this and will submit a pull request for OCL.
GSoC FreeCAD Blog: zachgummow.github.io
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: OpenCamLib is not working!

Postby looo » Sat Jun 01, 2019 3:22 pm

There are issues about this:
https://github.com/aewallin/opencamlib/issues/63
https://github.com/aewallin/opencamlib/issues/61

So it seems like they want to work on this.
It looks like it is an issue with how OCL has defined their CMake configuration. Two CMake flags, BUILD_CXX_LIB and BUILD_PY_LIB, are causing a conflict. As part of my GSoC 2019 project I'll be working on a fix for this and will submit a pull request for OCL.
Great.
please help with my conda-packaging efforts: https://liberapay.com/looooo/
User avatar
zach
Posts: 29
Joined: Thu Apr 04, 2019 4:56 pm
Location: Texas

Re: OpenCamLib is not working!

Postby zach » Sat Jun 01, 2019 3:28 pm

Thanks for posting the relevant issues!
GSoC FreeCAD Blog: zachgummow.github.io
User avatar
freman
Posts: 746
Joined: Tue Nov 27, 2018 10:30 pm

Re: OpenCamLib is not working!

Postby freman » Sat Jun 01, 2019 4:03 pm

command line equiv to what I worked out above , from those bugs :

Code: Select all

cmake -DBUILD_PY_LIB=ON -DBUILD_CXX_LIB=OFF -DUSE_PY_3=OFF ../src
change the location of the source as reqd.