[FIXED] Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

[FIXED] Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

Here is the dicussion on the Arch AUR subforum https://aur.archlinux.org/packages/free ... ent-779094
TL;DR

Code: Select all

-- Freetype:            2.10.4
-- OpenGLU:             /usr/lib/libGLU.so [/usr/lib/libGLU.so][/usr/include]
-- Coin3D:              [Coin] []
-- SPNAV:               [/usr/lib/libspnav.so] [/usr/include]
Perhaps it's the way Coin3D is packaged in the AUR ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
greyltc
Posts: 24
Joined: Thu Jan 14, 2016 2:24 pm
Location: England

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by greyltc »

The summary printer has this code for coin:

Code: Select all

message(STATUS "Coin3D:              [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]")
https://github.com/FreeCAD/FreeCAD/blob ... cmake#L168

So the empty bracket is because COIN3D_INCLUDE_DIRS is not defined.

COIN3D_INCLUDE_DIRS is not defined because pkgconf does its job in finding coin properly and we never enter the IF where it would be set, as you can see here:
https://github.com/FreeCAD/FreeCAD/blob ... .cmake#L84

I don't know if that's intentional or if it's a bug in FreeCAD/cMake/FindCoin3D.cmake
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

greyltc wrote: Sat Dec 05, 2020 4:37 pm COIN3D_INCLUDE_DIRS is not defined because pkgconf does its job in finding coin properly and we never enter the IF where it would be set
Nice. It's weird that in comparison to other Find*.cmake files, like matplotlib
https://github.com/FreeCAD/FreeCAD/blob ... make#L6-L9

we don't have a COIN3D_VERSION variable
https://github.com/FreeCAD/FreeCAD/blob ... make#L4-L6
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
marioalexis
Posts: 124
Joined: Wed Jun 19, 2019 7:44 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by marioalexis »

According to CMake documentation COIN3D_VERSION, COIN3D_LIBRARIES and COIN3D_INCLUDE_DIRS should be set by pkg_check_modules.
On Arch Linux I get this by adding $ {COIN3D_VERSION} to PrintFinalReport.cmake:

Code: Select all

-- Coin3D: 4.0.1 [Coin] [ ]
On the other hand, for example in Debian (maybe in Ubuntu the same thing happens) the Coin package does not contain the Coin.pc file used by pkg-config through CMake's pkg_check_modules function, while Arch's Coin package Linux does contain Coin.pc.
Therefore as @greyltc explains, in Arch Linux pkg-config does the job, while distros like Debian the IF block after

Code: Select all

pkg_check_modules (COIN3D Coin)
is executed and therefore COIN3D_LIBRARIES and COIN3D_INCLUDE_DIRS variables are set in that block (but not COIN3D_VERSION).

In short, in Arch Linux I get:

Code: Select all

-- Coin3D:              4.0.1 [Coin] [ ]
While in Debian I get:

Code: Select all

-- Coin3D:               [/usr/lib/libCoin.so] [/usr/include]
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

Do we need to make a conditional statement so that Coin3D version can be reported no matter the distro ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

greyltc wrote: Sat Dec 05, 2020 4:37 pm I don't know if that's intentional or if it's a bug in FreeCAD/cMake/FindCoin3D.cmake
Can anyone answer this?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

Issue has been merged, see https://forum.freecadweb.org/viewtopic. ... 70#p482870
greyltc wrote: Sat Dec 05, 2020 4:37 pm :bell:
@greyltc Do you mind testing?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
greyltc
Posts: 24
Joined: Thu Jan 14, 2016 2:24 pm
Location: England

Re: Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by greyltc »

@Kunda1 looks pretty good to me now!

Code: Select all

-- Checking for one of the modules 'hdf5-serial'
-- Unable to determine HDF5 C flags from HDF5 wrapper.
-- Unable to determine HDF5 C version_var from HDF5 wrapper.
-- Found HDF5: hdf5::hdf5-shared;hdf5::hdf5-shared;/usr/lib/libhdf5.so (found version "1.12.0")  
-- Checking for one of the modules 'ompi-cxx'
-- Found SWIG: /usr/bin/swig (found version "4.0.2")  
-- Found Eigen3: /usr/include/eigen3 (found suitable version "3.3.9", minimum required is "2.91.0") 
-- Checking for module 'Coin'
--   Found Coin, version 4.0.1
-- Coin3D libraries found
-- Found Spnav: /usr/lib/libspnav.so  
-- Shiboken2Config: Using default python: .cpython-39-x86_64-linux-gnu
-- Found PythonInterp: /usr/bin/python (found suitable version "3.9.2", minimum required is "3") 
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [FIXED] Compiling on Arch/Manjaro: CMake summary doesn't report Coin3D version

Post by Kunda1 »

greyltc wrote: Mon Mar 29, 2021 5:22 pm looks pretty good to me now!
:+1:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply