You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, quad precision is disabled when building flang except when explicitly enabled. I did not enable that when building flang.
Details of the problem
I configure Open MPI with few options: ./configure --with-pic --prefix=/opt/llvm/openmpi/openmpi-5.0.5/install, I am on this system not interested in any fancy interconnects or anything special.
Relevant output of the configure-script is:
checking size of Fortran REAL... 4
checking for C type corresponding to REAL... float
checking alignment of Fortran REAL... 4
checking for corresponding KIND value of REAL... C_FLOAT
checking KIND value of Fortran C_FLOAT... 4
checking if Fortran compiler supports REAL*2... yes
checking size of Fortran REAL*2... 2
checking for C type corresponding to REAL*2... opal_short_float_t
checking alignment of Fortran REAL*2... 2
checking for corresponding KIND value of REAL*2... C_SHORT_FLOAT
checking KIND value of Fortran C_SHORT_FLOAT... no ISO_C_BINDING -- fallback
checking Fortran value of selected_int_kind(4)... 2
2
checking if Fortran compiler supports REAL*4... yes
checking size of Fortran REAL*4... 4
checking for C type corresponding to REAL*4... float
checking alignment of Fortran REAL*4... 4
checking for corresponding KIND value of REAL*4... C_FLOAT
checking KIND value of Fortran C_FLOAT... (cached) 4
checking if Fortran compiler supports REAL*8... yes
checking size of Fortran REAL*8... 8
checking for C type corresponding to REAL*8... double
checking alignment of Fortran REAL*8... 8
checking for corresponding KIND value of REAL*8... C_DOUBLE
checking KIND value of Fortran C_DOUBLE... 8
checking if Fortran compiler supports REAL*16... no
checking for C type matching bit representation of REAL*16... skipped (no REAL*16)
configure: WARNING: MPI_REAL16 and MPI_COMPLEX32 support have been disabled
checking if Fortran compiler supports DOUBLE PRECISION... yes
checking size of Fortran DOUBLE PRECISION... 8
checking for C type corresponding to DOUBLE PRECISION... double
checking alignment of Fortran DOUBLE PRECISION... 8
checking for corresponding KIND value of DOUBLE PRECISION... C_DOUBLE
checking KIND value of Fortran C_DOUBLE... (cached) 8
checking if Fortran compiler supports COMPLEX... yes
checking size of Fortran COMPLEX... 8
checking for C type corresponding to COMPLEX... float _Complex
checking alignment of Fortran COMPLEX... 4
checking for corresponding KIND value of COMPLEX... C_FLOAT_COMPLEX
checking KIND value of Fortran C_FLOAT_COMPLEX... 4
checking if Fortran compiler supports COMPLEX*4... yes
checking size of Fortran COMPLEX*4... 4
checking for C type corresponding to COMPLEX*4... opal_short_float_complex_t
checking alignment of Fortran COMPLEX*4... 2
checking for corresponding KIND value of COMPLEX*4... C_SHORT_FLOAT_COMPLEX
checking KIND value of Fortran C_SHORT_FLOAT_COMPLEX... no ISO_C_BINDING -- fallback
checking Fortran value of selected_int_kind(4)... (cached) 2
2
checking if Fortran compiler supports COMPLEX*8... yes
checking size of Fortran COMPLEX*8... 8
checking for C type corresponding to COMPLEX*8... float _Complex
checking alignment of Fortran COMPLEX*8... 4
checking for corresponding KIND value of COMPLEX*8... C_FLOAT_COMPLEX
checking KIND value of Fortran C_FLOAT_COMPLEX... (cached) 4
checking if Fortran compiler supports COMPLEX*16... yes
checking size of Fortran COMPLEX*16... 16
checking for C type corresponding to COMPLEX*16... double _Complex
checking alignment of Fortran COMPLEX*16... 8
checking for corresponding KIND value of COMPLEX*16... C_DOUBLE_COMPLEX
checking KIND value of Fortran C_DOUBLE_COMPLEX... 8
checking if Fortran compiler supports COMPLEX*32... yes
checking size of Fortran COMPLEX*32... 32
checking for C type corresponding to COMPLEX*32... long double _Complex
checking alignment of Fortran COMPLEX*32... 16
checking for corresponding KIND value of COMPLEX*32... C_LONG_DOUBLE_COMPLEX
checking KIND value of Fortran C_LONG_DOUBLE_COMPLEX... 10
checking if Fortran compiler supports DOUBLE COMPLEX... yes
checking size of Fortran DOUBLE COMPLEX... 16
checking for C type corresponding to DOUBLE COMPLEX... double _Complex
checking alignment of Fortran DOUBLE COMPLEX... 8
checking for corresponding KIND value of DOUBLE COMPLEX... C_DOUBLE_COMPLEX
checking KIND value of Fortran C_DOUBLE_COMPLEX... (cached) 8
So Open MPI configure correctly detect that quad precision/real128 support is not present in the compiler.
When compiling Open MPI I get the following error:
FC psizeof_f.lo
error: Semantic errors in psizeof_f.f90
./psizeof_f.f90:161:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128)::x
^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:171:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:181:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:191:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:201:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:211:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:221:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:231:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:241:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:251:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:261:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:271:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:281:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:291:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:301:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./psizeof_f.f90:311:7: error: COMPLEX(KIND=-1) is not a supported type
COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,1,1,1,1,1,*)::x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
make[3]: *** [Makefile:2591: psizeof_f.lo] Error 1
make[3]: Leaving directory '/opt/llvm/openmpi/openmpi-5.0.7/ompi/mpi/fortran/mpif-h/profile'
make[2]: *** [Makefile:3440: all-recursive] Error 1
make[2]: Leaving directory '/opt/llvm/openmpi/openmpi-5.0.7/ompi/mpi/fortran/mpif-h'
make[1]: *** [Makefile:2710: all-recursive] Error 1
make[1]: Leaving directory '/opt/llvm/openmpi/openmpi-5.0.7/ompi'
make: *** [Makefile:1539: all-recursive] Error 1
So it seems that Open MPI is trying to work with COMPLEX(real128), which I certainly not expect the compiler to support when ordinary quad real128 is not supported.
A workaround is to recompile the compiler with quad precision support.
The text was updated successfully, but these errors were encountered:
I looked a bit more into what goes on. Building flang is complicated, and I cannot say exactly why real128 is not present in my build, maybe it is because I attempted to build with OpenMP offloading support - but that is just speculation.
In short, the reason Open MPI build fails, is that it checks for the support of COMPLEX*32 with some simple test (the output in my 1st post clearly shows this is present), then, if this is support is present, it goes ahead and use COMPLEX(real128) as if these two declarations are equivalent. The latter does not work and the build fails, since COMPLEX*32 works and COMPLEX(real128) does not work in my flang build.
I think this is a weird behavior of flang, so I wrote up these findings here: llvm/llvm-project#131088
hakostra
changed the title
OpenMPI 5.0.7 does not compile with most recent flang
OpenMPI 5.0.7 does not compile with flang when real128 is not supported
Mar 13, 2025
Background information
What version of Open MPI are you using?
5.0.7
Describe how Open MPI was installed
Tarball/source
Please describe the system on which you are running
I'm trying to build Open MPI with MPI_f08 bindings on a Linux system, using clang and flang build from recent llvm-project Git repository:
By default, quad precision is disabled when building
flang
except when explicitly enabled. I did not enable that when buildingflang
.Details of the problem
I configure Open MPI with few options:
./configure --with-pic --prefix=/opt/llvm/openmpi/openmpi-5.0.5/install
, I am on this system not interested in any fancy interconnects or anything special.Relevant output of the configure-script is:
So Open MPI configure correctly detect that quad precision/real128 support is not present in the compiler.
When compiling Open MPI I get the following error:
So it seems that Open MPI is trying to work with
COMPLEX(real128)
, which I certainly not expect the compiler to support when ordinary quad real128 is not supported.A workaround is to recompile the compiler with quad precision support.
The text was updated successfully, but these errors were encountered: