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!
jdmiller15
Posts: 4
Joined: Wed Jan 26, 2022 4:10 pm

Re: How to activate openCamLib after compiling it

Post by jdmiller15 »

i am using Fedora 37.
I first tried the following:

(tutorial-env) [david@lnx101 ~]$ python -m pip install Desktop/opencamlib-2023.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
\Processing ./Desktop/opencamlib-2023.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Installing collected packages: opencamlib
Successfully installed opencamlib-2023.1.11


[david@lnx101 ~]$ find . -name ocl* -print
./tutorial-env/lib/python3.11/site-packages/opencamlib/ocl.so
./.local/lib/python3.11/site-packages/opencamlib/ocl.so
[david@lnx101 ~]$

in ./tutorial-env/lib/python3.11/site-packages/opencamlib
camvtk.py __init__.py ocl.so procmemory.py __pycache__ pyocl.py STLTools.py
and in ./tutorial-env/lib/python3.11/site-packagesl/opencamlib.libs
libgomp-a34b3233.so.1.0.0

I also have set
EnableAdvancdedOCLFeatures set to true
and
EnableExsperimentalFeatures set to true

in FreeCAD 0.20.2
>>> import ocl
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib64/python3.11/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
return original_import(name, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libgomp-a34b3233.so.1.0.0: cannot open shared object file: No such file or directory
>>>

so I went to https://github.com/aewallin/opencamlib and downloaded opencamlib-master
when I try to build
[david@lnx101 build]$ cmake .. -D CXX_LIB="ON"
-- Note: will NOT build pure c++ library
-- Note: will NOT build python library
-- Note: will NOT build node.js library
-- Note: will NOT build emscripten library
-- C++ compiler version: 2.2.1 [/usr/lib64/ccache/c++]
-- setting gcc options: -Wall -Wno-deprecated -pedantic-errors
-- Found Boost 1.78.0 at /usr/lib64/cmake/Boost-1.78.0
-- Requested configuration: QUIET REQUIRED
-- BoostConfig: find_package(boost_headers 1.78.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib64/cmake)
-- Found boost_headers 1.78.0 at /usr/lib64/cmake/boost_headers-1.78.0
-- Found Boost: /usr/lib64/cmake/Boost-1.78.0/BoostConfig.cmake (found version "1.78.0")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- found OpenMP, compiling with flags: -fopenmp
-- Found Git: /usr/bin/git (found version "2.39.1")
CMake Warning at src/version_string.cmake:38 (message):
Git failed (not a repo, or no tags).
Call Stack (most recent call first):
src/CMakeLists.txt:185 (include)


CMake Error at src/version_string.cmake:39 (file):
file failed to open for reading (No such file or directory):

/home/david/Desktop/opencamlib/opencamlib-master/src/git-tag.txt
Call Stack (most recent call first):
src/CMakeLists.txt:185 (include)


CMake Error at src/version_string.cmake:40 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
src/CMakeLists.txt:185 (include)


-- version_string.cmake read from file GIT_COMMIT_ID:
-- OpenCAMLib version: ..
-- configuring src/cutters
-- configuring src/geo
-- configuring src/algo
-- configuring src/dropcutter
-- configuring src/common
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- 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 incomplete, errors occurred!
See also "/home/david/Desktop/opencamlib/opencamlib-master/build/CMakeFiles/CMakeOutput.log".

Fedora uses DNF (rpm), I see it is trying to build debian packages which I can't use.

Is there guidelines for Fedora on getting this to work?
Anon
Posts: 12
Joined: Wed Oct 29, 2014 9:42 am

Re: How to activate openCamLib after compiling it

Post by Anon »

Hi,
on Archlinux I did

Code: Select all

yay -S opencamlib-git
which executed flawlessly
after starting up my git build of FreeCAD (again from AUR) I had to run the following inside the Python console

Code: Select all

import sys
sys.path.append('/usr/opencamlib/')
import ocl
Everything works as expected after that.
Now how do I automate this process to run after every startup?
xemul
Posts: 393
Joined: Tue Mar 21, 2023 9:35 pm

Re: How to activate openCamLib after compiling it

Post by xemul »

Code: Select all

mkdir ~/.local/share/FreeCAD/Mod/opencamlib && ln -s /usr/opencamlib/ocl.pyd ~/.local/share/FreeCAD/Mod/opencamlib
Post Reply