FindMEMKIND.cmake support

Hi, all:

  1. I happened to realize it’s NOT quite convenient to build VTK from source WITHOUT memkind. So, I enabled memkind VTK_USE_MEMKIND ON.

However, default repository of Ubuntu 22.04, or from source of memkind, there is NO support for CMake build. I mean, it seems there would be NO MEMKIND_DIR .

  1. Furthermore, when I tried to build PCL based on VTK, it’s NOT able to find MEMKIND::MEMKIND

So… any suggestions?

Cheers

Right, instead FindMEMKIND is used. Is there some reason why it doesn’t work for you? Do you have any error messages?

Hi, @ben.boeckel

Yes, I did meet some ERRORs when I tried to build PCL:

  1. For PCL
    During Configuration, I set
    MEMKIND_DIR MEMKIND_DIR-NOTFOUND

But, when I tried to configure, I got warning:

CMake Warning at /usr/local/lib/cmake/vtk-9.1/VTK-vtk-module-find-packages.cmake:574 (find_package):
   By not providing "FindMEMKIND.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "MEMKIND", but
   CMake did not find one.

   Could not find a package configuration file provided by "MEMKIND" with any
   of the following names:

     MEMKINDConfig.cmake
     memkind-config.cmake

   Add the installation prefix of "MEMKIND" to CMAKE_PREFIX_PATH or set
   "MEMKIND_DIR" to a directory containing one of the above files.  If
   "MEMKIND" provides a separate development package or SDK, be sure it has
   been installed.
 Call Stack (most recent call first):
   /usr/local/lib/cmake/vtk-9.1/vtk-config.cmake:150 (include)
   cmake/pcl_find_vtk.cmake:25 (find_package)
   CMakeLists.txt:390 (include)

 Could not find the VTK package due to a missing dependency: MEMKIND
  1. For FreeCAD

Almost the same, but configure gave me an ERROR:

CMake Error at /usr/local/lib/cmake/vtk-9.1/VTK-vtk-module-find-packages.cmake:574 (find_package):
   By not providing "FindMEMKIND.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "MEMKIND", but
   CMake did not find one.

   Could not find a package configuration file provided by "MEMKIND" with any
   of the following names:

     MEMKINDConfig.cmake
     memkind-config.cmake

   Add the installation prefix of "MEMKIND" to CMAKE_PREFIX_PATH or set
   "MEMKIND_DIR" to a directory containing one of the above files.  If
   "MEMKIND" provides a separate development package or SDK, be sure it has
   been installed.
 Call Stack (most recent call first):
   /usr/local/lib/cmake/vtk-9.1/vtk-config.cmake:150 (include)
   cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:29 (find_package)
   CMakeLists.txt:58 (SetupSalomeSMESH)

 Configuring incomplete, errors occurred!

So, any further suggestions?

Ah ha! The FindMEMKIND module needs installed. I’ll fix that. Thanks for the report.

Added to https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9203 which fixed some other things I noticed when first looking at this.

1 Like

I am curious why it is hard to build VTK without memkind? It should be optional.

If there are users of that feature in VTK it would be great to hear about it!

I build it without memkind all the time. It seems you did build it with memkind. If that’s the case, just about everything will also need to know because CommonCore requires it.