我正在尝试使用非常旧版本的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
dir?
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/
。重新定义错误仍然存在。