enGits / engrid

ENGRID is a mesh generation software with CFD applications in mind. It supports automatic prismatic boundary layer grids for Navier-Stokes simulations and has a Qt based GUI.
Other
146 stars 55 forks source link

Build fails with VTK 6.3 RC2 #55

Closed opoplawski closed 9 years ago

opoplawski commented 9 years ago

Testing building engrid git baef0ce against VTK 6.3 RC2 I get:

[100%] Linking CXX executable engrid
libengrid/liblibengrid.so.2.0.0: undefined reference to `vtkRenderingFreeTypeOpenGL_AutoInit_Destruct()'
libengrid/liblibengrid.so.2.0.0: undefined reference to `vtkRenderingFreeTypeOpenGL_AutoInit_Construct()'
collect2: error: ld returned 1 exit status

According to http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines there is a new macro for this in 6.1+. This patch:

diff -up engrid-baef0cebdebbe59cf77aea5ecef5d92a36fac20f/src/libengrid/engrid.h.vtk engrid-baef0cebdebbe59cf77aea5ecef5d92a36fac20f/src/libengrid/engrid.h
--- engrid-baef0cebdebbe59cf77aea5ecef5d92a36fac20f/src/libengrid/engrid.h.vtk  2015-03-17 13:09:35.000000000 -0600
+++ engrid-baef0cebdebbe59cf77aea5ecef5d92a36fac20f/src/libengrid/engrid.h      2015-09-09 10:54:15.150431443 -0600
@@ -21,13 +21,13 @@
 #ifndef engrid_H
 #define engrid_H

-#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
-
 #include <QMessageBox>
 #include <QtDebug>
 #include <QString>
 #include <QDate>

+#include <vtkAutoInit.h>
+VTK_MODULE_INIT(vtkRenderingOpenGL);
 #include <vtkSmartPointer.h>
 #include <vtkLongArray.h>
 #include <vtkLongLongArray.h>

switches to it. I don't know if you still want to support VTK 6.0 or not. In that case some kind of ifdef will need to be worked out.

ftpronk commented 9 years ago

Dear Orion,

Thank you for the update. Unfortunately we do not have the resources to look at this problem immediately, so if this requires a more in-depth fix, it might take a few weeks before we can solve it..

However, I took the time to look at the link you added to your post, and it states that the error should not occur with CMake, if the CMakeLists files are set up with the correct find_package and include statements. Checking the current CMakeLists files provided with the latest release of enGrid, confirms that we have (for vtk..) the correct parameters. Are you using CMake for your builds, or are you using the build scripts? If you are, then this issue might be more complex to solve..

Kind regards, F.

opoplawski commented 9 years ago

Sorry for not responding earlier, I don't think got notification of your response. I'm not sure you're reading the link correctly. The vtkRenderingCore_AUTOINIT is only for pre 6.1. For 6.1+ you need to use VTK_MODULE_INIT.

ftpronk commented 9 years ago

Yes, I partially misread the link. Our CMakeLists.txt already had the include(${VTK_USE_FILE}), which should have avoided the problem altogether. But I overlooked the now redundant vtkRenderingCore_AUTOINIT definition. It has been commented out. As we are using CMake, the VTK_MODULE_INIT call is not needed either, making an ifdef construction redundant.

The fix has been tested with vtk 6.0, 6.1 and 6.3 and enGrid compiled without issues.

Please let us know if you encounter any further problems.

Kind regards, F.