# Cmake error in vtkeigen when building from source

**URL:** https://discourse.vtk.org/t/cmake-error-in-vtkeigen-when-building-from-source/2451
**Category:** Support
**Created:** [January 18, 2020, 7:31pm UTC](https://discourse.vtk.org/t/cmake-error-in-vtkeigen-when-building-from-source/2451 "2020-01-18T19:31:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Patrick\_Mineault](https://discourse.vtk.org/user_avatar/discourse.vtk.org/patrick_mineault/32/1270_2.png) [@Patrick\_Mineault](https://discourse.vtk.org/u/Patrick_Mineault)
#### Post date: [January 18, 2020, 7:31pm UTC](https://discourse.vtk.org/t/cmake-error-in-vtkeigen-when-building-from-source/2451/1 "2020-01-18T19:31:13Z")

</div>

I’m trying to build vtk from source on Ubuntu since I’m having [trouble accessing vtkXdmfReader in pre-built libraries](https://discourse.vtk.org/t/vtkxdmfreader-not-working-in-python-on-ubuntu/2450). Following the instructions here: [https://vtk.org/Wiki/VTK/Building/Linux](https://vtk.org/Wiki/VTK/Building/Linux), when running this series of commands from my home directory:

```
mkdir VTK-Release-build
cd VTK-Release-build
cmake -DCMAKE_BUILD_TYPE:STRING=Release ../VTK

```

I get the error:

```
CMake Error at ThirdParty/eigen/vtkeigen/CMakeLists.txt:10 (message):
  In-source builds not allowed. Please make a new directory (called a build
  directory) and run CMake from there. You may need to remove
  CMakeCache.txt.

```

As you can see, however, my source and release directories are distinct. What am I missing?

---

<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: [March 16, 2020, 3:38pm UTC](https://discourse.vtk.org/t/cmake-error-in-vtkeigen-when-building-from-source/2451/2 "2020-03-16T15:38:45Z")

</div>

Eigen is detecting under-source as in-source as well. I don’t know if that’s actually true, but I don’t think it’s there for no reason. The new build instructions live [here](https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/build.md) though it makes no mention of directory structure requirements. I’ll add that.

---

<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: [March 16, 2020, 3:44pm UTC](https://discourse.vtk.org/t/cmake-error-in-vtkeigen-when-building-from-source/2451/3 "2020-03-16T15:44:11Z")

</div>

Looking at the logic, I don’t know why it is detecting that you have an overlapping build tree. Does your source tree have a `CMakeCache.txt` in it? If so, CMake is detecting your command as a reconfigure given an existing build tree rather than a request for a new build tree pointing to a source tree. I recommend cleaning your source tree and then retrying.
