use*_*905 2 c++ compiler-construction mpi
我试图编译一个非常简单的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();
}
Run Code Online (Sandbox Code Playgroud)
并得到以下问题:
Catastrophic error: could not set locale "" to allow processing of multibyte characters
Run Code Online (Sandbox Code Playgroud)
我真的不知道该怎么弄清楚.
尝试定义环境变量
LANG=en_US.utf8
LC_ALL=en_US.utf8
Run Code Online (Sandbox Code Playgroud)
假设你在UNIX上,也尽量man locale和locale -a在命令行,谷歌的"UTF区域"以及类似的搜索.