Bug 292590 - math/vtk9: fix build with libc++ 21
Summary: math/vtk9: fix build with libc++ 21
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 292067
  Show dependency treegraph
 
Reported: 2026-01-19 19:58 UTC by Dimitry Andric
Modified: 2026-01-31 18:42 UTC (History)
0 users

See Also:
yuri: maintainer-feedback+


Attachments
math/vtk9: fix build with libc++ 21 (1.86 KB, patch)
2026-01-19 19:59 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2026-01-19 19:58:09 UTC
With libc++ 21, math/vtk9 fails to compile, resulting in errors similar
to:

    In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14:
    In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11:
    /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc'
      747 |     T* p = static_cast<T*>(malloc(n * sizeof(T)));
          |                            ^~~~~~
    /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free'
      752 |   void deallocate(T* p, size_t) { free(p); }
          |                                   ^~~~

This is because malloc and free are defined in <cstdlib>, which is not
included in vtk's format.h. Add the include to fix the build.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2026-01-19 19:59:14 UTC
Created attachment 267308 [details]
math/vtk9: fix build with libc++ 21
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2026-01-31 18:00:30 UTC
Approved.
Please commit it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-01-31 18:20:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1fe6f247796702372b50b08c464536586f8468c7

commit 1fe6f247796702372b50b08c464536586f8468c7
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-19 19:58:42 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-31 18:18:37 +0000

    math/vtk9: fix build with libc++ 21

    With libc++ 21, math/vtk9 fails to compile, resulting in errors similar
    to:

        In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14:
        In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11:
        /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc'
          747 |     T* p = static_cast<T*>(malloc(n * sizeof(T)));
              |                            ^~~~~~
        /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free'
          752 |   void deallocate(T* p, size_t) { free(p); }
              |                                   ^~~~

    This is because malloc and free are defined in <cstdlib>, which is not
    included in vtk's format.h. Add the include to fix the build.

    PR:             292590
    Approved by:    yuri (maintainer)
    MFH:            2026Q1

 .../files/patch-ThirdParty_fmt_vtkfmt_vtkfmt_format.h (new)    | 10 ++++++++++
 1 file changed, 10 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-01-31 18:21:26 UTC
A commit in branch 2026Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5939621f420876a9a42754970f89c418d8152de3

commit 5939621f420876a9a42754970f89c418d8152de3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-01-19 19:58:42 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2026-01-31 18:20:15 +0000

    math/vtk9: fix build with libc++ 21

    With libc++ 21, math/vtk9 fails to compile, resulting in errors similar
    to:

        In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/src/os.cc:14:
        In file included from /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/os.h:11:
        /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:747:28: error: use of undeclared identifier 'malloc'
          747 |     T* p = static_cast<T*>(malloc(n * sizeof(T)));
              |                            ^~~~~~
        /wrkdirs/usr/ports/math/vtk9/work/VTK-9.5.2/ThirdParty/fmt/vtkfmt/vtkfmt/format.h:752:35: error: use of undeclared identifier 'free'
          752 |   void deallocate(T* p, size_t) { free(p); }
              |                                   ^~~~

    This is because malloc and free are defined in <cstdlib>, which is not
    included in vtk's format.h. Add the include to fix the build.

    PR:             292590
    Approved by:    yuri (maintainer)
    MFH:            2026Q1

    (cherry picked from commit 1fe6f247796702372b50b08c464536586f8468c7)

 .../files/patch-ThirdParty_fmt_vtkfmt_vtkfmt_format.h (new)    | 10 ++++++++++
 1 file changed, 10 insertions(+)