← Back to team overview

yade-users team mailing list archive

Re: [Question #695081]: [Solved] Compilation failed on vtk8.2.0

 

Question #695081 on Yade changed:
https://answers.launchpad.net/yade/+question/695081

Summary changed to:
[Solved] Compilation failed on vtk8.2.0

Description changed to:
Update: This was solved at #9, and the answer is summerized at #10.
Below are the original posts.

--------------------------------

Sorry for my English first, it's not my mother language.
I'm trying to build yade-2021.01a from source for Archlinux (linux 5.10.7). I'm trying to complie it with most feature enabled.
But I found several problems: 
1. I'm using CMake 3.19.3. When I use
```
cmake ../trunk \
        -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DNOSUFFIX=ON -DPYTHON_VERSION=-1 \
        -DENABLE_SPH=ON   -DENABLE_PROFILING=ON  -DCHOLMOD_GPU=ON  -DENABLE_LIQMIGRATION=ON -DENABLE_MASK_ARBITRARY=ON -DENABLE_DEFORM=ON -DVECTORIZE=ON -DENABLE_OAR=ON \
        -DENABLE_MPFR=ON -DENABLE_PARTIALSAT=ON\
        -DruntimePREFIX=/usr   -DCHUNKSIZE=50 -DOpenGL_GL_PREFERENCE=GLVND\
        -DENABLE_USEFUL_ERRORS=ON -DENABLE_POTENTIAL_BLOCKS=ON
```
It said `OpenMP NOT found`. But I'm sure I have installed the openmp package. After searching it on google, I modified the `trunk/CMakeLists.txt`, added ` /usr/share/cmake-3.19//Modules/` to `CMAKE_MODULE_PATH`, then this problem was solved.


```
-- Found OpenMP_C: -fopenmp (found version "4.5") 
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_CXX)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/lib/cmake/vtk-8.2/vtkm/FindOpenMP.cmake:485 (find_package_handle_standard_args)
  CMakeLists.txt:683 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find OpenMP_CXX (missing: OpenP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_CXX_FOUND) (found version "4.5")
-- OpenMP NOT found
```

2. Then I began to compile, everything went fine at first, I noticed that most features were enabled:
```
-- Yade configured with following features: BoostLog RealHP mpmath PrecisionDouble MPFR VECTORIZE Odeint VTK OpenMP GTS GUI-Qt5 CGAL PFVFLOW PFVFLOW LINSOLV CHOLMOD_GPU MPI TWOPHASEFLOW SPH DEFORM FEMLIKE LIQMIGRATION GL2PS LBMFLOW MASK_ARBITRARY THERMAL PARTIALSAT PROFILING PotentialParticles PotentialBlocks                                            
-- Disabled features:
-- Using MAX_LOG_LEVEL=5, ENABLE_LOGGER=ON
-- Optimized build
-- C++ standard version: 17
```

However, when the compiling process went to around 47%, an error occured.
```
/tmp/makepkg/yade/src/trunk/pkg/common/Gl1_PotentialBlock.cpp:694:31: error: no matching function for call to 'vtkUnsignedCharArray::InsertNextTuple(unsigned char [3])'
  694 |    pbColors->INSERT_NEXT_TUPLE(c);
      |                               ^
In file included from /usr/include/vtk/vtkIntArray.h:33,
                 from /usr/include/vtk/vtkCellTypes.h:42,
                 from /usr/include/vtk/vtkPolyData.h:64,
                 from /tmp/makepkg/yade/src/trunk/pkg/common/Gl1_PotentialBlock.hpp:15,
                 from /tmp/makepkg/yade/src/trunk/pkg/common/Gl1_PotentialBlock.cpp:9,
                 from /tmp/makepkg/yade/src/build/pkg.0.cpp:9:
/usr/include/vtk/vtkAOSDataArrayTemplate.h:214:13: note: candidate: 'vtkIdType vtkAOSDataArrayTemplate<ValueTypeT>::InsertNextTuple(const float*) [with ValueTypeT = unsigned char; vtkIdType = long long int]'
  214 |   vtkIdType InsertNextTuple(const float *tuple) override;
      |             ^~~~~~~~~~~~~~~
/usr/include/vtk/vtkAOSDataArrayTemplate.h:214:42: note:   no known conversion for argument 1 from 'unsigned char [3]' to 'const float*'
  214 |   vtkIdType InsertNextTuple(const float *tuple) override;
      |                             ~~~~~~~~~~~~~^~~~~
/usr/include/vtk/vtkAOSDataArrayTemplate.h:215:13: note: candidate: 'vtkIdType vtkAOSDataArrayTemplate<ValueTypeT>::InsertNextTuple(const double*) [with ValueTypeT = unsigned char; vtkIdType = long long int]'
  215 |   vtkIdType InsertNextTuple(const double *tuple) override;
      |             ^~~~~~~~~~~~~~~
/usr/include/vtk/vtkAOSDataArrayTemplate.h:215:43: note:   no known conversion for argument 1 from 'unsigned char [3]' to 'const double*'
  215 |   vtkIdType InsertNextTuple(const double *tuple) override;
      |                             ~~~~~~~~~~~~~~^~~~~
/usr/include/vtk/vtkAOSDataArrayTemplate.h:218:13: note: candidate: 'vtkIdType vtkAOSDataArrayTemplate<ValueTypeT>::InsertNextTuple(vtkIdType, vtkAbstractArray*) [with ValueTypeT = unsigned char; vtkIdType = long long int]'
  218 |   vtkIdType InsertNextTuple(vtkIdType srcTupleIdx,
      |             ^~~~~~~~~~~~~~~
/usr/include/vtk/vtkAOSDataArrayTemplate.h:218:13: note:   candidate expects 2 arguments, 1 provided
```
I guess it is because of vtk8.2.0, `InsertNextTuple` expects 2 arguments, but the line in `trunk/pkg/common/Gl1_PotentialBlock.cpp:694:31:` only provides 1 (and other lines use this function), 
```
  694 |    pbColors->INSERT_NEXT_TUPLE(c);
```
But I don't know how to fix it. 
Do you have any suggestions? 
Thanks a lot!

Attachments:
1. PKGBUILD used to create yade package:
https://pastebin.pl/view/2c9387dc
2. make log
https://pastebin.pl/view/763f67f8

Other information that maybe helpful:
```
gcc 10.2.0-4
vtk 8.2.0-17
cmake 3.19.3-1
linux 5.10.8.arch1-1
```

You received this question notification because your team yade-users is
an answer contact for Yade.