4

it's my first post here so apologies if my style is wrong!

I've been trying to install mpi4py (as SU2 requires it for parallel processing) on Ubuntu 16.04 using python 3.6. I downloaded mpi4py and tried to build from source as I would like to use the OpenMPI libraries I had configured, and tried the following:

sudo python setup.py build --mpicc=/opt/openmpi/openmpi-2.1.0/bin/mpicc

However, it ultimately fails with "error: Cannot link MPI programs. Check your configuration!!!"

Looking at the SU2 and mpi4py documentation, they recommend using pip instead. I also tried this:

sudo pip install mpi4py

and env MPICC=/opt/openmpi/openmpi-2.1.0/bin/mpicc pip install mpi4py but they also gave the same error.

I have saved both outputs - please see the link for the attachments. It seems to pick up on a lot of the files from my NVIDIA CUDA installation, though I'm not sure why.

I'm a beginner at at compiling programs so I'd appreciate it if anyone could shed any light on this? Thanks.

2
  • I found a similar post which was probably asked by yourself. Seems like you made some progress. If you found a solution please update this post. Commented May 31, 2017 at 19:23
  • have a try it work for me Commented Dec 16, 2018 at 6:46

2 Answers 2

3

Though its an old post but I will post my answer might help others.

I fixed this problem by following commands:

sudo apt install libopenmpi-dev
 
pip install mpi4py` 
Sign up to request clarification or add additional context in comments.

Comments

1

For anyone else who is struggling with this problem, it turned out to be a number of factors. Mainly, mpi4py was not building correctly as my implementation of MPI (openMPI) had not been properly built. There were many factors that differentiated building programs on an existing supercomputer and a fresh Linux install.

Some troubleshooting tips I can recommend are:

  1. Make sure you clear away any environmental variables which are unnecessary for the install using unset

  2. Unload any modules which may interfere with the install using module unload. This is especially true when building your own MPI implementation on a supercomputer which has several others loaded already.

  3. Check your $PATH variable for any locations which may contaminate your install (not forgetting that the order is important)! You may want to temporarily set a cleaner PATH variable to make sure the build picks up the correct libraries.

Hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.