-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error on PowerPC64 due to unsupported real kind #502
Comments
Do you have any configuration information on how gfortran was built on this system (does it include these flags: Or would it be possible to upgrade to gfortran 8.x? From my brief google search, it looks like this was an issue with 7.x on PPC64 and PPC64el. Some info in this thread: https://lists.debian.org/debian-powerpc/2018/04/msg00005.html |
@andrew-platt As luck would have it, the system is down for maintenance today, so I'll have wait to check on the gfortran build settings when it comes back online in the next day or so. Regarding using a newer GCC/gfortran version, that might be tricky given that we are building for hybrid architecture and we need to make sure that host compiler, the MPI libraries, and the NVIDIA CUDA versions play nice when building the nalu-wind side of things and to make sure that we use the same compiler+MPI stack for the OpenFAST C++ API to avoid library incompatibilities. Also if 8.x or higher have been built with If we are forced to stick to the well-tested GCC 7.4.0 stack which extensively tested/benchmarked in FY20-Q2 milestone, what would be the impact of the hack I put in to get things to compile? Are there code pathways on the land-based turbine modules that use |
I was guessing there there might be some additional considerations on changing compilers. I can't see any reason disabling |
Yeah, |
@andrew-platt I ran the following test program against all available GCC versions on ORNL Summit. It appears that none of the versions available support quadmath. Recompiling our own GCC is not going to work because we want to use the Spectrum-MPI provided by the system. program test
INTEGER, PARAMETER :: quki = SELECTED_REAL_KIND(20, 500)
write(*,*) "SELECTED_REAL_KIND(20, 500)", quki
end program $ for ver in 4.8.5 5.4.0 6.4.0 7.4.0 8.1.0 8.1.1 9.1.0 ; do
module unload gcc 2>/dev/null
module load gcc/${ver} 2> /dev/null
echo "==> Using GCC version ${ver}"
gfortran test.F90 && ./a.out
done
==> Using GCC version 4.8.5
GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-37)
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 5.4.0
GNU Fortran (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 6.4.0
GNU Fortran (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 7.4.0
GNU Fortran (GCC) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 8.1.0
GNU Fortran (GCC) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 8.1.1
GNU Fortran (GCC) 8.1.1 20180519
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SELECTED_REAL_KIND(20, 500) -2
==> Using GCC version 9.1.0
GNU Fortran (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SELECTED_REAL_KIND(20, 500) -2 |
Also here is the output of
|
@sayerhs Thanks for the update! I'll look into the best way to add it as a CMake flag. For now, I suspect your method should work without introducing any numerical issues. Did you have to disable any module procedure interfaces within the nwtc_library to get it to compile? |
@andrew-platt With the hack I show above, I didn't have to disable any module procedure interfaces to get it to compile. However, this wasn't my first idea... my first idea was to disable |
I'm noticing the same thing. A fair number of the interface routines are specified as However there are several routines defined for I'm really curious what |
The following program outputs program test
INTEGER, PARAMETER :: quki = SELECTED_REAL_KIND(20, 120)
real(kind=quki) :: r16
write(*, *) sizeof(r16)
end program |
And this outputs 16 and 5, so there is no weird padding issues going on program test
INTEGER, PARAMETER :: quki = SELECTED_REAL_KIND(20, 120)
real(kind=quki) :: r16, a16(5)
write(*, *) sizeof(r16), sizeof(a16) / sizeof(r16)
end program |
One more test and output program test
INTEGER, PARAMETER :: quki = SELECTED_REAL_KIND(20, 120)
INTEGER, PARAMETER :: r8ki = selected_real_kind(14, 300)
real(kind=r8ki) :: r8, a8(5)
real(kind=quki) :: r16, a16(5)
write(*, *) sizeof(r8), sizeof(a8) / sizeof(r8)
write(*, *) sizeof(r16), sizeof(a16) / sizeof(r16)
end program
8 5
16 5 I am using gfortran 7.4.0 on Summit by the way. |
Couple of ideas:
Thoughts? |
What about using $ cat test.F90 && gfortran test.F90 && ./a.out
program test
use, intrinsic :: iso_fortran_env , only: real32, real64, real128
real(real32) :: r4
real(real64) :: r8
real(real128) :: r16
write(*,*) real32, real64, real128
write(*, *) precision(r4), range(r4)
write(*, *) precision(r8), range(r8)
write(*, *) precision(r16), range(r16)
end program
Also @andrew-platt, I am doubtful that any architecture uses a 12-byte real. That would require padding with cache lines which are 64 or 128 wide. |
Those named constants look like they are part of the Fortran 2008 standard. The OpenFAST documentation says to use Fortran 2003... are there any objections to changing that guidance? People used to complain to me when things didn't work with their very old compiler that they couldn't update. Otherwise, I think that's a nice option. |
Thanks @bjonkman . I had overlooked about the Fortran2003 requirement for OpenFAST. I tested it on the oldest compiler version available on that machine (GCC 4.8.5) and it does recognize those constants.
program test
use, intrinsic :: iso_fortran_env , only: real32, real64, real128
real(real32) :: r4
real(real64) :: r8
real(real128) :: r16
write(*,*) real32, real64, real128
write(*, *) precision(r4), range(r4)
write(*, *) precision(r8), range(r8)
write(*, *) precision(r16), range(r16)
end program
|
Yes, I inadvertently violated that. No objections to use 2008 standard from my end. |
@bjonkman @rafmudaf @andrew-platt Please see #512 for a set of proposed changes that I've implemented for my summit build. This should fix the regression from #507 also. |
Fixed in #512 |
OpenFAST fails to build on IBM PowerPC64 architecture using GNU GCC 7.4.0 (ORNL Summit) due to unsupported real kind used for
QuKi
. The compiler error message isI can workaround for now by using the following patch. However, this is not a robust fix. Given the coupling using C++ API, I don't believe
-DDOUBLE_PRECISION:BOOL=OFF
is a viable option.OpenFAST commit: 5aacf65
System information:
CMake configure command
The text was updated successfully, but these errors were encountered: