user1819905
user1819905

Reputation: 125

I am not able to compile with MPI compiler with C++

I was trying to compile a very simple MPI hello_world:

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

int main(int argc, char *argv[]) {
    int numprocs, rank, namelen;
    char processor_name[MPI_MAX_PROCESSOR_NAME];

    MPI_Init(&argc, &argv);
    MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Get_processor_name(processor_name, &namelen);

    printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);

    MPI_Finalize();
}

And got the following problem:

    Catastrophic error: could not set locale "" to allow processing of multibyte characters

I really don't know how to figure it out.

Upvotes: 6

Views: 8408

Answers (2)

Juanjo Aucar
Juanjo Aucar

Reputation: 1

Re-defining the environment variable LANG solved the problem for me, as pointed out (setting LANG=en_US.utf8).

I may say that I'm conecting to a foreign server, and there's where I get the problem compiling code with Intel compilers.

Upvotes: 0

hyde
hyde

Reputation: 62906

Try defining environment variables

LANG=en_US.utf8
LC_ALL=en_US.utf8

Assuming you're on unix, also try man locale and locale -a at command line, and google for "utf locale" and similar searches.

Upvotes: 19

Related Questions