# How to specify libhdf5 location while building Paraview5.8.1 (DeskTop) in Ubuntu 18.04?

**URL:** https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707
**Category:** ParaView Support
**Tags:** vtk
**Created:** [July 28, 2021, 4:47am UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707 "2021-07-28T04:47:58Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [July 28, 2021, 4:47am UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/1 "2021-07-28T04:47:58Z")

</div>

Dear All,

Greetings… This is my first post seeking help in creating Plugin .so object. My issue is as follows:

1. I am in Ubuntu 18.04 and have built the HDF5 library (in particular libhdf5.so) in ~/hdf5\_build/CMake- hdf5-1.10.1/HDF\_Group/HDF5/1.10.1/lib/
2. I have exported this path in the terminal before building the paraview from source (5.8.1)
3. My cmake options (in command line at the appropriate directory) are

```auto
cmake -GNinja -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -CMAKE_BUILD_TYPE=Release ..
ninja

```

1. The Reader Plugin is pasted in Plugin directory of the cloned folder before building paraview.
2. However, after repeated trials, I could not generate the PlugIn.so object to be load by using Manage Plug-in Menu.
3. I suspect it is a hdf5 issue. But trials with options such as

```auto
-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON -D-DHDF5_DIR:PATH=~/hdf5_build/CMake-hdf5-1.10.1/HDF_Group/HDF5/1.10.1/lib/

```

did not succeed.

I request your advice on the matter. Please note that I am new to cmake and ninja tools.

Thanks in advance.

With Best regards

Sukumar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 2, 2021, 7:58am UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/2 "2021-08-02T07:58:31Z")

</div>

Are you building ParaView or a Plugin ? What is not working ?

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 2, 2021, 2:35pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/3 "2021-08-02T14:35:24Z")

</div>

Thanks a lot for your reply.

I am building both Paraview and Plugin. The Paraview binary is created and appears to be working fine. However, I am unable to create the .so file for the Plugin.  
Any advice will be highly appreciated. Kindly let me know If more details are necessary.

Best regards.

Sukumar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 2, 2021, 2:48pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/4 "2021-08-02T14:48:53Z")

</div>

Can you try building any plugin within Examples/Plugin directory ?

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 2, 2021, 3:37pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/5 "2021-08-02T15:37:12Z")

</div>

I never tried. But the plugins which are already part of Paraview such as “PanaromicProjectionView” etc were built and there exists the corresponding .so file.

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 2, 2021, 4:01pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/6 "2021-08-02T16:01:43Z")

</div>

It may be very naive to ask, but being totally new to Paraview building process, I thought that Plugins will be built automatically while Paraview is being built !

Please advise me how to build the Plugin separately, after/during compiling/building Paraview.

Best regards.  
Sukumar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 3, 2021, 7:41am UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/7 "2021-08-03T07:41:41Z")

</div>

> [@sb1966](#):
>
> I thought that Plugins will be built automatically while Paraview is being built !

Plugins are, Examples Plugins aren’t.

What are you trying to achieve here ?

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 3, 2021, 12:39pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/8 "2021-08-03T12:39:06Z")

</div>

Dear Mathieu,  
Thanks for your support.

> [@mwestphal](#):
>
> > [@sb1966](#):
> >
> > I thought that Plugins will be built automatically while Paraview is being built !
> 
> Plugins are, Examples Plugins aren’t.
> 
> What are you trying to achieve here ?

In fact I am trying to create the **.so file** for a Plugin supplied with a free Finite Element Software.

A.) The content of the Plugin folder (named as PluginRoot here for explanation) are as follows:

1. pluginRoot/CMakeLists.txt; pluginRoot/Tools (folder); PluginRoot/Plugin(folder)
2. pluginRoot/Plugin/CMakeLists.txt; pluginRoot/Plugin/paraview.plugin; pluginRoot/Plugin/Reader/CMakeLists.txt; pluginRoot/Plugin/Reader/readerName.xml; pluginRoot/Plugin/Reader/vtkreaderName.cxx; pluginRoot/Plugin/Reader/vtkreaderName.h; pluginRoot/Plugin/Reader/vtk.module
3. pluginRoot/Tools/

B) The PluginRoot folder was copied into paraviewSource/Plugin/ folder before compiling paraview.  
C) It was supposed to generate the .so file in ~/paraview/paraview\_build//lib/paraview-5.8/plugins/pluginName/pluginName.so;  
D) However, the pluginName folder nor the .so file is generated.  
E) Please advise if any additional build step is needed .

