# FindMEMKIND.cmake support

**URL:** <https://discourse.vtk.org/t/findmemkind-cmake-support/8524>\
**Category:** Development\
**Created:** [May 18, 2022, 6:23pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524 "2022-05-18T18:23:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiapei100](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiapei100/32/157_2.png) [@jiapei100](https://discourse.vtk.org/u/jiapei100)\
**Post date:** [May 18, 2022, 6:23pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/1 "2022-05-18T18:23:52Z")

</div>

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](https://github.com/memkind/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

---

<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:** [May 18, 2022, 6:41pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/2 "2022-05-18T18:41:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jiapei100](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jiapei100/32/157_2.png) [@jiapei100](https://discourse.vtk.org/u/jiapei100)\
**Post date:** [May 18, 2022, 8:49pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/3 "2022-05-18T20:49:58Z")

</div>

Hi, @ben.boeckel

Yes, I did meet some **ERROR** s 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** :

```nohighlight
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** :

```nohighlight
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?

---

<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:** [May 19, 2022, 11:44am UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/4 "2022-05-19T11:44:35Z")

</div>

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](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9203) which fixed some other things I noticed when first looking at this.

---

<div class="post-metadata">

**Author:** ![Dave\_DeMarle](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dave_demarle/32/6_2.png) [@Dave\_DeMarle](https://discourse.vtk.org/u/Dave_DeMarle)\
**Post date:** [May 19, 2022, 1:17pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/5 "2022-05-19T13:17:20Z")

</div>

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!

---

<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:** [May 19, 2022, 4:09pm UTC](https://discourse.vtk.org/t/findmemkind-cmake-support/8524/6 "2022-05-19T16:09:04Z")

</div>

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.
