Compiling 0.19git on Centos 7

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
KBentley57
Posts: 4
Joined: Wed Feb 24, 2021 4:19 pm

Compiling 0.19git on Centos 7

Post by KBentley57 »

Hi All,

I'm trying to build the latest pull from git, #3ef181a751d5a0e78d3edab82ed46a69b743a264, and I'm running into a few issues that I couldn't seem to find a quick resolution for. The first error that keeps coming up is related to VTK. I'm using the systems libs and devel packages, but that doesn't seem to matter for this error.

Using Qt4 and Python2.7, otherwise a default CMake build. CentOS 7, x64, up to date (irony).

The problem is that after a successful CMake configuration, I get to the SMDS target, and during the link it complains that it can't find libTKVCAF.so. That library doesn't look like a target in any of FreeCAD's cmake files, as

Code: Select all

find . -name CMakeLists.txt |xargs grep -i TKVCAF
returns nothing. I thought it might be related to VTK from the name, and while I can see references to the CMake variables VTK_LIBRARIES and VTK_INCLUDE_DIRS, there's never a call to find_package(VTK...) that I can find,

Code: Select all

find . -name CMakeLists.txt |xargs grep -i find_package |grep -i VTK
returns nothing here as well. I haven't checked to see if another module calls find_package on VTK, but it looks suspicious that we're using those result variables, and it's never explicitly found in the code, nor is there a call to include(VTK) of any sorts.

Code: Select all

find . -name CMakeLists.txt |xargs grep -i include\( |grep -i VTK
returns nothing.

I'd offer a bitcoin for your thoughts, well, maybe a bitcent? :)

There's no libTKVCAF.so on my system, that's another problem that the CMake ought to detect if it's required for linking.

Information about the cmake::

Code: Select all

Running CMake to regenerate build system...
-- Compiler: GNU, version: 4.8.5
-- prefix:~/Downloads/FreeCAD/build/TESTING
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib64
-- cmake: 3.17.5
-- Found Boost:/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.55") found components: filesystem program_options regex system thread 
-- Found Xerces-C: /usr/lib64/libxerces-c.so
-- PyCXX found:
--   Headers: ~/Downloads/FreeCAD/src
--   Sources:  ~/Downloads/FreeCAD/src/CXX
--   Version:  6.2.8
-- -- OpenCASCADE Community Edition has been found.
CMake Warning (dev) at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (OCC) does
  not match the name of the calling package (OpenCasCade).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cMake/FindOpenCasCade.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:4 (find_package)
  CMakeLists.txt:52 (SetupOpenCasCade)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- -- Found OCE/OpenCASCADE version: 6.8.0
-- -- OCE/OpenCASCADE include directory: /lib64/oce-0.17/../../include/oce
-- -- OCE/OpenCASCADE shared libraries directory: 
-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType
-- Check for medfile (libmed and libmedc) ...
-- We guess that libmed was built using hdf5-serial version
-- Checking for one of the modules 'hdf5-serial'
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Checking for one of the modules 'ompi-cxx'
CMake Warning at cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:104 (message):
  ompi-cxx was not found.  Check for error above.
Call Stack (most recent call first):
  CMakeLists.txt:59 (SetupSalomeSMESH)


-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Checking for module 'Coin'
--   Found Coin, version 3.1.3
-- Coin3D libraries found
-- Could NOT find Spnav (missing: SPNAV_LIBRARY SPNAV_INCLUDE_DIR) 
-- Using default python: -python2.7
-- libshiboken built for Release
-- Found PySide Tools: /bin/pyside-uic, /bin/pyside-rcc
-- ==============================================
PySide Python module found at /usr/lib64/python2.7/site-packages/PySide
.
==============================================

-- -- matplotlib-1.2.0 has been found.
-- Platform is 64-bit, set -D_OCC64
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Found Boost:/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: python27 
-- found Boost: 1_72
-- boost-incude dirs are: /usr/local/include
-- boost-python lib is: 
-- boost_LIBRARY_DIRS is: /usr/local/lib
-- Boost_LIBRARIES is: Boost::python
-- area module (for Path Workbench) will be installed to: lib64
-- Note: Doxygen docs will look better with graphviz's dot installed.
-- Coin3D doc is not installed
-- 
==============
Summary report
==============

-- Build type:          RelWithDebInfo
-- Compiler:            /bin/c++ (4.8.5)
-- Flags:               -Wall -Wextra -Wno-write-strings 
-- Standard:            Requires C++11
-- Python:              [/bin/python2.7] [-python2.7]
-- PCL:                 not enabled
-- pybind11:            not enabled
-- Boost:               1.72.0 (1.72.0)
-- XercesC:             [/usr/lib64/libxerces-c.so] [/usr/include]
-- ZLIB:                1.2.7
-- PyCXX:               [~/Downloads/FreeCAD/src]
-- OCC:                 6.8.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP;TKHLR;TKFeat] [] [/lib64/oce-0.17/../../include/oce]
-- SMESH:               build internal
--  MEDFile:            [/usr/lib64/libmedC.so;/usr/lib64/libmed.so] [/usr/include]
--  HDF5:               1.8.13
--  VTK:                6.1.0
-- NETGEN:              not enabled
-- SWIG:                2.0.10
-- Eigen3               3.3.7
-- Qt4:                 4.8.7
-- QtWebKit:            found
-- Shiboken:            1.2.4 [/usr/include/shiboken]
-- PySide:              1.2.4 [/usr/include/PySide]
-- PySideTools:         [/bin/pyside-uic] [/bin/pyside-rcc]
-- Freetype:            2.8.0
-- OpenGL:              /usr/lib64/libGL.so
-- OpenGLU:            /usr/lib/libGLU.so [/usr/lib/libGLU.so][/usr/include]
-- Coin3D:              [Coin;GLU;GL;Xext;X11;bz2;z;freetype;fontconfig;dl;pthread] [/usr/include/Coin3;/usr/include/Coin3/Inventor/annex;/usr/include/freetype2]
-- SPNAV:               [SPNAV_LIBRARY-NOTFOUND] [SPNAV_INCLUDE_DIR-NOTFOUND]
-- Matplotlib:          1.2.0
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             1.8.5
--  Language:           English
--  Coin3D_DOC:         not found
=================================================
Now run 'cmake --build /home/bentleykw/Downloads/FreeCAD/build' to build FreeCAD
=================================================
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Compiling 0.19git on Centos 7

Post by PrzemoF »

Welcome to the forum!

bitcent is still worth 410 euro ;) I'd go for a satoshi.

Now, down to the business. I run fedora 33 and it show this:

Code: Select all

$ locate TKVCAF
/usr/lib64/libTKVCAF.so
/usr/lib64/libTKVCAF.so.7
/usr/lib64/libTKVCAF.so.7.5.0
$ rpm -qf /usr/lib64/libTKVCAF.so
opencascade-devel-7.5.0-1.fc33.x86_64
TKVCAF is part of OpenCASCADE.

I'm not sure how close is centos to fedora, but we have nightly builds that (mostly) works - see my signature. I don't have centos7 there, but I enabled builds [1] for centos-stream - that might give us some answers where to look for the package.

[1] https://copr.fedorainfracloud.org/coprs ... d/2016638/
KBentley57
Posts: 4
Joined: Wed Feb 24, 2021 4:19 pm

Re: Compiling 0.19git on Centos 7

Post by KBentley57 »

Thanks Przemo! I've been lurking around for just a bit, and using it even less, but getting the hang of things fairly quickly.

I saw that just after posting. One Cent 7, the OpenCASCADE packages are provided by the following packages, if that helps. None of them seem to provide that library - I guess it's a versioning or packaging issue. Yum is showing that the repo version is 0.17.1. The thread here mentions something more about it. I think Cent 7 is just lagging too far behind.

https://forum.freecadweb.org/viewtopic.php?t=17501

If I can offer a suggestion for a small patch,

cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake calls find_package(OpenCasCade) to determine whether or not it's on the system I'd place a 7.0 REQUIRED there to make sure it finds a suitable version, or complain otherwise. It looks like 7.0 is where those libs were introduced.

Code: Select all

macro(SetupOpenCasCade)
# -------------------------------- OpenCasCade --------------------------------

    find_package(OpenCasCade)
    if(NOT OCC_FOUND)
        message(FATAL_ERROR "================================================================\n"
                            "Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
                            "================================================================\n")
    endif(NOT OCC_FOUND)

endmacro(SetupOpenCasCade)
becomes

Code: Select all

macro(SetupOpenCasCade)

# -------------------------------- OpenCasCade --------------------------------

find_package(OpenCasCade 7.0 REQUIRED)
   
endmacro(SetupOpenCasCade)
Thanks,

Kyle
sasabottle
Posts: 1
Joined: Tue Oct 25, 2022 1:11 am

Re: Compiling 0.19git on Centos 7

Post by sasabottle »

You might be to try building FreeCAD against a specific version of VTK, rather than relying on the system libraries and development packages. You could use find_package(VTK X.X REQUIRED) and specify the version you want to use. You can also check if another module calls find_package on VTK.
Another suggestion would be to check the FreeCAD's documentation or forums for help with building on CentOS 7, as other users may have run into similar issues and found solutions.
Last edited by sasabottle on Tue Jan 24, 2023 12:55 am, edited 1 time in total.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Compiling 0.19git on Centos 7

Post by onekk »

sasabottle wrote: Fri Jan 20, 2023 10:55 pm You might be to try building FreeCAD against a specific version of VTK, rather than relying on the system libraries and development packages.
see the post date, they are from 2021 how useful could be your answer?
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply