Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873601 - sci-libs/vtk-9.1.0-r2 fails to compile (MUSL): loguru.cpp:98:18: fatal error: execinfo.h: No such file or directory
Summary: sci-libs/vtk-9.1.0-r2 fails to compile (MUSL): loguru.cpp:98:18: fatal error:...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
Keywords: PullRequest
Depends on:
Reported: 2022-09-30 07:08 UTC by Agostino Sarubbo
Modified: 2022-10-12 23:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log.xz (build.log.xz,233.23 KB, application/x-xz)
2022-09-30 07:08 UTC, Agostino Sarubbo

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-09-30 07:08:43 UTC

Issue: sci-libs/vtk-9.1.0-r2 fails to compile (MUSL).
Discovered on: amd64 (internal ref: tinderbox_musl)

This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-09-30 07:08:47 UTC
Created attachment 814738 [details]

build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Comment 2 Agostino Sarubbo gentoo-dev 2022-09-30 07:08:48 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:

/var/tmp/portage/sci-libs/vtk-9.1.0-r2/work/VTK-9.1.0/ThirdParty/loguru/vtkloguru/loguru.cpp:98:18: fatal error: execinfo.h: No such file or directory
FAILED: ThirdParty/loguru/vtkloguru/CMakeFiles/loguru.dir/loguru.cpp.o 
/var/tmp/portage/sci-libs/vtk-9.1.0-r2/work/VTK-9.1.0/ThirdParty/loguru/vtkloguru/loguru.cpp:98:18: fatal error: execinfo.h: No such file or directory
Comment 3 Bernd 2022-09-30 11:54:50 UTC
On a first try to analyze this issue, I think we have a few options on how to handle this.

First, easiest but dirty would be to package.mask vtk on musl (maybe temporary until we have a proper fix?)

Second, less intrusive, the package has an option VTK_ENABLE_LOGGING which triggers building vtkloguru, so we can add a USE flag and package.use.force it on musl to be disabled. However, despite the fact there's an option for it, I never tried to build vtk with this option OFF and have seen it kind of mandatory for a properly working build.


/var/tmp/portage/sci-libs/vtk-9.1.0-r2/work/VTK-9.1.0 $ find . -type f -exec grep -H execinfo {} \;
./Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx:#  include <execinfo.h>
./Utilities/KWSys/vtksys/SystemInformation.cxx:#  include <execinfo.h>
./Utilities/KWSys/vtksys/CMakeLists.txt:#  KWSYS_NO_EXECINFO          = Do not use execinfo.
./Utilities/KWSys/vtksys/CMakeLists.txt:    # it's in libexecinfo
./Utilities/KWSys/vtksys/CMakeLists.txt:    find_library(EXECINFO_LIB "execinfo")
./Utilities/KWSys/vtksys/CMakeLists.txt:    CHECK_INCLUDE_FILE_CXX("execinfo.h" KWSYS_CXX_HAS_EXECINFOH)
./ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/thirdparty/loguru/vtkmloguru/loguru.cpp:   #include <execinfo.h>  // for backtrace
./ThirdParty/netcdf/vtknetcdf/libhdf5/hdf5debug.c:#include <execinfo.h>
./ThirdParty/netcdf/vtknetcdf/libdispatch/nclog.c:#include <execinfo.h>
./ThirdParty/netcdf/vtknetcdf/* Define to 1 if you have the <execinfo.h> header file. */
./ThirdParty/loguru/vtkloguru/loguru.cpp:       #include <execinfo.h>  // for backtrace

AFAICS, the vtksys module has logic for handling execinfo.h including an option KWSYS_NO_EXECINFO we could enable if we ever get into trouble with this module. From what I can see from the build log however, the package seems to handle a missing execinfo.h for this module correctly.
The vtkm loguru is IMO not being built, because the main vtkloguru will being used. This is relevant only if vtkm is being built as an external module which is currently not supported by upstream.
The netcdf #include's *shouldn't* be an issue either, as we use external libraries where they are available and allowed and currently we don't seem to have issues with netcdf on musl.
We also might report to upstream and ask if it's possible to add some logic to vtkloguru, similar to how it's done in vtksys to handle the execinfo case more detailed.

Comment 4 Bernd 2022-10-04 16:12:00 UTC
On tests with vtk-9.2.2 it looks like logging can be disabled safely. I'm gonna add a USE flag for this.
Comment 5 Bernd 2022-10-04 17:35:11 UTC
Since vtk uses loguru unchanged, I link an upstream bug report on this.
Comment 6 Bernd 2022-10-04 17:39:23 UTC
Also see this discussion on vtk discourse:
Comment 7 Bernd 2022-10-04 20:44:57 UTC
Disable logging on musl is the way which is recommend by VTK upstream, until the issue is solved by loguru upstream.
Comment 8 Larry the Git Cow gentoo-dev 2022-10-12 23:09:50 UTC
The bug has been referenced in the following commit(s):

commit 6b7393da42ee0482c5886b988257c9ceacd7ec9f
Author:     Bernd Waibel <>
AuthorDate: 2022-10-04 20:57:04 +0000
Commit:     Sam James <>
CommitDate: 2022-10-12 23:06:27 +0000

    sci-libs/vtk: fix build on musl
    - Add logging USE flag to be able to disable it for musl
    - Re-keyword temporarily dropped arm64
    Signed-off-by: Bernd Waibel <>
    Signed-off-by: Sam James <>

 sci-libs/vtk/metadata.xml                                 | 1 +
 sci-libs/vtk/{vtk-9.1.0-r3.ebuild => vtk-9.1.0-r4.ebuild} | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

commit 036aea33c5ecded8413417a9431370440347cfd5
Author:     Bernd Waibel <>
AuthorDate: 2022-10-04 20:51:52 +0000
Commit:     Sam James <>
CommitDate: 2022-10-12 23:06:27 +0000

    profiles: mask logging USE flag on sci-libs/vtk
    The loguru module doesn't build on musl. Mask it until it's fixed
    Signed-off-by: Bernd Waibel <>
    Signed-off-by: Sam James <>

 profiles/features/musl/package.use.mask | 4 ++++
 1 file changed, 4 insertions(+)