How to activate openCamLib after compiling it

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

How to activate openCamLib after compiling it

Post by adamLange »

Hello,

After trying to use the surfacing operations in the Path module I learned that openCamLib is required. I cloned the repository: https://github.com/aewallin/opencamlib, built the openCamLibs as according to the README, except I didn't do the install step. If possible, I'd like to keep the library in a unprivileged directory. I expect that FreeCAD is expecting the openCamLib to be in /usr/lib or some standard place.

I tried:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MY_INSTALLATION_DIRECTORY
before starting FreeCAD and I still get this message in the report view:
This operation requires OpenCamLib to be installed.

Adam

OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9453 (Git)
Build type: Unknown
Branch: (detached from 0.16_pre)
Hash: b16fbcd4eeb9a5f9195c500e2693cba25a7916d2
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1.oce-0.16
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: How to activate openCamLib after compiling it

Post by adamLange »

I think I'm getting closer to the answer. I need to make sure the 'ocl' python module can be imported. This is the code that is generating the error:

Mod/Path/PathScripts/PathSurface.py

Code: Select all

    if obj.Algorithm in ['OCL Dropcutter', 'OCL Waterline']:
            try:
                import ocl
            except:
                FreeCAD.Console.PrintError(translate(
                    "PathSurface", "This operation requires OpenCamLib to be installed.\n"))
                return
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: How to activate openCamLib after compiling it

Post by adamLange »

sudo make install makes quick work of this. :)

Problem solved
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: How to activate openCamLib after compiling it

Post by sgrogan »

I think adding the path to lib would work if you didn't want to install
In the python console

Code: Select all

import sys
sys.path.append("...")
You would need to do it after every restart. or start FreeCAD with the -P switch and add the path.
Oh, or put the library in your macros folder, it's already in sys.path.
"fight the good fight"
adamLange
Posts: 75
Joined: Sun May 24, 2015 12:15 am

Re: How to activate openCamLib after compiling it

Post by adamLange »

I will keep those in mind. Thanks sgrogan!
luispa
Posts: 44
Joined: Tue Jul 29, 2014 4:48 am

Re: How to activate openCamLib after compiling it

Post by luispa »

