首页 > 解决方案 > 为 OpenMPI 1.3 定义宏

问题描述

我正在尝试非常旧的 OpenMPI 1.3版本。

我可以运行autogen.sh生成configure. 但是在运行时make出现以下错误:

In file included from event.c:37:0:
../../opal/event/compat/sys/_time.h:47:8: error: redefinition of 'struct timeval'
 struct timeval {
        ^
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:45:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from ../../opal/include/opal_config_bottom.h:372,
                 from ../../opal/include/opal_config.h:1341,
                 from event.c:28:
/usr/include/x86_64-linux-gnu/bits/time.h:30:8: note: originally defined here
 struct timeval
        ^
In file included from event.c:37:0:
../../opal/event/compat/sys/_time.h:55:8: error: redefinition of 'struct timespec'
 struct timespec {
        ^
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:43:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from ../../opal/include/opal_config_bottom.h:372,
                 from ../../opal/include/opal_config.h:1341,
                 from event.c:28:
/usr/include/time.h:120:8: note: originally defined here
 struct timespec
        ^

我检查了包含_time.h带有ack. 例如,该文件opal/event/event.c包含该标题。它有以下几行:

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
#endif

所以看起来我需要在整个项目中定义宏 HAVE_SYS_TIME_H 来迁移问题。怎么做?

更新:我只是注意到sys/time.h退出/usr/include/linux/time.h. sys映射到linux目录吗?

PS:运行autoreconf -i出现如下错误:

$ autoreconf -i
aclocal: error: acinclude.m4:111: file 'config/mca_no_configure_components.m4' does not exist
autoreconf: aclocal failed with exit status: 1

我创建了一些丢失的文件并重新运行autoreconf -i,然后出现以下错误:

$ autoreconf -i
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
sh: 1: config/ompi_get_version.sh: not found
configure.ac:934: error: Could not find project list - rerun autogen.sh without -l
config/ompi_mca.m4:37: OMPI_MCA is expanded from...
configure.ac:934: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

所以我认为autogen.sh是必须的。

PS2:我试过了./configure CPPFLAGS=-I/usr/include/ CFLAGS=-I/usr/include/。重新定义错误仍然存​​在。

标签: autoconfopenmpi

解决方案


推荐阅读