Компиляция MPI с make, несколько ошибок пространства имен, таких как «error: unknown type name 'using»? - PullRequest
0 голосов
/ 19 октября 2018

Я пытаюсь скомпилировать MPI на Xubuntu 16.04 LTS, и я весьма уверен, что все мои g ++ и gcc включены, а библиотеки уже установлены, и все же я получаю этот странный беспорядок ...

    make[3]: Entering directory '/media/verthex/32gig/openmpi-3.1.2/oshmem/shmem/c/profile'
  LN_S     pshmem_init.c
  CC       pshmem_init.lo
In file included from ../../../../oshmem/include/shmem.h:26:0,
                 from ../../../../oshmem/include/oshmem/constants.h:15,
                 from pshmem_init.c:22:
/usr/local/include/complex.h:10:1: error: unknown type name ‘using’
 using namespace std;
 ^
/usr/local/include/complex.h:10:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘std’
 using namespace std;
                 ^
/usr/local/include/complex.h:13:17: fatal error: cmath: No such file or directory
compilation terminated.
Makefile:1950: recipe for target 'pshmem_init.lo' failed
make[3]: *** [pshmem_init.lo] Error 1
make[3]: Leaving directory '/media/verthex/32gig/openmpi-3.1.2/oshmem/shmem/c/profile'
Makefile:2012: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/media/verthex/32gig/openmpi-3.1.2/oshmem/shmem/c'
Makefile:2578: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/media/verthex/32gig/openmpi-3.1.2/oshmem'
Makefile:1897: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Это вывод конфигурации ближе к концу.

Open MPI configuration:
-----------------------
Version: 3.1.2
Build MPI C bindings: yes
Build MPI C++ bindings (deprecated): no
Build MPI Fortran bindings: no
MPI Build Java bindings (experimental): no
Build Open SHMEM support: yes
Debug build: no
Platform file: (none)

Miscellaneous
-----------------------
CUDA support: no
PMIx support: internal

Transports
-----------------------
Cisco usNIC: no
Cray uGNI (Gemini/Aries): no
Intel Omnipath (PSM2): no
Intel SCIF: no
Intel TrueScale (PSM): no
Mellanox MXM: no
Open UCX: no
OpenFabrics Libfabric: no
OpenFabrics Verbs: yes
Portals4: no
Shared memory/copy in+copy out: yes
Shared memory/Linux CMA: yes
Shared memory/Linux KNEM: no
Shared memory/XPMEM: no
TCP: yes

Resource Managers
-----------------------
Cray Alps: no
Grid Engine: no
LSF: no
Moab: no
Slurm: yes
ssh/rsh: yes
Torque: no

1 Ответ

0 голосов
/ 19 октября 2018

Потому что вы пытаетесь скомпилировать файл pshmem_init.c, который явно является файлом C, а не файлом C ++.И make, и компилятор попытаются скомпилировать файл, оканчивающийся на .c как C, если только вы не пойдете слишком долго, чтобы передумать.

Мне кажется, что файл C pshmem_init.cвключая заголовок complex.h, означающий доступ к стандартному заголовку C, который находится в /usr/include/complex.h, но вы добавили файл заголовка C ++ с тем же именем (complex.h) в /usr/local/include и спросили компиляторчтобы посмотреть туда сначала (он всегда будет смотреть в системных каталогах по умолчанию в последнюю очередь).

Вам придется решить это до того, как этот код скомпилируется.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...