Hi,
I know this is an old thread. I'm having the same issue, I compiled opencamlib and did a make install, this is the output:

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
-- Up-to-date: /usr/lib/python2.7/site-packages/pyocl.py
-- Up-to-date: /usr/lib/python2.7/site-packages/camvtk.py
-- Up-to-date: /usr/lib/python2.7/site-packages/procmemory.py
-- Up-to-date: /usr/lib/python2.7/site-packages/STLTools.py
-- Up-to-date: /usr/lib/opencamlib/libocl.so.11.10.73
-- Up-to-date: /usr/lib/opencamlib/libocl.so
-- Up-to-date: /usr/include/opencamlib/arc.hpp
-- Up-to-date: /usr/include/opencamlib/bbox.hpp
-- Up-to-date: /usr/include/opencamlib/ccpoint.hpp
-- Up-to-date: /usr/include/opencamlib/clpoint.hpp
-- Up-to-date: /usr/include/opencamlib/line.hpp
-- Up-to-date: /usr/include/opencamlib/path.hpp
-- Up-to-date: /usr/include/opencamlib/stlreader.hpp
-- Up-to-date: /usr/include/opencamlib/stlsurf.hpp
-- Up-to-date: /usr/include/opencamlib/triangle.hpp
-- Up-to-date: /usr/include/opencamlib/point.hpp
-- Up-to-date: /usr/include/opencamlib/ballcutter.hpp
-- Up-to-date: /usr/include/opencamlib/bullcutter.hpp
-- Up-to-date: /usr/include/opencamlib/compositecutter.hpp
-- Up-to-date: /usr/include/opencamlib/conecutter.hpp
-- Up-to-date: /usr/include/opencamlib/cylcutter.hpp
-- Up-to-date: /usr/include/opencamlib/ellipseposition.hpp
-- Up-to-date: /usr/include/opencamlib/millingcutter.hpp
-- Up-to-date: /usr/include/opencamlib/ellipse.hpp
-- Up-to-date: /usr/include/opencamlib/adaptivepathdropcutter.hpp
-- Up-to-date: /usr/include/opencamlib/pathdropcutter.hpp
-- Up-to-date: /usr/include/opencamlib/batchdropcutter.hpp
-- Up-to-date: /usr/include/opencamlib/pointdropcutter.hpp
-- Up-to-date: /usr/include/opencamlib/brent_zero.hpp
-- Up-to-date: /usr/include/opencamlib/kdnode.hpp
-- Up-to-date: /usr/include/opencamlib/kdtree.hpp
-- Up-to-date: /usr/include/opencamlib/numeric.hpp
-- Up-to-date: /usr/include/opencamlib/lineclfilter.hpp
-- Up-to-date: /usr/include/opencamlib/clfilter.hpp
-- Up-to-date: /usr/include/opencamlib/halfedgediagram.hpp
-- Up-to-date: /usr/include/opencamlib/operation.hpp
-- Up-to-date: /usr/include/opencamlib/batchpushcutter.hpp
-- Up-to-date: /usr/include/opencamlib/fiberpushcutter.hpp
-- Up-to-date: /usr/include/opencamlib/fiber.hpp
-- Up-to-date: /usr/include/opencamlib/interval.hpp
-- Up-to-date: /usr/include/opencamlib/waterline.hpp
-- Up-to-date: /usr/include/opencamlib/adaptivewaterline.hpp
-- Up-to-date: /usr/include/opencamlib/weave.hpp
-- Up-to-date: /usr/include/opencamlib/simple_weave.hpp
-- Up-to-date: /usr/include/opencamlib/smart_weave.hpp
-- Up-to-date: /usr/include/opencamlib/weave_typedef.hpp
-- Up-to-date: /usr/include/opencamlib/tsp.hpp
-- Installing: /usr/include/opencamlib/version_string.hpp
However FreeCAD doesn't find Opencamlib:

Code: Select all

FreeCAD 0.17, Libs: 0.17R12435 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Path workbench activated
Surfacing Select Mode
base object: Clone
This operation requires OpenCamLib to be installed.
Free Select
Where should be Opencamlib installed in order to be usable by Freecad?

Thank you very much in advance.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: How to activate openCamLib after compiling it

Post by chrisb »

- Please verify if the files are in fact to be found under /usr/local/lib, especially the *.so files.
- verify if /usr/local/lib is contained in /etc/ld.so.conf.d/libc.conf
- run ldconfig and try
- run ldconfig /usr/local/lib and try.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
luispa
Posts: 44
Joined: Tue Jul 29, 2014 4:48 am

Re: How to activate openCamLib after compiling it

Post by luispa »

Thank you for your reply. Files were installed in /usr/lib.
luispa
Posts: 44
Joined: Tue Jul 29, 2014 4:48 am

Re: How to activate openCamLib after compiling it

Post by luispa »

chrisb wrote: Mon Nov 27, 2017 2:24 pm - Please verify if the files are in fact to be found under /usr/local/lib, especially the *.so files.
- verify if /usr/local/lib is contained in /etc/ld.so.conf.d/libc.conf
- run ldconfig and try
- run ldconfig /usr/local/lib and try.
I did it but I had no success.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: How to activate openCamLib after compiling it

Post by chrisb »

luispa wrote: Wed Dec 06, 2017 5:22 pm I did it but I had no success.
Today I wanterd to get ocl running again and cannot find it anymore in Path WB. Did I miss the removal or is it something with my eyes?

OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12772 (Git)
Build type: None
Branch: master
Hash: c8c9b76f43d2c78c4afb65b756f3f07d626aac85
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply