# make Error 2 when installing VTK

**URL:** https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663
**Category:** Support
**Tags:** code
**Created:** [April 3, 2024, 2:12am UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663 "2024-04-03T02:12:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Bhuang](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@Bhuang](https://discourse.vtk.org/u/Bhuang)
#### Post date: [April 3, 2024, 2:12am UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/1 "2024-04-03T02:12:59Z")

</div>

Hi! I have been trying to install VTK on my macbook via the code snippet:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d3ca63cb651159a21309f7ec02434bcea12a27de.png)  
However, I run into a make error  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/ac39281cea077a8579b66d880fa76a1eb6b3e55f.png)  
Can someone please help me in resolving this error?  
Thank you!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 3, 2024, 8:09am UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/2 "2024-04-03T08:09:47Z")

</div>

How about including the actual error in your post or screenshot 🙂 ?

You may want to use the last release of VTK though, VTK v9.3.0

---

<div class="post-metadata">

### Author: ![Bhuang](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@Bhuang](https://discourse.vtk.org/u/Bhuang)
#### Post date: [April 3, 2024, 10:43am UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/3 "2024-04-03T10:43:05Z")

</div>

Thank you so much! using VTK v9.3.0 successfully resolved this error and got me to the point of installation. However, it raised this error message:  
Install the project…  
– Install configuration: “Debug”  
CMake Error at Wrapping/Tools/cmake\_install.cmake:41 (file):  
file cannot create directory: /include/vtk-9.3. Maybe need administrative  
privileges.  
Call Stack (most recent call first):  
cmake\_install.cmake:42 (include)  
make: \*\*\* [install] Error 1  
This is the output before the error message:  
[100%] Built target FiltersPoints  
[100%] Built target vtkFiltersPoints-hierarchy  
[100%] Built target FiltersParallelImaging  
[100%] Built target vtkFiltersParallelImaging-hierarchy  
[100%] Built target FiltersGeometryPreview  
[100%] Built target vtkFiltersGeometryPreview-hierarchy  
[100%] Built target FiltersGeneric  
[100%] Built target vtkFiltersGeneric-hierarchy  
[100%] Built target FiltersFlowPaths  
[100%] Built target vtkFiltersFlowPaths-hierarchy  
[100%] Built target DomainsChemistryOpenGL2  
[100%] Built target vtkDomainsChemistryOpenGL2-hierarchy  
Could you please kindly guide me through how to resolve it?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 3, 2024, 12:26pm UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/4 "2024-04-03T12:26:06Z")

</div>

> [@Bhuang](#):
>
> file cannot create directory: /include/vtk-9.3. Maybe need administrative  
> privileges.

You are currently trying to install system wide, is this really what you want to do ?

---

<div class="post-metadata">

### Author: ![Bhuang](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@Bhuang](https://discourse.vtk.org/u/Bhuang)
#### Post date: [April 3, 2024, 12:48pm UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/5 "2024-04-03T12:48:13Z")

</div>

I am following the manual VTK installation instruction given by CHASTE (a C++ program) as it is one of the dependencies. The code I am running is taken from their tutorial page with the version changed to 9.3. Here is the code I am running:  
wget [https://www.vtk.org/files/release/9.1/VTK-9.1.0.tar.gz](https://www.vtk.org/files/release/9.1/VTK-9.1.0.tar.gz)  
tar -zxf VTK-9.1.0.tar.gz  
mkdir build\_VTK-9.1.0 && cd build\_VTK-9.1.0  
cmake -DCMAKE\_INSTALL\_PREFIX=$CHASTE\_LIBS …/VTK-9.1.0 && make -j4 && make install  
cd …  
rm -rf build\_VTK-9.1.0 VTK-9.1.0 VTK-9.1.0.tar.gz

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 3, 2024, 12:50pm UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/6 "2024-04-03T12:50:47Z")

</div>

> [@Bhuang](#):
>
> $CHASTE\_LIBS

is that defined somewhere ?

> I am following the manual VTK installation instruction given by CHASTE (a C++ program) as it is one of the dependencies.

Link ?

---

<div class="post-metadata">

### Author: ![Bhuang](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/7cd45c/32.png) [@Bhuang](https://discourse.vtk.org/u/Bhuang)
#### Post date: [April 3, 2024, 12:53pm UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/7 "2024-04-03T12:53:20Z")

</div>

Yes, there are previous steps where CHASTE\_LIBS is defined. Here is the link: [Developer Install Guide | Chaste](https://chaste.github.io/docs/dev-guides/developer-install-guide/)  
I am running the code on a Macbook in VScode.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [April 3, 2024, 12:54pm UTC](https://discourse.vtk.org/t/make-error-2-when-installing-vtk/13663/8 "2024-04-03T12:54:44Z")

</div>

Make sure it is set, because it looks like it is empty right now.
