open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.15k stars 859 forks source link

Fortran configure warnings and build errors with nvidia fortran compiler #10377

Open Akshay-Venkatesh opened 2 years ago

Akshay-Venkatesh commented 2 years ago

Seeing the following compiler warnings with nvidia hpc sdk 22.2 available here https://developer.nvidia.com/nvidia-hpc-sdk-releases

Background information

What version of Open MPI are you using? (e.g., v3.0.5, v4.0.2, git branch name and hash, etc.)

v4.1.3

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

release tarball configured with:

pg_cc=`which nvcc`
pg_fc=`which nvfortran`
pg_cpp=`which nvc++`
cuda_comp=`which nvcc`

../configure \
        --prefix=$PWD \
        --enable-debug \
        --enable-mpirun-prefix-by-default \
        --with-ucx=$UCX_HOME \
        --with-cuda=$CUDA_HOME \
        --disable-man-pages \
        --enable-oshmem \
        --enable-mca-no-build=btl-uct \
        --enable-mpi-fortran \
        --enable-mpi1-compatibility \
        --enable-mpi-ext=cuda \
        --with-hwloc=internal \
        --with-pmix=internal \
        CC=$pg_cc CXX=$pg_cpp FC=$pg_fc FCFLAGS="-fPIC"

Please describe the system on which you are running


Details of the problem

Configure warnings:

Unexpected size warnings

configure: WARNING: *** Fortran INTEGER*16 does not have expected size!
configure: WARNING: *** Expected 16, got 4
configure: WARNING: *** Disabling MPI support for Fortran INTEGER*16

configure: WARNING: *** Fortran COMPLEX*4 does not have expected size!
configure: WARNING: *** Expected 4, got 8
configure: WARNING: *** Disabling MPI support for Fortran COMPLEX*4

configure: WARNING: *** Fortran COMPLEX*32 does not have expected size!
configure: WARNING: *** Expected 32, got 8
configure: WARNING: *** Disabling MPI support for Fortran COMPLEX*32

configure: WARNING: *** Fortran REAL*16 does not have expected size!
configure: WARNING: *** Expected 16, got 4
configure: WARNING: *** Disabling MPI support for Fortran REAL*16

libevent warnings

configure: WARNING: sys/uio.h: present but cannot be compiled
configure: WARNING: sys/uio.h:     check for missing prerequisite headers?
configure: WARNING: sys/uio.h: see the Autoconf documentation
configure: WARNING: sys/uio.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/uio.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------- ##
configure: WARNING:     ## Report this to http://libevent.org ##
configure: WARNING:     ## ---------------------------------- ##
checking for sys/uio.h... no
checking arpa/inet.h usability... no
checking arpa/inet.h presence... yes
configure: WARNING: arpa/inet.h: present but cannot be compiled
configure: WARNING: arpa/inet.h:     check for missing prerequisite headers?
configure: WARNING: arpa/inet.h: see the Autoconf documentation
configure: WARNING: arpa/inet.h:     section "Present But Cannot Be Compiled"
configure: WARNING: arpa/inet.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------- ##
configure: WARNING:     ## Report this to http://libevent.org ##
configure: WARNING:     ## ---------------------------------- ##
checking for arpa/inet.h... no
checking sys/eventfd.h usability... no
checking sys/eventfd.h presence... yes
configure: WARNING: sys/eventfd.h: present but cannot be compiled
configure: WARNING: sys/eventfd.h:     check for missing prerequisite headers?
configure: WARNING: sys/eventfd.h: see the Autoconf documentation
configure: WARNING: sys/eventfd.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/eventfd.h: proceeding with the compiler's result
configure: WARNING:     ## ---------------------------------- ##
configure: WARNING:     ## Report this to http://libevent.org ##
configure: WARNING:     ## ---------------------------------- ##

Build errors:

  126 | #error "No way to define ev_uint64_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:145:2: error: #error "No way to define ev_uint32_t"
  145 | #error "No way to define ev_uint32_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:164:2: error: #error "No way to define ev_uint16_t"
  164 | #error "No way to define ev_uint16_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:251:2: error: #error "No way to define SIZE_MAX"
  251 | #error "No way to define SIZE_MAX"
      |  ^~~~~
make[3]: *** [Makefile:2017: output.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/evutil.h:37,
                 from ../../../opal/mca/event/libevent2022/libevent/event.h:57,
                 from ../../../opal/mca/event/libevent2022/libevent2022.h:58,
                 from ../../../opal/mca/event/event.h:77,
                 from ../../../opal/mca/pmix/pmix.h:24,
                 from ../../../opal/util/proc.c:22:
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:126:2: error: #error "No way to define ev_uint64_t"
  126 | #error "No way to define ev_uint64_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:145:2: error: #error "No way to define ev_uint32_t"
  145 | #error "No way to define ev_uint32_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:164:2: error: #error "No way to define ev_uint16_t"
  164 | #error "No way to define ev_uint16_t"
      |  ^~~~~
/tmp/openmpi-4.1.3/opal/mca/event/libevent2022/libevent/include/event2/util.h:251:2: error: #error "No way to define SIZE_MAX"
  251 | #error "No way to define SIZE_MAX"
      |  ^~~~~
Akshay-Venkatesh commented 2 years ago

cc @janjust

janjust commented 2 years ago

@jladd-mlnx FYI

sangallidavide commented 2 years ago

I tried to compile the released 4.1.4 with nvcc and nvfortran 22.04 and the compilation failed.

I had to change the configure of the openmpi library as below, i.e. I did add nvfortran so that the compiler is recognised. After that it worked. This is probably more related to issue #8919

Without I got the error relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC

43702c43702
<   for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran nvfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor
---
>   for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor
43746c43746
<   for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran nvfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor
---
>   for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor
414137c414137
<       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)
---
>       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
414780c414780
<       pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)
---
>       pgf77* | pgf90* | pgf95* | pgfortran*)
421450c421450
<       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)
---
>       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
422078c422078
<       pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)
---
>       pgf77* | pgf90* | pgf95* | pgfortran*)
jsquyres commented 2 years ago

@Akshay-Venkatesh @janjust Can you guys comment on this?

sangallidavide commented 2 years ago

I have the same problem reported above about libevent with nvidia compiler. If the configure does not find the external libevent, the compilation of the internal libevent fails.

On ubuntu the solution is to install libevent-dev After that the installation works fine with the above change to the configure

lcebaman commented 5 months ago

I have seen similar warnings with AOCC 4.2

configure: WARNING: *** Fortran COMPLEX*4 does not have expected size! 
configure: WARNING: *** Expected 4, got 8 
configure: WARNING: *** Disabling MPI support for Fortran COMPLEX*4)