Trouble building master: missing coin3d

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Trouble building master: missing coin3d

Post by freman »

wmayer wrote: Thu Aug 04, 2022 10:25 am Change the content of SetupCoin3D.cmake to:

Code: Select all

macro(SetupCoin3D)
# -------------------------------- Coin3D --------------------------------

    # First try CONFIG mode
    find_package(Coin CONFIG)
    if (Coin_FOUND)
        set (COIN3D_INCLUDE_DIRS ${Coin_INCLUDE_DIR})
        set (COIN3D_LIBRARIES ${Coin_LIBRARIES})
    else()
        # Try MODULE mode now
        if (WIN32 AND MINGW)
            find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
            find_library(COIN3D_LIBRARIES Coin)
        endif ()

        find_package(Coin3D REQUIRED)
        if(NOT COIN3D_FOUND)
            message(FATAL_ERROR "=================\n"
                                "Coin3D not found.\n"
                                "=================\n")
        endif(NOT COIN3D_FOUND)
    endif()

    IF(NOT PIVY_VERSION)
      execute_process (COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.__version__,end='')" OUTPUT_VARIABLE PIVY_VERSION)
    ENDIF()

endmacro(SetupCoin3D)
Thanks for the help . That did get it to find something, though the result looks a bit unusual.

Code: Select all

-- Coin3D:               [optimized;Coin;debug;Coin] [/usr/include/Coin4]
Does that look as expected? Does that mean I'm building a debug version of Coin ?

Thanks babaroga . That will be my fallback solution. First I'll follow wmayer's suggestions and hopefully get this fixed in master.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Trouble building master: missing coin3d

Post by wmayer »

freman wrote: Thu Aug 04, 2022 2:01 pm Does that look as expected? Does that mean I'm building a debug version of Coin ?
The output looks slightly different but it is OK. It does NOT mean your are building a debug or release version of Coin but it uses what's available on your system. Internally coin-config.cmake distinguishes between release and debug version but in the end for Linux it uses the one and same shared library file.

It's only on Windows platforms where for a FreeCAD debug version the debug version of 3rd party libraries are used and for a release build the release versions (aka optimized) of them.
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Trouble building master: missing coin3d

Post by freman »

OK, I seem to have got around the Coin problems. Thanks to all for the help.

Can something be done in master to clean this up for the future so certain distro users don't need to hack the source each time?

Now I have a run time error from shiboken:

Code: Select all

Traceback (most recent call last):                                                                                                                       
  File "<string>", line 1, in <module>                                                                                                                   
  File "/usr/lib64/python3.10/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import                                    
    return original_import(name, *args, **kwargs)                                                                                                        
<class 'ImportError'>: /~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_                            
/~/freecad-build-master/Mod/Mesh/Mesh.so: undefined symbol: _ZN4Base5Line3IdEC1ERKNS_7Vector3IdEES5_                                                   
Any ideas on how to chase that one down?

;)
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: Trouble building master: missing coin3d

Post by waebbl »

freman wrote: Thu Aug 04, 2022 5:24 pm Can something be done in master to clean this up for the future so certain distro users don't need to hack the source each time?
From my POV as a maintainer of FreeCAD and other packages for a certain linux distro, I'd say this isn't an issue with FreeCAD, but with the packages from your distros. They should install configuration files like cmake or pkgconfig files and not rely on consumers of those packages to provide these files. My advise is to open a bug on your distros bug tracker if a package actually provides such files, but they are not installed for your distro.
IMO it's a hack, but not a solution if consumers provide such files.
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Trouble building master: missing coin3d

Post by freman »

They should install configuration files like cmake or pkgconfig files and not rely on consumers of those packages to provide these files.
Oh, you mean like this:
rpm -q --whatprovides /usr/lib64/pkgconfig/Coin.pc
Coin4-devel-4.0.0-9.fc35.x86_64
A few weeks ago, this worked fine on Fedora.

Now I still can't build FreeCAD master because of broken shiboken.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: Trouble building master: missing coin3d

Post by waebbl »

freman wrote: Fri Aug 05, 2022 8:17 am
They should install configuration files like cmake or pkgconfig files and not rely on consumers of those packages to provide these files.
Oh, you mean like this:
rpm -q --whatprovides /usr/lib64/pkgconfig/Coin.pc
Coin4-devel-4.0.0-9.fc35.x86_64
Something like that. In the case of FreeCAD and Coin you need a cmake file, not the pkgconfig file. On my system the cmake package provides an old style module file for Coin itself (/usr/share/cmake/Modules/FindCoin3D.cmake), but the coin package also provides new style config files for cmake coin-config{,-version}.cmake and coin-export{,-<CMAKE_BUILD_TYPE>}.cmake. Coin upstream has a way, so during build of the package those files are created and are/can be installed. But they seem to be missing for your installation.

Edit: It worked a few weeks ago, because the FindCoin3D.cmake file which was provided by FreeCAD used pkg-config to look for a pkgconfig file if it couldn't find any cmake configuration files.
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Trouble building master: missing coin3d

Post by freman »

Why do you say that is missing from my distro ?

Code: Select all

 
 ls -ail /usr/share/cmake/Modules/FindCoin3D.cmake
1979937 -rw-r--r--. 1 root root 2303 Jan 25  2022 /usr/share/cmake/Modules/FindCoin3D.cmake

rpm -q --whatprovides /usr/share/cmake/Modules/FindCoin3D.cmake
cmake-data-3.22.2-1.fc35.noarch
The linux bit of that file is :

Code: Select all

   find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
    find_library(COIN3D_LIBRARIES Coin)
Doesn't that work any more ?
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: Trouble building master: missing coin3d

Post by waebbl »

freman wrote: Fri Aug 05, 2022 9:14 am Why do you say that is missing from my distro ?
I didn't say that, I said it seems like it's missing. The last time I used rpm is more than 20 years ago, so I have no clue about the exact semantics of the option --whatprovides which you used in your query. I assumed the output you showed is complete and also assumed, if this option shows pkgconfig files, it most likely will also show cmake configuration files, as long as they are provided by the package. Because none are shown in your output, I guessed they might eventually not be available.
But it still seems to be true that your system doesn't have the files, provided by the Coin package[1]. The file you listed is provided by the CMake package and might or might not be sufficient, depending on whether the consumer accepts module style files or requires config style cmake files. Using module style files is discouraged by CMake but are still searched for if no config style files are found.

That's the situation on my system:

$ qfile /usr/share/cmake/Modules/FindCoin3D.cmake
dev-util/cmake: /usr/share/cmake/Modules/FindCoin3D.cmake
$ qlist coin | grep cmake
/usr/lib64/cmake/Coin-4.0.0/coin-config.cmake
/usr/lib64/cmake/Coin-4.0.0/coin-config-version.cmake
/usr/lib64/cmake/Coin-4.0.0/coin-export.cmake
/usr/lib64/cmake/Coin-4.0.0/coin-export-gentoo.cmake

The -gentoo on the last entry will be replaced with the CMAKE_BUILD_TYPE. The last time I had to rebuild coin was back in the December, where Gentoo still used it's own build type. Nowadays, we use the RelWithDebInfo build type, so after a rebuild the name will be coin-export-relwithdebinfo.cmake. If your system uses Release or Debug build type the name will be coin-export-release.cmake or coin-export-debug.cmake accordingly. There might even be several of these files available, if the package build for and installs several CMAKE_BUILD_TYPE variants.

[1] https://github.com/coin3d/coin/blob/Coi ... #L403-L431 The commands listed here generate and install those files for the Coin-4.0.0 tag, which is the base for the coin-4.0.0 tarball.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: Trouble building master: missing coin3d

Post by waebbl »

freman wrote: Fri Aug 05, 2022 9:14 am The linux bit of that file is :

Code: Select all

   find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
    find_library(COIN3D_LIBRARIES Coin)
Doesn't that work any more ?
It depends. For my system this should work, because the coin headers are installed in /usr/include and the library is named libCoin.so and located in a path which is searched for by default. If, for example, the library is named libCoin4.so, which I've seen in the past being used by certain distros, the find_library call probably won't work. It will also not work out of the box if the Coin library will be installed in a non-default path, i.e. a path that is not searched for by default, because no PATH HINTS are given.
User avatar
freman
Veteran
Posts: 2201
Joined: Tue Nov 27, 2018 10:30 pm

Re: Trouble building master: missing coin3d

Post by freman »

Ah,so you're a fellow ricer ;) I ran Gentoo for about 10y and loved it, but found I spent more time maintaining it than using it.
so I have no clue about the exact semantics of the option --whatprovides which you used in your query.
Well it's pretty explicit but if you were making assumptions, that explains your comment.

The Fedora files seems like what you have:

Code: Select all

/usr/lib64/cmake/Coin-4.0.0:

1966155 drwxr-xr-x.   2 root root 4096 Aug  3 18:30 .
1967947 drwxr-xr-x. 107 root root 4096 Aug  3 18:30 ..
1967929 -rw-r--r--.   1 root root 4860 Jul 21  2021 coin-config.cmake
1966158 -rw-r--r--.   1 root root 2878 Jul 21  2021 coin-config-version.cmake
1968236 -rw-r--r--.   1 root root 3616 Jul 21  2021 coin-export.cmake
1967930 -rw-r--r--.   1 root root  817 Jul 21  2021 coin-export-release.cmake

rpm -q --whatprovides /usr/lib64/cmake/Coin-4.0.0/coin-export-release.cmake
Coin4-devel-4.0.0-9.fc35.x86_64
Post Reply