f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Static version of f3d installs lib/xxx.a files which are not required

Open mzf-guest opened this issue 3 years ago • 6 comments

Describe the bug When building and installing F3D with BUILD_SHARED_LIBS=OFF, the lib folder contains .a files that do not seem required to launch the application (ldd f3d does not output these files):

libf3d.a
libVTKExtensionsCore.a
libVTKExtensionsRendering.a
libVTKExtensionsApplicative.a
libVTKExtensionsReaders.a

To Reproduce Steps to reproduce the behavior:

  1. cmake -G Ninja -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=OFF ../f3d
  2. ninja install
  3. tree install
  4. output shows files in the lib folder:
install
+ bin
   +- f3d
+ lib
   +- libf3d.a
   +- libVTKExtensionsApplicative.a
   +- libVTKExtensionsCore.a
   +- libVTKExtensionsReaders.a
   +- libVTKExtensionsRendering.a
+ share
   (...)

Expected behavior Not lib folder when building and installing f3d statically.

System Information:

  • OS: Debian unstable
  • GPU and GPU driver: N/A

F3D version 1.3.1

Additional context If this is intentional behavior, could you please provide an option to avoid installing this lib folder?

Thanks!

mzf-guest avatar Sep 20 '22 20:09 mzf-guest

Building f3d completelly statically is not a good idea as it will not help users to use the libf3d, see the release notes: https://github.com/f3d-app/f3d/releases/tag/v1.3.1

mwestphal avatar Sep 21 '22 02:09 mwestphal

No, you can use libf3d if it's built statically. However, in this case you need to link indirectly with its dependencies too so it makes sense to install the vtkext static libraries. My problem right now is the vtkext libraries are always installed regardless of the build type of libf3d, but they shouldn't be installed if libf3d is a shared lib.

Meakk avatar Sep 21 '22 05:09 Meakk

My problem right now is the vtkext libraries are always installed regardless of the build type of libf3d, but they shouldn't be installed if libf3d is a shared lib.

See vtkModule.cmake and vtk_module_build.

Meakk avatar Sep 21 '22 11:09 Meakk

Building f3d completelly statically is not a good idea as it will not help users to use the libf3d, see the release notes: https://github.com/f3d-app/f3d/releases/tag/v1.3.1

The release notes state "Introducing an alpha version of the libf3d" so it sounds like relevant for advanced developers only. I would wait for a "stable" version of this lib to make it available to Debian because no other application uses it at the moment and library transition is very time consuming. (For instance SONAME bump triggers a complex transition process, see here if you are interested.)

By the way, I can just remove these extra files in the deb package. Not a show stopper.

mzf-guest avatar Sep 21 '22 16:09 mzf-guest

Ok, I suppose that BUILD_SHARED_LIBS=OFF + F3D_INSTALL_SDK=OFF should not install any libs.

mwestphal avatar Sep 21 '22 16:09 mwestphal

Indeed, if libf3d is not packaged, BUILD_SHARED_LIBS=OFF and F3D_INSTALL_SDK=OFF are the correct options.
However, I think F3D_INSTALL_SDK=OFF does not work in 1.3.1 (fixed in master only), so you can remove manually libf3d.a and all vtkext static libs, and public headers in include/f3d too.

Meakk avatar Sep 21 '22 16:09 Meakk

#436 and #433 will be needed for this to be fixed

mwestphal avatar Sep 25 '22 08:09 mwestphal

not closed yet

mwestphal avatar Sep 28 '22 05:09 mwestphal

Fixed by #436 and #433

mwestphal avatar Oct 22 '22 10:10 mwestphal