# How to Compile PV 5.9 with OSPRay Material Library Loaded

**URL:** https://discourse.paraview.org/t/how-to-compile-pv-5-9-with-ospray-material-library-loaded/6362
**Category:** ParaView Support
**Created:** [February 1, 2021, 4:52pm UTC](https://discourse.paraview.org/t/how-to-compile-pv-5-9-with-ospray-material-library-loaded/6362 "2021-02-01T16:52:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mconti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mconti/32/2168_2.png) [@mconti](https://discourse.paraview.org/u/mconti)
#### Post date: [February 1, 2021, 4:52pm UTC](https://discourse.paraview.org/t/how-to-compile-pv-5-9-with-ospray-material-library-loaded/6362/1 "2021-02-01T16:52:15Z")

</div>

Hey there, anyone know the CMake commands to compile 5.9 with the OSPRay material library loaded by default?

This is the branch I need to include.

[https://gitlab.kitware.com/paraview/materials](https://gitlab.kitware.com/paraview/materials)

In the precompiled super build it comes preloaded but we are having issues compiling it in ourselves.

Thanks

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [February 1, 2021, 6:31pm UTC](https://discourse.paraview.org/t/how-to-compile-pv-5-9-with-ospray-material-library-loaded/6362/2 "2021-02-01T18:31:27Z")

</div>

You shouldn’t have to compile it specially per se, just put the specific material library you want in the right place for the ParaView client side binary to find and load it at startup.

As to what the right place is, it is either whatever the environment variable PV\_MATERIALS\_PATH says, or if not there then “near” the client executable paraview.exe. The exact definition of “near” is depends on the Operating system. See  
[https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Views/vtkPVMaterialLibrary.cxx#L42](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Views/vtkPVMaterialLibrary.cxx#L42)

hth

---

<div class="post-metadata">

### Author: ![mconti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mconti/32/2168_2.png) [@mconti](https://discourse.paraview.org/u/mconti)
#### Post date: [February 1, 2021, 6:33pm UTC](https://discourse.paraview.org/t/how-to-compile-pv-5-9-with-ospray-material-library-loaded/6362/3 "2021-02-01T18:33:40Z")

</div>

Perfect, that helps a lot Dave. I had put it in the correct folder structure but didn’t have the env path loaded.

Thanks,
