PascExchange
PascExchange

Reputation: 113

Compilation of MPI "hello world" fails

Today I tried to compile the classical MPI "hello world" program

#include <stdio.h>
#include <mpi.h>

int main(int argc, char** argv)
{
    MPI_Init(&argc, &argv);

    int rank;
    int size;

    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
    MPI_Comm_size(MPI_COMM_WORLD,&size);

    printf("I am rank %d of %d\n", rank, size);

    MPI_Finalize();

    return 0;
}

To do so I installed openMPI, lam, lam-devel (for mpicc). I tried to follow the answer given in this old thread adressing this problem, which lead to an installation of automake, autoconf, libtool and from here I also came to install coreutils. Unfortunatelly I still get the following error-message when trying to compile the above code

mpicc hello.c   -o hello
gcc: error: libtool:: Datei oder Verzeichnis nicht gefunden
gcc: error: link:: Datei oder Verzeichnis nicht gefunden
mpicc: No such file or directory

Requesting the compiler version gives

mpicc --version
gcc (SUSE Linux) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Upvotes: 0

Views: 723

Answers (1)

supercheval
supercheval

Reputation: 357

Can you try mpic++ instead:

mpic++ hello.c   -o hello

It is working on my machine

I used openmpi:

sudo apt-get install openmpi-bin

Upvotes: 1

Related Questions