# Name mangling for the Eigen library

**URL:** https://discourse.itk.org/t/name-mangling-for-the-eigen-library/5562
**Category:** Engineering
**Created:** [December 9, 2022, 4:17pm UTC](https://discourse.itk.org/t/name-mangling-for-the-eigen-library/5562 "2022-12-09T16:17:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Fijoy\_Vadakkumpadan](https://discourse.itk.org/user_avatar/discourse.itk.org/fijoy_vadakkumpadan/32/1287_2.png) [@Fijoy\_Vadakkumpadan](https://discourse.itk.org/u/Fijoy_Vadakkumpadan)
#### Post date: [December 9, 2022, 4:17pm UTC](https://discourse.itk.org/t/name-mangling-for-the-eigen-library/5562/1 "2022-12-09T16:17:01Z")

</div>

Does ITK mangle the symbols in the Eigen 3rd party library it includes?

The initial paragraph in this file states that it does the mangling to avoid conflicts with other copies of the Eigen library in the same process:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/Eigen3/src/itkeigen/README.kitware.md>

but the bullet points do not explicitly state how the mangling is done.

I see references to an “itkeigen” namespace in a comment in the the raw view of the above README, and also elsewhere:  
[https://gitlab.kitware.com/phcerdan/eigen/-/blob/for/itk\_backup/README.kitware.md](https://gitlab.kitware.com/phcerdan/eigen/-/blob/for/itk_backup/README.kitware.md)

Can anyone confirm that ITK does the mangling for the Eigen library?

Thanks.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [December 9, 2022, 4:33pm UTC](https://discourse.itk.org/t/name-mangling-for-the-eigen-library/5562/2 "2022-12-09T16:33:52Z")

</div>

@phcerdan could best answer this.

---

<div class="post-metadata">

### Author: ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)
#### Post date: [January 9, 2023, 9:51am UTC](https://discourse.itk.org/t/name-mangling-for-the-eigen-library/5562/3 "2023-01-09T09:51:04Z")

</div>

> [@Fijoy\_Vadakkumpadan](#):
>
> Can anyone confirm that ITK does the mangling for the Eigen library?

It doesn’t. Eigen is a header only library and it wasn’t mangled to facilitate bridging with external libraries using native Eigen.

If you are using your own Eigen for your application, you can share it with ITK building with `ITK_USE_SYSTEM_EIGEN:BOOL=ON` and pointing to your desired Eigen with the `CMake` option: `Eigen3_DIR:PATH`

Hope it helps.
