Skip to content
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

Build fail with GCC and OpenMPI (FAST_BYTESWAP) #658

Open
slacalle opened this issue Oct 14, 2022 · 6 comments
Open

Build fail with GCC and OpenMPI (FAST_BYTESWAP) #658

slacalle opened this issue Oct 14, 2022 · 6 comments

Comments

@slacalle
Copy link

slacalle commented Oct 14, 2022

Build is failing compiling against:

  • GCC 11.3.0
  • Openmpi 4.1.4
  • netCDF 4.9.0
  • using "linux_amd64_gfortran" build_options file.
make[1]:` Entering directory '/home/user/L2_MITgcm/experiments/v8/build'
mpif77 -fconvert=big-endian -fimplicit-none -fallow-argument-mismatch -mcmodel=medium  -O3 -funroll-loops  -c mds_byteswapi4.f
mds_byteswapi4.f:268:27:

  268 |      &         ishft(i.and. z'000000ff',  24)
      |                           1
Error: Operands of logical operator ‘.and.’ at (1) are INTEGER(4)/BOZ
make[1]: *** [Makefile:1547: mds_byteswapi4.o] Error 1
make[1]: Leaving directory '/home/user/L2_MITgcm/experiments/v8/build'
make: *** [Makefile:1460: fwd_exe_target] Error 2

The section in question for that file is:

      subroutine MDS_BYTESWAPI4( n, arr )
C IN:
C   n      integer    :: Number of 4-byte words in arr
C IN/OUT:
C   arr    integer*4  :: Array declared as integer*4(n)
C
C Created: 05/05/99 adcroft@mit.edu (This is an unfortunate hack!!)

      implicit none


C Arguments
      integer n
      integer(kind=4) arr(n), i32

C Local
      integer i

      i32(i) = ishft(i.and. z'ff000000', -24) .or.
     &         ishft(i.and. z'00ff0000',  -8) .or.
     &         ishft(i.and. z'0000ff00',   8) .or.
     &         ishft(i.and. z'000000ff',  24)
      do i = 1,n
      arr(i) = i32(arr(i))
      enddo


      return
      end
@mjlosch
Copy link
Member

mjlosch commented Oct 14, 2022

This is the FAST_BYTESWAP part of the code. When compiling with -fconvert=big-endian, the byte swap code (written at a time, when some compilers could do the byteswapping on their own) is not used (just compiled), so defining the flag FAST_BYTESWAP has no effect and should not be changed from the undef-default.

Other than that, I do not know, if this option was ever used anywhere else than on the (now retired) Altix (@menemenlis ?).

@menemenlis
Copy link
Member

menemenlis commented Oct 14, 2022 via email

@mjlosch
Copy link
Member

mjlosch commented Oct 17, 2022

@menemenlis
I suggest that we remove this code, as it does not seem to work (anymore).

@menemenlis
Copy link
Member

menemenlis commented Oct 20, 2022 via email

@mjlosch
Copy link
Member

mjlosch commented Oct 20, 2022

@menemenlis I'd be happy, if you can do this. I'll review (-:

@jm-c
Copy link
Member

jm-c commented Feb 28, 2023

As we are waiting for @menemenlis PR, I will update the title of this issue by adding the magic word FAST_BYTESWAP

@jm-c jm-c changed the title Build fail with GCC and OpenMPI Build fail with GCC and OpenMPI (FAST_BYTESWAP) Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants