How to activate openCamLib after compiling it

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 4:16 am

quick61 wrote:
Wed Jun 26, 2019 4:02 am
Your FreeCAD Python version is 3.6.8 and your building OCL for 2.7. Not going to work. Please let me know if you get OCL to build with Python 3.6.8. on 18.04.2, and how you did it. Haven't figured that one out yet....

Mark

oh :-(

I am getting a boost error. is this what you got?
User avatar
quick61
Posts: 3793
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: How to activate openCamLib after compiling it

Postby quick61 » Wed Jun 26, 2019 4:38 am

Erich Schulz wrote:
Wed Jun 26, 2019 4:16 am
I am getting a boost error. is this what you got?
Where, in the build or config? I haven't been able to even get OCL to config for Python 3, flat out refuses, with py3 flag on it only configs using 2.7.
This post made with 0.0% Micro$oft products - GOT LINUX?
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 5:03 am

This is where I'm getting to on the build:

Code: Select all

erich@erich-Gazelle:~/opencamlib/build$ cmake -DBUILD_PY_LIB=ON -DUSE_PY_3=ON ../src
--  Note: will NOT build emscripten library
-- C++ compiler version: 7.4.0 [/usr/bin/c++]
-- setting gcc options: -Wall  -Wno-deprecated -pedantic-errors
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:310 (if):
  if given arguments:

    "TRUE"

  An argument named "TRUE" appears in a conditional statement.  Policy
  CMP0012 is not set: if() recognizes numbers and boolean constants.  Run
  "cmake --help-policy CMP0012" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:425 (_OPENMP_GET_SPEC_DATE)
  CMakeLists.txt:101 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:310 (if):
  if given arguments:

    "TRUE"

  An argument named "TRUE" appears in a conditional statement.  Policy
  CMP0012 is not set: if() recognizes numbers and boolean constants.  Run
  "cmake --help-policy CMP0012" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindOpenMP.cmake:425 (_OPENMP_GET_SPEC_DATE)
  CMakeLists.txt:101 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- found OpenMP, compiling with flags: -fopenmp
-- version_string.cmake git set GIT_COMMIT_ID: 2018.08-131-g054d5fd
-- OpenCamLib version: 2018.08.122
--  configuring src/cutters
--  configuring src/geo
--  configuring src/algo
--  configuring src/dropcutter
--  configuring src/common
-- Boost version: 1.65.1
-- CMake version < 3.12.0
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1094 ] _boost_TEST_VERSIONS = 1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1096 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1098 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1100 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1102 ] Boost_ADDITIONAL_VERSIONS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1104 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1172 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1174 ]   BOOST_ROOT = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1176 ]   BOOST_INCLUDEDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1178 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1180 ] _boost_TEST_VERSIONS = 1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1279 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1303 ] version.hpp reveals boost 1.65.1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1389 ] guessed _boost_COMPILER = -gcc7
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1399 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1443 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1445 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for PYTHON_LIBRARY_RELEASE: boost_python-gcc7-mt-1_65_1;boost_python-gcc7-mt;boost_python-mt-1_65_1;boost_python-mt;boost_python
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for PYTHON_LIBRARY_DEBUG: boost_python-gcc7-mt-d-1_65_1;boost_python-gcc7-mt-d;boost_python-mt-d-1_65_1;boost_python-mt-d;boost_python-mt;boost_python
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1783 ] Boost_FOUND = 1
-- Could NOT find Boost
Boost version: 1.65.1
Boost include path: /usr/include
Could not find the following Boost libraries:
        boost_python
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.
-- Boost_INCLUDE_DIR = /usr/include
-- Boost_INCLUDE_DIRS = /usr/include
-- Boost_LIBRARY_DIRS = 
-- Boost_LIBRARIES = 
-- PYTHON_SITE_PACKAGES = /usr/local/lib/python2.7/dist-packages
-- PYTHON_ARCH_PACKAGES = /usr/local/lib/python2.7/dist-packages
-- PYTHON_INCLUDE_DIRS = /usr/include/python2.7
-- PYTHON_LIBRARIES = /usr/lib/x86_64-linux-gnu/libpython2.7.so
-- PYTHON_SITE_PACKAGES = /usr/local/lib/python2.7/dist-packages
-- PYTHON_ARCH_PACKAGES = /usr/local/lib/python2.7/dist-packages
-- linking python binary ocl.so with boost: 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1094 ] _boost_TEST_VERSIONS = 1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1096 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1098 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1100 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1102 ] Boost_ADDITIONAL_VERSIONS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1104 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1172 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1174 ]   BOOST_ROOT = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1176 ]   BOOST_INCLUDEDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1178 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1180 ] _boost_TEST_VERSIONS = 1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1279 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1303 ] version.hpp reveals boost 1.65.1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1389 ] guessed _boost_COMPILER = -gcc7
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1399 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1443 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1445 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1783 ] Boost_FOUND = 1
-- Boost version: 1.65.1
-- Found doxygen. Documentation can be built with 'make doc' 
-- type:
--  'make' for a normal build
--  'make -j8' to build faster (if you have many cpus)
--  'make install' to install
--  'make package' to build a binary deb-packate
--  'make spackage' to build debian source-packages
--  'make test' to run the tests
-- Configuring done
-- Generating done
-- Build files have been written to: /home/erich/opencamlib/build
it seems to then `make install` ok...

I'm going to have a little hack at /usr/share/freecad-daily/Mod/Path/PathScripts/PathGuiInit.py which makes one of the errors to see if I can figure out more
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 5:46 am

ok so some progress...

I smell a boost issue... I can see that some time ago I install boost with:

Code: Select all

sudo apt install libboost-program-options-dev
when I do the following to force FC to pick up the 2.7 file I get an unknown object with "boost" in its name:

Code: Select all

>>> sys.path.append('/usr/local/lib/python2.7/dist-packages')
>>> import ocl
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: /usr/local/lib/python2.7/dist-packages/ocl.so: undefined symbol: _ZNK5boost6python7objects21py_function_impl_base9max_arityEv
I'll try to use a different boost package and see if I can get the warning i was getting to go away
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 6:09 am

so I eliminated the boost issue by

Code: Select all

sudo apt install libboost-all-dev
and then eliminated all warnings with this cmake command:

Code: Select all

cmake -DBUILD_PY_LIB=ON -DUSE_PY_3=ON ../src -Wno-dev
(the final flag just hushes the dev warnings)

sadly I am still only compiling a 2.7 version

so this:

Code: Select all

import sys
sys.path.append('/usr/local/lib/python2.7/dist-packages')
import ocl
gives:

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_ocl)
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 6:37 am

so I am going to try to install the latest cmake (i am currently on 3.10)

looking in here https://github.com/aewallin/opencamlib/ ... nlib.cmake and the logic seems quite different - so this maybe the issue :idea:
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Wed Jun 26, 2019 6:59 am

quick61 wrote:
Wed Jun 26, 2019 4:38 am
Erich Schulz wrote:
Wed Jun 26, 2019 4:16 am
I am getting a boost error. is this what you got?
Where, in the build or config? I haven't been able to even get OCL to config for Python 3, flat out refuses, with py3 flag on it only configs using 2.7.
wwwwwoooooohoooooo!!!!!

so I cracked it!! I downloaded the latest version of cmake from here: https://cmake.org/download/

(i just grabbed the .sh file, executed it and then rather than `cmake blah` I ran `~/cmake/cmake blah)

fyi I was on cmake 3.10 and am now on 3.14.5.

I have updated the wikipage and filed an issue https://github.com/aewallin/opencamlib/issues/70
User avatar
quick61
Posts: 3793
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: How to activate openCamLib after compiling it

Postby quick61 » Wed Jun 26, 2019 2:00 pm

Erich Schulz wrote:
Wed Jun 26, 2019 6:59 am
wwwwwoooooohoooooo!!!!!

so I cracked it!! I downloaded the latest version of cmake from here: https://cmake.org/download/

(i just grabbed the .sh file, executed it and then rather than `cmake blah` I ran `~/cmake/cmake blah)

fyi I was on cmake 3.10 and am now on 3.14.5.

I have updated the wikipage and filed an issue https://github.com/aewallin/opencamlib/issues/70
wwwwwoooooohoooooo!!!!! is right! That did it. Thank you ever so much! I'v now got it working too. Only difference is I grabbed the 3.15.0-rc2 version. Worked like a champ. OCL is now working on this Kubuntu 18.04.2 LTS install. We're going to want to make a note of this somewhere I'd think.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
Erich Schulz
Posts: 141
Joined: Tue May 07, 2019 10:50 pm
Location: Brisbane, Australia

Re: How to activate openCamLib after compiling it

Postby Erich Schulz » Thu Jun 27, 2019 11:48 am

quick61 wrote:
Wed Jun 26, 2019 2:00 pm
wwwwwoooooohoooooo!!!!! is right! That did it. Thank you ever so much! I'v now got it working too. Only difference is I grabbed the 3.15.0-rc2 version. Worked like a champ. OCL is now working on this Kubuntu 18.04.2 LTS install. We're going to want to make a note of this somewhere I'd think.

Mark
your very welcome! and thanks to the others who helped point in the general direction
victordamasceno
Posts: 12
Joined: Sat Mar 30, 2019 2:14 am

Re: How to activate openCamLib after compiling it

Postby victordamasceno » Fri Jul 26, 2019 6:38 pm

Erich Schulz wrote:
Wed Jun 26, 2019 6:59 am
quick61 wrote:
Wed Jun 26, 2019 4:38 am
Erich Schulz wrote:
Wed Jun 26, 2019 4:16 am
I am getting a boost error. is this what you got?
Where, in the build or config? I haven't been able to even get OCL to config for Python 3, flat out refuses, with py3 flag on it only configs using 2.7.
wwwwwoooooohoooooo!!!!!

so I cracked it!! I downloaded the latest version of cmake from here: https://cmake.org/download/

(i just grabbed the .sh file, executed it and then rather than `cmake blah` I ran `~/cmake/cmake blah)

fyi I was on cmake 3.10 and am now on 3.14.5.

I have updated the wikipage and filed an issue https://github.com/aewallin/opencamlib/issues/70
THANK YOU!!! This issue was driving me (and pretty sure, half the people on this forum) crazy. Updating cmake did the trick!