# VTK-7.1.1 can't build from Ubuntu 22.04.1 LTS(aarch64)

**URL:** https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381
**Category:** Support
**Tags:** code
**Created:** [January 4, 2023, 11:38am UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381 "2023-01-04T11:38:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Liusd123456](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/3be4f8/32.png) [@Liusd123456](https://discourse.vtk.org/u/Liusd123456)
#### Post date: [January 4, 2023, 11:38am UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/1 "2023-01-04T11:38:14Z")

</div>

hi,  
environment:Ubuntu 22.04.1 LTS(aarch64),GNU Make 4.3(aarch64-unknown-linux-gnu), gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0.

make report errors:  
[33%] Linking CXX shared library …/…/lib/libvtkCommonSystem-7.1.so  
[33%] Building C object ThirdParty/exodusII/vtkexodusII/CMakeFiles/vtkexoIIc.dir/expmap.c.o  
[33%] Building C object ThirdParty/exodusII/vtkexodusII/CMakeFiles/vtkexoIIc.dir/expmp.c.o  
/usr/bin/ld: CMakeFiles/vtkCommonSystem.dir/vtkClientSocket.cxx.o: in function `vtkClientSocket::New()': /home/casun/tmp/VTK-7.1.1/Common/System/vtkClientSocket.cxx:19: undefined reference to `vtkObjectBase::InitializeObjectBase()’  
/usr/bin/ld: CMakeFiles/vtkCommonSystem.dir/vtkClientSocket.cxx.o: in function `vtkClientSocket::ConnectToServer(char const*, int)': /home/casun/tmp/VTK-7.1.1/Common/System/vtkClientSocket.cxx:36: undefined reference to `vtkObject::GetGlobalWarningDisplay()’  
…  
/usr/bin/ld: CMakeFiles/vtkCommonMath.dir/vtkRungeKutta45.cxx.o:(.data.rel.ro.\_ZTV15vtkRungeKutta45[\_ZTV15vtkRungeKutta45]+0x98): undefined reference to `vtkObject::DebugOff()' /usr/bin/ld: CMakeFiles/vtkCommonMath.dir/vtkRungeKutta45.cxx.o:(.data.rel.ro._ZTV15vtkRungeKutta45[_ZTV15vtkRungeKutta45]+0xa0): undefined reference to `vtkObject::Modified()’  
/usr/bin/ld: CMakeFiles/vtkCommonMath.dir/vtkRungeKutta45.cxx.o:(.data.rel.ro.\_ZTV15vtkRungeKutta45[\_ZTV15vtkRungeKutta45]+0xa8): undefined reference to `vtkObject::GetMTime()’  
[34%] Building C object ThirdParty/exodusII/vtkexodusII/CMakeFiles/vtkexoIIc.dir/expss.c.o  
collect2: error: ld returned 1 exit status  
make[2]: \*\*\* [Common/Math/CMakeFiles/vtkCommonMath.dir/build.make:242：lib/libvtkCommonMath-7.1.so.1] 错误 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:2769：Common/Math/CMakeFiles/vtkCommonMath.dir/all] 错误 2

Another Ubuntu 20(aarch64),GNU Make 4.2.(aarch64-unknown-linux-gnu), gcc (Ubuntu 9.4.0-19ubuntu1) 9.4.0 is OK.  
But this show problem now.  
How to do it, can i get some hints or VTK-7.1.1 is not surported on Ubuntu 22.04.1 LTS

Thanks a lot.

---

<div class="post-metadata">

### Author: ![Liusd123456](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/3be4f8/32.png) [@Liusd123456](https://discourse.vtk.org/u/Liusd123456)
#### Post date: [January 4, 2023, 12:08pm UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/2 "2023-01-04T12:08:39Z")

</div>

supplement: cmake -DVTK\_QT\_VERSION:STRING=5 -DQT\_QMAKE\_EXECUTABLE:PATH=/usr/lib/qt5/bin/qmake -DVTK\_Group\_Qt:BOOL=ON -DBUILD\_SHARED\_LIBS:BOOL=ON …  
is ok.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [January 4, 2023, 4:54pm UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/3 "2023-01-04T16:54:41Z")

</div>

I’m surprised VTK 7 got that far myself. It’s certainly not supported by VTK developers anymore. Is there a reason you can’t use VTK 9?

---

<div class="post-metadata">

### Author: ![Liusd123456](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/3be4f8/32.png) [@Liusd123456](https://discourse.vtk.org/u/Liusd123456)
#### Post date: [January 5, 2023, 12:54am UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/4 "2023-01-05T00:54:53Z")

</div>

You know, in order to maintain the old version program, reducing the work load. VTK 8.2 is same problem.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 6, 2023, 5:32am UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/5 "2023-01-06T05:32:17Z")

</div>

I’m in the same boat, I’ve got a few apps comprised of tens of thousands of lines of code that are based on VTK 7. For these legacy apps that only require VTK’s old functionalities, upgrading to a newer VTK requires a lot of work for no benefit, in fact even recompiling these apps is a rare occurrence. Rebuilds and upgrades of legacy apps occur only when necessary, because generally I’ve got better things to spend my time on.

For legacy code, I just keep old systems/toolchains around. For Linux I have an older ubuntu installed in a separate root partition, and I chroot the older root before running “make”. Docker can be used similarly. Directories can be shared between the docker/chroot and the main system. Executables compiled with old toolchains generally run fine on newer systems, particularly for VTK since nearly all of its library dependencies are built-in.

---

<div class="post-metadata">

### Author: ![mrbachmann](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mrbachmann/32/8976_2.png) [@mrbachmann](https://discourse.vtk.org/u/mrbachmann)
#### Post date: [June 18, 2024, 4:41pm UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/6 "2024-06-18T16:41:27Z")

</div>

The problem originates in regex for getting the compiler version from the output of `gcc --version`.

In case the major compiler version has more than one digit (\>= 10) the macro `_vtk_test_compiler_hidden_visibility`  
which is defined in:  
`VTK-7.1.1/CMake/VTKGenerateExportHeader.cmake`  
does not work as expected.

You can give the following patch for VTK 7.1.1 a try:

```auto
diff -ruN VTK-7.1.1.orig/CMake/VTKGenerateExportHeader.cmake VTK-7.1.1/CMake/VTKGenerateExportHeader.cmake
--- VTK-7.1.1.orig/CMake/VTKGenerateExportHeader.cmake 2024-06-18 18:29:12.865503100 +0200
+++ VTK-7.1.1/CMake/VTKGenerateExportHeader.cmake 2024-06-18 18:30:39.409137800 +0200
@@ -174,7 +174,7 @@
     execute_process(COMMAND ${CMAKE_C_COMPILER} --version
       OUTPUT_VARIABLE _gcc_version_info
       ERROR_VARIABLE _gcc_version_info)
- string(REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*"
+ string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*"
       _gcc_version "${_gcc_version_info}")
     # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
     # patch level, handle this here:

```

---

<div class="post-metadata">

### Author: ![georges\_abitbol](https://discourse.vtk.org/user_avatar/discourse.vtk.org/georges_abitbol/32/9835_2.png) [@georges\_abitbol](https://discourse.vtk.org/u/georges_abitbol)
#### Post date: [March 3, 2025, 2:56pm UTC](https://discourse.vtk.org/t/vtk-7-1-1-cant-build-from-ubuntu-22-04-1-lts-aarch64/10381/7 "2025-03-03T14:56:42Z")

</div>

Thank you @mrbachmann I had the same linkage problem and this solved the issue.  
Using gcc 11.5 on rocky 9 there are a few other compilation issues but nothing unfixable.

Thanks again
