wrf-model / WRF

The official repository for the Weather Research and Forecasting (WRF) model
Other
1.23k stars 676 forks source link

Failed to compile wrf@4.4.2 using spack management on openEuler22_aarch64 #1819

Open Tom-python0121 opened 1 year ago

Tom-python0121 commented 1 year ago

Describe the bug Failed to compile wrf@4.4.2 using spack management on openEuler22_aarch64

To Reproduce Steps to reproduce the behavior:

  1. Use compiler and version '4.4.2'
  2. Use namelist options '....'
  3. Output is '....'

Expected behavior The compilation is successful in openeuler22_aarch64.

Steps to reproduce the issue

[root@localhost ~]#spack arch
linux-openeuler22-aarch64
[root@localhost ~]#spack install --keep-stage -v wrf@4.4.2
……
==========================================================================
build started:   Thu Feb  9 08:42:14 PM CST 2023
build completed: Thu Feb 9 08:48:35 PM CST 2023

---> Problems building executables, look for errors in the build log  <---

==========================================================================

wrf_io.f:1517:36:

 1517 |   CALL ext_ncd_open_for_read_begin( DatasetName, Comm1, Comm2, SysDepInfo, DataHandle, Status )
      |                                    1
Error: Dummy argument ‘datasetname’ with INTENT(IN) in variable definition context (actual argument to INTENT = OUT/INOUT) at (1)
wrf_io.f:7543:58:

 3196 |       stat = NF_PUT_ATT_INT (DH%NCID,NF_GLOBAL,Element,NF_INT,Count,Data)
      |                                                                    2
......
 7543 |     stat = NF_PUT_ATT_INT(NCID,VarID,'FieldType',NF_INT,1,FieldType)
      |                                                          1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
wrf_io.f:7605:71:

 7605 |                                                    ,i1,i2,j1,j2,k1,k2 )
      |                                                                       1
Error: Type mismatch in argument ‘field’ at (1); passed INTEGER(4) to REAL(8)
wrf_io.f:7744:49:

 2538 |     stat = NF_GET_ATT_INT (DH%NCID,NF_GLOBAL,Element,Buffer)
      |                                                     2
......
 7744 |     stat = NF_GET_ATT_INT(NCID,VarID,'FieldType',FType)
      |                                                 1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
wrf_io.f:8206:52:

 2538 |     stat = NF_GET_ATT_INT (DH%NCID,NF_GLOBAL,Element,Buffer)
      |                                                     2
......
 8206 |     stat = NF_GET_ATT_INT(DH%NCID,VarID,'FieldType',WrfType)
      |                                                    1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
make[3]: [makefile:28: wrf_io.o] Error 1 (ignored)
field_routines.f:156:52:

  108 |     stat = NF_PUT_VARA_INT(NCID,VarID,VStart,VCount,Data)
      |                                                    2
......
  156 |     stat = NF_PUT_VARA_INT(NCID,VarID,VStart,VCount,Buffer)
      |                                                    1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-3)
field_routines.f:158:52:

  110 |     stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Data)
      |                                                    2
......
  158 |     stat = NF_GET_VARA_INT(NCID,VarID,VStart,VCount,Buffer)
      |                                                    1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-3)
make[3]: [makefile:66: field_routines.o] Error 1 (ignored)
ar: wrf_io.o: No such file or directory
make[3]: [makefile:19: libwrfio_nf.a] Error 1 (ignored)
ranlib: 'libwrfio_nf.a': No such file
make[3]: [makefile:20: libwrfio_nf.a] Error 1 (ignored)
wrf_io.f:12754:44:

12754 |   stat = NFMPI_INQ_DIMLEN(DH%NCID,DimIDs(1),VLen(1))
      |                                            1
......
79859 |     stat = NFMPI_INQ_DIMLEN(NCID,DimIDs(1),Len1_okind)
      |                                           2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/INTEGER(8)).
wrf_io.f:12767:44:
……
Fatal Error: Cannot open module file ‘module_initialize_real.mod’ for reading at (1): No such file or directory
compilation terminated.
Command exited with non-zero status 1
0.11user 0.01system 0:00.13elapsed 99%CPU (0avgtext+0avgdata 32228maxresident)k
0inputs+0outputs (0major+5838minor)pagefaults 0swaps
make[1]: [../configure.wrf:365: real_em.o] Error 1 (ignored)
ranlib: 'libwrflib.a': No such file
make[1]: [Makefile:32: em_real] Error 1 (ignored)
gfortran: error: ndown_em.o: No such file or directory
gfortran: error: ../dyn_em/module_initialize_real.o: No such file or directory
gfortran: error: libwrflib.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/fftpack/fftpack5/libfftpack.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/io_int/libwrfio_int.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/frame/module_internal_header_util.o: No such file or directory
Command exited with non-zero status 1
0.02user 0.00system 0:00.03elapsed 97%CPU (0avgtext+0avgdata 3796maxresident)k
0inputs+0outputs (0major+1162minor)pagefaults 0swaps
make[1]: [Makefile:33: em_real] Error 1 (ignored)
gfortran: error: tc_em.o: No such file or directory
gfortran: error: ../dyn_em/module_initialize_real.o: No such file or directory
gfortran: error: libwrflib.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/fftpack/fftpack5/libfftpack.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/io_int/libwrfio_int.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/frame/module_internal_header_util.o: No such file or directory
Command exited with non-zero status 1
0.02user 0.01system 0:00.03elapsed 100%CPU (0avgtext+0avgdata 3756maxresident)k
0inputs+0outputs (0major+1159minor)pagefaults 0swaps
make[1]: [Makefile:34: em_real] Error 1 (ignored)
gfortran: error: real_em.o: No such file or directory
gfortran: error: ../dyn_em/module_initialize_real.o: No such file or directory
gfortran: error: libwrflib.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/fftpack/fftpack5/libfftpack.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/external/io_int/libwrfio_int.a: No such file or directory
gfortran: error: /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-src/frame/module_internal_header_util.o: No such file or directory
Command exited with non-zero status 1
0.01user 0.01system 0:00.03elapsed 100%CPU (0avgtext+0avgdata 3788maxresident)k
0inputs+0outputs (0major+1160minor)pagefaults 0swaps
make[1]: [Makefile:35: em_real] Error 1 (ignored)

==> Error: InstallError: Compile failed. Check the output log for details.

/home/spack/var/spack/repos/estuary-top500/packages/wrf/package.py:419, in build:
        416            result = self.run_compile_script()
        417
        418        if not result:
  >>    419            raise InstallError("Compile failed. Check the output log for details.")

See build log for details:
  /home/stage/root/spack-stage-wrf-4.4.2-a546ph7tci6fsksqa7pxtw4tfnyiov7c/spack-build-out.txt
[root@localhost ~]#gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-linux-gnu/10.3.1/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags=' -Wl,-z,relro,-z,now' --disable-bootstrap --with-multilib-list=lp64 --enable-bolt
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.1 (GCC)

The wrf@4.4.2 adapts to the following URL in the spack:https://github.com/spack/spack/blob/02d3bd782d22d91aa8b18529db197efc749846ec/var/spack/repos/builtin/packages/wrf/package.py

Can you help me see what caused it to fail?

MichaelLaufer commented 1 year ago

Hi @Tom-python0121 please open an issue in the spack repo.

Also, please provide information regarding the compiler that spack is attempting to use. Please provid the output of:

spack spec wrf@4.4.2
Tom-python0121 commented 1 year ago

spack issuse:https://github.com/spack/spack/issues/35454