Best regards  
Sukumar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 3, 2021, 12:40pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/9 "2021-08-03T12:40:09Z")

</div>

> [@sb1966](#):
>
> The PluginRoot folder was copied into paraviewSource/Plugin/ folder before compiling paraview.

Do not do that, build your plugin independently.

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 3, 2021, 12:41pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/10 "2021-08-03T12:41:46Z")

</div>

Would you kindly tell me how to do that! I am inexperienced totally.  
Regards.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 3, 2021, 12:43pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/11 "2021-08-03T12:43:32Z")

</div>

```auto
cd pluginRoot
mkdir build
cd build
ccmake ../
*configure ParaView_DIR to point to your build directory of ParaView*
make

```

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 3, 2021, 12:45pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/12 "2021-08-03T12:45:46Z")

</div>

Thank you very much. Would you also please guide me how to configure PARAVIEW\_DIR to point to paraview\_build ? Sorry to bother you so much.

Regards.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 3, 2021, 1:04pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/13 "2021-08-03T13:04:19Z")

</div>

just use cmake, ccmake or cmake-gui to set the paraview dir to the repository of your build.

Search for “set cmake variable”.

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 3, 2021, 1:07pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/14 "2021-08-03T13:07:46Z")

</div>

Thank you very much…  
I will try these steps and let you know the outcome.

With Best regards

Sukumar

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 4, 2021, 4:27pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/15 "2021-08-04T16:27:05Z")

</div>

Dear @mwestphal Mathieu,

Let me express my sincere gratitude for guiding me to build the Plugin library.  
Of course I had to adopt an overkill, i.e. changing my distribution to Ubuntu 20.04. This is due to my problem of installing libhdf5-dev from Ubuntu repository in Ubuntu 18.04LTS.

Now in Ubuntu20.04LTS, I first built paraview binary and then built the PlugIn after installing cmake and ccmake. Here I am writing my steps which may help some one trying to install some custom plugin.  
Note that I am describing the folder I cloned paraview in as “paraview\_clone” r and my paraview buid directory is “paraview\_clone//paraview\_build”. The custom plugin was a copied to “paraview\_clone/Plugins/PluginName” folder.  
My steps are:

- Build paraview in “paraview\_clone/paraview\_build” as usual

```auto
cd ../paraview_build
cmake -GNinja -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_USE_MPI=ON -DVTK_SMP_IMPLEMENTATION_TYPE=TBB -DCMAKE_BUILD_TYPE=Release ..
ninja

```

- This creates paraview binary at …/paraview\_build/bin folder.
- Next step is

```auto
cd '../PluginName'
mkdir build
cd build
ccmake -DParaView_DIR=/home/sukumar/paraview/paraview_build ../
make

```

- The `' ccmake...'` above This will invoke cmake-gui where configure options are shown. Edit the BUILD\_TYPE as Release and press g to generate the configure file, and exit the cmake-gui
- This will create the `PluginName.so` file at ` ../PluginName/build/lib/PluginName/`

Hope this would help some-one new to cmake/ccmake tools like me.

Warm Regards and thanks @mwestphal once again for supporting a beginner like me with compassion.

Sukumar

---

<div class="post-metadata">

### Author: ![sb1966](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sb1966/32/7277_2.png) [@sb1966](https://discourse.paraview.org/u/sb1966)
#### Post date: [August 4, 2021, 5:58pm UTC](https://discourse.paraview.org/t/how-to-specify-libhdf5-location-while-building-paraview5-8-1-desktop-in-ubuntu-18-04/7707/16 "2021-08-04T17:58:11Z")

</div>

Dear all,

1. In my last post, the following was used to configure the plugin library.

```auto
ccmake -DParaView_DIR=/home/sukumar/paraview/paraview_build ../

```

2.Instead of ccmake in the above command to generate make file, simple command line procedure to generate ninja build file is

```auto
cmake -GNinja -DParaView_DIR=/home/sukumar/paraview/paraview_build ../
ninja

```

Hope this helps some one.

Best regards.  
Sukumar
