Cannot compile openmpi with icc

Cannot compile openmpi with icc

mvymazal's picture

Hello,

I'm trying to compile openmpi 1.4.5, but the configuration unfortunately fails with many errors:

--
configure:7501: icc -E conftest.c
configure:7508: $? = 0
configure:7539: icc -E conftest.c
conftest.c(49): error #2379: cannot open source file "ac_nonexistent.h"
#include
^

--
configure:10344: result: -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict
configure:10363: checking for Interix environment
configure:10388: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(58): catastrophic error: #error directive: Normal Unix environment
#error Normal Unix environment
^

compilation aborted for conftest.c (code 4)
--
| main ()
| {
| #if !defined(__INTERIX)
| #error Normal Unix environment
| #endif
| ;
| return 0;
--
configure:11522: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:11529: $? = 0
configure:11556: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(102): error: expected an expression
if (sizeof ((long long)))
^

--
configure:11625: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:11632: $? = 0
configure:11659: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(103): error: expected an expression
if (sizeof ((long double)))
^

--
configure:11728: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:11735: $? = 0
configure:11762: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(104): error: expected an expression
if (sizeof ((int8_t)))
^

--
configure:11831: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:11838: $? = 0
configure:11865: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(105): error: expected an expression
if (sizeof ((uint8_t)))
^

--
configure:11934: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:11941: $? = 0
configure:11968: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(106): error: expected an expression
if (sizeof ((int16_t)))
^

--
configure:12037: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12044: $? = 0
configure:12071: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(107): error: expected an expression
if (sizeof ((uint16_t)))
^

--
configure:12140: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12147: $? = 0
configure:12174: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(108): error: expected an expression
if (sizeof ((int32_t)))
^

--
configure:12243: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12250: $? = 0
configure:12277: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(109): error: expected an expression
if (sizeof ((uint32_t)))
^

--
configure:12346: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12353: $? = 0
configure:12380: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(110): error: expected an expression
if (sizeof ((int64_t)))
^

--
configure:12449: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12456: $? = 0
configure:12483: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(111): error: expected an expression
if (sizeof ((uint64_t)))
^

--
configure:12552: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12559: $? = 0
configure:12586: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(112): error: expected an expression
if (sizeof ((intptr_t)))
^

--
configure:12655: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12662: $? = 0
configure:12689: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(113): error: expected an expression
if (sizeof ((uintptr_t)))
^

--
configure:12758: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12765: $? = 0
configure:12792: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(114): error: expected an expression
if (sizeof ((mode_t)))
^

--
configure:12861: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12868: $? = 0
configure:12895: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(115): error: expected an expression
if (sizeof ((ssize_t)))
^

--
configure:12964: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
configure:12971: $? = 0
configure:12998: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(116): error: expected an expression
if (sizeof ((ptrdiff_t)))
^

--
configure:21848: result: 8
configure:21865: checking for C bool type
configure:21889: icc -c -O3 -DNDEBUG -finline-functions -fno-strict-aliasing -restrict conftest.c >&5
conftest.c(140): error: identifier "bool" is undefined
bool bar, foo = true; bar = foo;
^

conftest.c(140): error: identifier "true" is undefined
bool bar, foo = true; bar = foo;
^

--
| }
configure:21915: result: no
configure:21943: checking for inline
configure:21969: icc -c -O3 -DNDEBUG -Werror -ansi conftest.c >&5
conftest.c(106): error: identifier "inline" is undefined
static inline foo_t static_foo () {return 0; }
^

conftest.c(106): error: "foo_t" has already been declared in the current scope
static inline foo_t static_foo () {return 0; }
^

conftest.c(106): error: expected a ";"
static inline foo_t static_foo () {return 0; }
^

conftest.c(109): error #12: parsing restarts here after previous syntax error

compilation aborted for conftest.c (code 2)
configure:21976: $? = 2
--
| inline foo_t foo () {return 0; }
| #endif
|
configure:21969: icc -c -O3 -DNDEBUG -Werror -ansi conftest.c >&5
configure:21976: $? = 0
configure:21994: result: __inline__
configure:22019: checking for C/C++ restrict keyword
configure:22054: icc -c -O3 -DNDEBUG -Werror -ansi conftest.c >&5
configure:22061: $? = 0
configure:22079: result: __restrict
configure:22097: checking for weak symbol support
configure:22128: icc -O3 -DNDEBUG -Werror -ansi -c conftest_weak.c
configure:22135: $? = 0
configure:22145: icc -O3 -DNDEBUG -Werror -ansi conftest.c conftest_weak.o -o conftest
configure:22152: $? = 0
configure:22179: result: yes
configure:22195: checking whether icc-8.1 for EM64T works with variable arguments
--
configure:23112: icpc -E conftest.cpp
configure:23119: $? = 0
configure:23150: icpc -E conftest.cpp
conftest.cpp(110): error #2379: cannot open source file "ac_nonexistent.h"
#include
^

--
configure:23219: icpc -E conftest.cpp
configure:23226: $? = 0
configure:23257: icpc -E conftest.cpp
conftest.cpp(110): error #2379: cannot open source file "ac_nonexistent.h"
#include
^

--
configure:24647: result: intel
configure:24669: checking if C++ compiler works
configure:24750: icpc -o conftest -DNDEBUG conftest.cpp >&5
/usr/include/c++/4.7.0/ext/atomicity.h(48): error: identifier "__ATOMIC_ACQ_REL" is undefined
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^

/usr/include/c++/4.7.0/ext/atomicity.h(48): error: identifier "__atomic_fetch_add" is undefined
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^

/usr/include/c++/4.7.0/ext/atomicity.h(52): error: identifier "__ATOMIC_ACQ_REL" is undefined
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^

/usr/include/c++/4.7.0/ext/atomicity.h(52): error: identifier "__atomic_fetch_add" is undefined
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
^

--
| return 0;
| }
configure:24787: result: no
configure:24801: error: Could not run a simple C++ program. Aborting.

## ---------------- ##
## Cache variables. ##

The configure line that I used in openmpi source directory is
./configure CC=icc CXX=icpc F77=ifort FC=ifort --prefix=/data/install_test/openmpi

My version of icc/icpc/ifort: 12.1.3 20120212
I also use gcc version 4.7.0 (don't know if that's relevant to my problem).

Could you please give me an advice how to compile openmpi with icc?

Thank you very much.

Best regards,

Martin Vymazal

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Tim Prince's picture

You have hit a documented incompatibility between icpc and g++-4.7. The current icpc was released before g++-4.7 was available. I have been informed that the fix for this has just been identified and will be incorporated in icpc 13.0. In the mean time, you will need to put an older g++ on PATH if you wish to build with icpc support. You have the alternative of configuring with CXX=g++ which will cause mpiCC to use g++ and avoid this problem.

mvymazal's picture

Ok, thank you for the information.

Best regards,

Martin Vymazal

thanhwru's picture

dear all,

but i want to ask you that if i temporaryly use CXX=g++ replace for CXX=$PATH/icpc, Is all everything still good?

(if you replace CXX=$PATH/icpc, you will setup openmpi 1.4.5)

thanks a lot
thanhwru83@gmail.com

Tim Prince's picture

You certainly can build OpenMPI with g++. If your g++ and icpc are mutually compatible, the OpenMPI will work with icc and icpc even though you built it with gcc and g++, but you have the problem that your mpicc and mpiCC are not using the Intel compilers, so your linkage won't "just work." I suppose the OpenMP would then be linked against glibc memcpy() and the like rather than the special replacements in the Intel compiler library.
If you are suggesting building mpicc to use icc and mpiCC to use g++,
that may work, but few people will have tried it or be able to give
advice.
If your aim is to continue using gcc 4.7 along with icc 12.1, you will have to avoid icpc until you are ready to switch to compatible versions (gcc 4.6 with icc 12.1, gcc 4.7 with icc 13.0).

thanhwru's picture

Dear all,

i am sure that i can build OpenMPI 1.4.5 with g++, but when i try to configure OpenMPI1.6 with icpc, all is okei. however, when i make check, some errors are as follow:

make[3]: Entering directory `/home/thanhnt/openmpi-1.6/ompi/debuggers'
CCLD predefined_gap_test
libtool: link: cannot find the library `../../ompi/libmpi.la' or unhandled argument `../../ompi/libmpi.la'
make[3]: *** [predefined_gap_test] Error 1
make[3]: Leaving directory `/home/thanhnt/openmpi-1.6/ompi/debuggers'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/thanhnt/openmpi-1.6/ompi/debuggers'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/thanhnt/openmpi-1.6/ompi'
make: *** [check-recursive] Error

please tell me that why?

thanks for all

Feilong H (Intel)'s picture

The 13.0 compiler initial release, which is compatible with gcc 4.7, is available for download at . FYI.

Thanks,
Feilong

Login to leave a comment.