# unable to link mpi to paraview

**URL:** https://discourse.paraview.org/t/unable-to-link-mpi-to-paraview/8125
**Category:** ParaView Support
**Created:** [October 5, 2021, 1:37am UTC](https://discourse.paraview.org/t/unable-to-link-mpi-to-paraview/8125 "2021-10-05T01:37:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![marco](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@marco](https://discourse.paraview.org/u/marco)
#### Post date: [October 5, 2021, 1:37am UTC](https://discourse.paraview.org/t/unable-to-link-mpi-to-paraview/8125/1 "2021-10-05T01:37:47Z")

</div>

I have -DPARAVIEW\_USE\_MPI=ON in my cmake invocation but when I build with Ninja I get:  
Is there a switch to specify location to search for libraries?

[19300/19499] Linking CXX executable bin/pvtkpython FAILED: bin/pvtkpython  
: && /usr/bin/c++ -O3 -DNDEBUG -Wl,-lc -Wl,-lc -Wl,–no-as-needed -Wl,–unresolved-symbols=ignore-in-shared-libs VTK/Wrapping/Python/CMakeFiles/pvtkpython.dir/vtkPythonAppInit.cxx.o -o bin/pvtkpython -Wl,-rpath,"$ORIGIN/…/lib64:/usr/local/tools/Anaconda3-2021-05/lib" lib64/libvtkWrappingPythonCore3.8-pv5.9.so.5.9 lib64/libvtkPythonInterpreter-pv5.9.so.5.9 lib64/libvtkParallelMPI-pv5.9.so.5.9 /usr/local/tools/Anaconda3-2021-05/lib/libpython3.8.so lib64/libvtkParallelCore-pv5.9.so.5.9 lib64/libvtkCommonCore-pv5.9.so.5.9 lib64/libvtksys-pv5.9.so.5.9 -ldl -Wl,-rpath-link,/home/ma/ParaView-v5.9.1/build\_gcc8.4.1/lib64 && :  
VTK/Wrapping/Python/CMakeFiles/pvtkpython.dir/vtkPythonAppInit.cxx.o: In function `main': vtkPythonAppInit.cxx:(.text.startup+0x21): undefined reference to `MPI\_Init’  
collect2: error: ld returned 1 exit status  
[19317/19499] Building CXX object Plugins/StreamLinesRepresentation/Representations/CMakeFiles/vtkStreamLines.dir/vtkStreamLinesMapper.cxx.o  
ninja: build stopped: subcommand failed.

---

<div class="post-metadata">

### Author: ![marco](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@marco](https://discourse.paraview.org/u/marco)
#### Post date: [October 5, 2021, 1:18pm UTC](https://discourse.paraview.org/t/unable-to-link-mpi-to-paraview/8125/2 "2021-10-05T13:18:56Z")

</div>

Solved problem by explicity telling cmake where to locate the mpi library  
-DMPI\_C\_LIBRARIES=${MPI\_INSTALL\_PREFIX}/lib/libmpi.so

Still not sure it could not resolve the libraries as I already had specified, paths were correct.  
-DPARAVIEW\_USE\_MPI=ON
