Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error when building openmpi with ifort 18.0.3: Open MPI requires a C99 compiler

FlyingHermes
New Contributor I
2,524 Views

Hi,

I'm trying to build the latest version of openmpi (3.1.2) using intel Fortran 18.0.3 and the installation process complains about the compiler not being ISO C99. The error occurs for other versions of openmpi and ifort (18.0.0 and 17).

Also, for what it's worth, I'm using the Fedora 28 with

$ uname -r
4.17.19-200.fc28.x86_64
$ ldd --version
ldd (GNU libc) 2.27

 

I've wrote the following simple build script which download openmpi-3.1.2, extract files and build it.

#!/bin/bash
set -e
INTEL_HOME="<path>"
source ${INTEL_HOME}/compilers_and_libraries_2018.3.222/linux/bin/compilervars.sh intel64
ifort -v
wget https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.2.tar.gz
tar -xzvf openmpi-3.1.2.tar.gz
TopDir=${pwd}
mkdir -p build
cd build
./../openmpi-3.1.2/configure --prefix=${TopDir}/install CC=icc CXX=icpc FC=ifort CFLAGS="-D_Float128=__float128"
make all install -j

You just have to set the path where intel tools are installed in the variable INTEL_HOME.

Running this script, I have the following output:

checking for perl... perl

============================================================================
== Configuring Open MPI
============================================================================

*** Startup tests
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... icc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc accepts -g... yes
checking for icc option to accept ISO C89... none needed
checking whether icc understands -c and -o together... yes
checking how to run the C preprocessor... icc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking dependency style of icc... gcc3
checking whether make supports nested variables... (cached) yes

*** Checking versions
checking for repo version... v3.1.2
checking Open MPI version... 3.1.2
checking Open MPI release date... Aug 22, 2018
checking Open MPI repository version... v3.1.2
checking for repo version... v3.1.2
checking Open MPI Run-Time Environment version... 3.1.2
checking Open MPI Run-Time Environment release date... Aug 22, 2018
checking Open MPI Run-Time Environment repository version... v3.1.2
checking for repo version... v3.1.2
checking Open SHMEM version... 3.1.2
checking Open SHMEM release date... Aug 22, 2018
checking Open SHMEM repository version... v3.1.2
checking for repo version... v3.1.2
checking Open Portable Access Layer version... 3.1.2
checking Open Portable Access Layer release date... Aug 22, 2018
checking Open Portable Access Layer repository version... v3.1.2
checking for bootstrap Autoconf version... 2.69
checking for bootstrap Automake version... 1.15
checking for boostrap Libtool version... 2.4.6

*** Initialization, setup
configure: builddir: /home/geek/Applications/OPENMPI/tmp/build
configure: srcdir: /home/geek/Applications/OPENMPI/tmp/openmpi-3.1.2
configure: Detected VPATH build
installing to directory "/install"

*** OPAL Configuration options
checking if want to run code coverage... no
checking if want to compile with branch probabilities... no
checking if want to debug memory usage... no
checking if want to profile memory usage... no
checking if want developer-level compiler pickyness... no
checking if want developer-level debugging code... no
checking if want to developer-level timing framework... no
checking if want to install project-internal header files... no
checking if want pretty-print stacktrace... yes
checking if want pty support... yes
checking if want weak symbol support... yes
checking if want dlopen support... yes
checking for default value of mca_base_component_show_load_errors... enabled by default
checking if want heterogeneous support... no
checking if word-sized integers must be word-size aligned... yes
checking if want IPv6 support... no
checking if want package/brand string... Open MPI blopez@deimos Distribution
checking if want ident string... 3.1.2
checking if want to use an alternative checksum algo for messages... no
checking maximum length of processor name... 256
checking maximum length of error string... 256
checking maximum length of object name... 64
checking maximum length of info key... 36
checking maximum length of info val... 256
checking maximum length of port name... 1024
checking maximum length of datarep string... 128
checking if want getpwuid support... yes
checking for zlib in... (default search paths)
checking zlib.h usability... no
checking zlib.h presence... yes
configure: WARNING: zlib.h: present but cannot be compiled
configure: WARNING: zlib.h:     check for missing prerequisite headers?
configure: WARNING: zlib.h: see the Autoconf documentation
configure: WARNING: zlib.h:     section "Present But Cannot Be Compiled"
configure: WARNING: zlib.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.open-mpi.org/community/help/ ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for zlib.h... no
checking will zlib support be built... no
checking __NetBSD__... no
checking __FreeBSD__... no
checking __OpenBSD__... no
checking __DragonFly__... no
checking __386BSD__... no
checking __bsdi__... no
checking __APPLE__... no
checking __linux__... yes
checking __sun__... no
checking __sun... no
checking netdb.h usability... no
checking netdb.h presence... yes
configure: WARNING: netdb.h: present but cannot be compiled
configure: WARNING: netdb.h:     check for missing prerequisite headers?
configure: WARNING: netdb.h: see the Autoconf documentation
configure: WARNING: netdb.h:     section "Present But Cannot Be Compiled"
configure: WARNING: netdb.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.open-mpi.org/community/help/ ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for netdb.h... no
checking netinet/in.h usability... no
checking netinet/in.h presence... yes
configure: WARNING: netinet/in.h: present but cannot be compiled
configure: WARNING: netinet/in.h:     check for missing prerequisite headers?
configure: WARNING: netinet/in.h: see the Autoconf documentation
configure: WARNING: netinet/in.h:     section "Present But Cannot Be Compiled"
configure: WARNING: netinet/in.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.open-mpi.org/community/help/ ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for netinet/in.h... no
checking netinet/tcp.h usability... no
checking netinet/tcp.h presence... yes
configure: WARNING: netinet/tcp.h: present but cannot be compiled
configure: WARNING: netinet/tcp.h:     check for missing prerequisite headers?
configure: WARNING: netinet/tcp.h: see the Autoconf documentation
configure: WARNING: netinet/tcp.h:     section "Present But Cannot Be Compiled"
configure: WARNING: netinet/tcp.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to http://www.open-mpi.org/community/help/ ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for netinet/tcp.h... no
checking for struct sockaddr_in... no
checking if --with-cuda is set... not set (--with-cuda=)
checking whether CU_POINTER_ATTRIBUTE_SYNC_MEMOPS is declared... no
checking whether cuPointerGetAttributes is declared... no
checking if have cuda support... no
checking if user requested external PMIx support()... no

*** ORTE Configuration options
checking if want orterun "--prefix" behavior to be enabled by default... no

*** OMPI Configuration options
checking if want compile-time warnings inside of mpi.h... yes
checking if want sparse process groups... no
checking if want peruse support... no
checking if want Fortran MPI bindings...  (try)
checking if want C++ bindings... no
checking if want MPI::SEEK_SET support... yes
checking if want run-time MPI parameter checking... runtime

*** OSHMEM Configuration options
checking if want oshmem... yes
checking if want SGI/Quadrics compatibility mode... yes
checking if want OSHMEM API parameter checking... always
checking for on_exit... yes
checking if want pshmem... yes
checking if want to build OSHMEM fortran bindings... yes
checking if want custom libmpi(_FOO) name... mpi
checking if want wrapper compiler rpath support... yes
checking if want wrapper compiler runpath support... yes

============================================================================
== Compiler and preprocessor tests
============================================================================

*** C compiler and preprocessor
checking for gcc... (cached) icc
checking whether we are using the GNU C compiler... (cached) yes
checking whether icc accepts -g... (cached) yes
checking for icc option to accept ISO C89... (cached) none needed
checking whether icc understands -c and -o together... (cached) yes
checking for icc option to accept ISO C99... unsupported
configure: WARNING: Open MPI requires a C99 compiler
configure: error: Aborting

 

I'm award of this link: https://stackoverflow.com/questions/47313348/open-mpi-with-icc-open-mpi-requires-a-c99-compiler

in which a workaround is given. This workaround consists of adding the options

CC=icc CXX=icpc FC=ifort CFLAGS="-D_Float128=__float128"

 

when running configure but it did not help for me.

Any idea of what is going wrong here ?

Thanks

 

0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
2,524 Views

Well, for one, Intel Fortran is not a C compiler. As far as I know, OpenMPI is all C code, other than the interface modules.

I do see that you have Intel C++ installed. If you need help using icc, please ask in the Intel C++ forum.

0 Kudos
TimP
Honored Contributor III
2,524 Views

As Steve says, the problem is between icc and openmpi, and is better addressed on Intel C++ or openmpi forum. Looking at the several search engine hits, it seems likely that your system gcc is a recent version with small incompatibilities with icc prior to the very latest version, so you should read about the work-arounds and read the Intel C++ forum discussions.  Specifically, some point out that the default build setup has _GNU_SOURCE redefined after #include <stdlb.h> when using gcc 7 or glibc 2.26/2.27 and icc 18.0.

There's no point in quoting the high level build log; you need to see whether the specific failing test is different from the one which would be avoided by the measures you took. If that together with the posts you will find doesn't help, you can ask on one of the appropriate forums.

There's little or no advantage in invoking icc to build MPI; ifort should be fully compatible with gcc over a wider range of gcc and ifort versions, and the resulting MPI should be fully compatible with icc (and icpc, if similar problems don't come up in the application build).

0 Kudos
Reply