# Julia is not using my local OpenMPI installation but asks to install MPICH

**URL:** <https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155>\
**Category:** New to Julia\
**Created:** [March 15, 2023, 10:34pm UTC](https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155 "2023-03-15T22:34:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 15, 2023, 11:05pm UTC](https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155/2 "2023-03-15T23:05:45Z")

</div>

> [@wadedl](#):
>
> I am new to Julia

Welcome!

> [@wadedl](#):
>
> but not new to building from source code.

Good, but there’s nothing to compile from source here 🙂

> [@wadedl](#):
>
> julia --project -e ‘using Pkg; Pkg.add(“MPIPreferences”)’

You’re running the command `julia --project`, so you’re activating a local environment?

> [@wadedl](#):
>
> ( although I am getting message  
> Warning: could not download [https://pkg.julialang.org/registries](https://pkg.julialang.org/registries) and  
> Error: curl\_easy\_getinfo: 43, 48, 48 )

Are you on an air-gapped system? That complicates things a bit.

> [@wadedl](#):
>
> However, paths to libmpi and mpiexec are /usr/local/lib/libmpi.so and  
> /usr/local/bin/mpiexecc …

Are you sure you typed `mpiexecc` correctly? That’s an unusual name. In any case, if you want to specify a different MPI launcher executable you can pass the `mpiexec` keyword argument to [`use_system_binary`](https://juliaparallel.org/MPI.jl/stable/reference/mpipreferences/#MPIPreferences.use_system_binary):

```julia
MPIPreferences.use_system_binary(; mpiexec="mpiexecc")

```

or

```julia
MPIPreferences.use_system_binary(; mpiexec="/usr/local/bin/mpiexecc")

```

if you really want to specify the absolute path of the executable, instead of relying on it being the first one to be found in `PATH`. Same for libmpi: `libmpi` is the correct basename to dlopen `/usr/local/lib/libmpi.so`, if that’s the first libmpi that the dynamical linker would find, but if you want to specify the absolute path to be absolutely clear you can do it:

```julia
MPIPreferences.use_system_binary(; library_names=["/usr/local/lib/libmpi.so"])

```

> [@wadedl](#):
>
> Of course I do not WANT to build a NEW Open MPI but to have  
> julia\> using MPI just use the MPI I have installed, as identified in the  
> MPIPreferences use binary installed.

Note that nothing is _ **building** _ a new OpenMPI, what the package manager is trying to do is to download a Julia package which is a thin wrapper around OpenMPI, so your worry is ill-posed.

But now we’re back to the question above: do you have access to the Internet at all?

Side note, since you’re new here: it’d be extremely helpful if you [quoted the code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530) that you copy here with triple backquotes, like this:

````julia
```
put
some
code
here
```

````

which you can achieve also by selecting the code and clicking the `</>` button in the editing toolbar. You may also want to read [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757).

---

_[View the full topic](https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155)._
