wrf-model / WRF

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

PGI 19.10 WRF Installation "undefined reference" Problem #1272

Open MrGranddy opened 4 years ago

MrGranddy commented 4 years ago

Hello, I'm trying to build WRF with PGI 19.10, I've tried several different dependency versions and also several WRF versions. I get the same error over and over again.

time mpif90 -o ndown.exe -mp -Minfo=mp -Mrecursive -O3  -w -Mfree -byteswapio -mp -Minfo=mp -Mrecursive     ndown_em.o  ../dyn_em/module_initialize_real.o libwrflib.a /ssd2/WRF/src/WRF-4.2.1/external/fftpack/fftpack5/libfftpack.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib1/libio_grib1.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib_share/libio_grib_share.a /ssd2/WRF/src/WRF-4.2.1/external/io_int/libwrfio_int.a -L/ssd2/WRF/src/WRF-4.2.1/external/esmf_time_f90 -lesmf_time /ssd2/WRF/src/WRF-4.2.1/external/RSL_LITE/librsl_lite.a /ssd2/WRF/src/WRF-4.2.1/frame/module_internal_header_util.o /ssd2/WRF/src/WRF-4.2.1/frame/pack_utils.o -L/ssd2/WRF/src/WRF-4.2.1/external/io_netcdf -lwrfio_nf -L/ssd2/WRF/LIBRARIES/netcdf/lib -lnetcdff -lnetcdf       
libwrflib.a(module_check_a_mundo.o): In function `module_check_a_mundo_check_nml_consistency_':
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:375: undefined reference to `bep_ndm_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:376: undefined reference to `bep_nz_um_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:377: undefined reference to `bep_ng_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:378: undefined reference to `bep_nwr_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:381: undefined reference to `bep_bem_ndm_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:382: undefined reference to `bep_bem_nz_um_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:383: undefined reference to `bep_bem_ng_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:384: undefined reference to `bep_bem_nwr_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:385: undefined reference to `bep_bem_nf_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:386: undefined reference to `bep_bem_ngb_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:387: undefined reference to `bep_bem_nbui_max_'
libwrflib.a(start_em.o): In function `start_domain_em_':
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1065: undefined reference to `module_physics_init_phy_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1305: undefined reference to `module_sf_noahmpdrv_groundwater_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1343: undefined reference to `module_lightning_driver_lightning_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2181: undefined reference to `module_diag_pld_pld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2228: undefined reference to `module_diag_zld_zld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2284: undefined reference to `module_trad_fields_trad_fields_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2346: undefined reference to `module_fr_fire_driver_wrf_fire_driver_em_init_'
Command exited with non-zero status 2
0.19user 0.07system 0:00.26elapsed 100%CPU (0avgtext+0avgdata 73032maxresident)k
0inputs+58568outputs (0major+19436minor)pagefaults 0swaps
make[1]: [Makefile:33: em_real] Error 2 (ignored)
time mpif90 -o tc.exe -mp -Minfo=mp -Mrecursive -O3  -w -Mfree -byteswapio -mp -Minfo=mp -Mrecursive     tc_em.o  ../dyn_em/module_initialize_real.o libwrflib.a /ssd2/WRF/src/WRF-4.2.1/external/fftpack/fftpack5/libfftpack.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib1/libio_grib1.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib_share/libio_grib_share.a /ssd2/WRF/src/WRF-4.2.1/external/io_int/libwrfio_int.a -L/ssd2/WRF/src/WRF-4.2.1/external/esmf_time_f90 -lesmf_time /ssd2/WRF/src/WRF-4.2.1/external/RSL_LITE/librsl_lite.a /ssd2/WRF/src/WRF-4.2.1/frame/module_internal_header_util.o /ssd2/WRF/src/WRF-4.2.1/frame/pack_utils.o -L/ssd2/WRF/src/WRF-4.2.1/external/io_netcdf -lwrfio_nf -L/ssd2/WRF/LIBRARIES/netcdf/lib -lnetcdff -lnetcdf       
libwrflib.a(start_em.o): In function `start_domain_em_':
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1065: undefined reference to `module_physics_init_phy_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1305: undefined reference to `module_sf_noahmpdrv_groundwater_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1343: undefined reference to `module_lightning_driver_lightning_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2181: undefined reference to `module_diag_pld_pld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2228: undefined reference to `module_diag_zld_zld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2284: undefined reference to `module_trad_fields_trad_fields_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2346: undefined reference to `module_fr_fire_driver_wrf_fire_driver_em_init_'
Command exited with non-zero status 2
0.19user 0.07system 0:00.26elapsed 99%CPU (0avgtext+0avgdata 72300maxresident)k
0inputs+57352outputs (0major+20637minor)pagefaults 0swaps
make[1]: [Makefile:34: em_real] Error 2 (ignored)
time mpif90 -o real.exe -mp -Minfo=mp -Mrecursive -O3  -w -Mfree -byteswapio -mp -Minfo=mp -Mrecursive     real_em.o ../dyn_em/module_initialize_real.o libwrflib.a /ssd2/WRF/src/WRF-4.2.1/external/fftpack/fftpack5/libfftpack.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib1/libio_grib1.a /ssd2/WRF/src/WRF-4.2.1/external/io_grib_share/libio_grib_share.a /ssd2/WRF/src/WRF-4.2.1/external/io_int/libwrfio_int.a -L/ssd2/WRF/src/WRF-4.2.1/external/esmf_time_f90 -lesmf_time /ssd2/WRF/src/WRF-4.2.1/external/RSL_LITE/librsl_lite.a /ssd2/WRF/src/WRF-4.2.1/frame/module_internal_header_util.o /ssd2/WRF/src/WRF-4.2.1/frame/pack_utils.o -L/ssd2/WRF/src/WRF-4.2.1/external/io_netcdf -lwrfio_nf -L/ssd2/WRF/LIBRARIES/netcdf/lib -lnetcdff -lnetcdf       
libwrflib.a(module_check_a_mundo.o): In function `module_check_a_mundo_check_nml_consistency_':
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:375: undefined reference to `bep_ndm_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:376: undefined reference to `bep_nz_um_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:377: undefined reference to `bep_ng_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:378: undefined reference to `bep_nwr_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:381: undefined reference to `bep_bem_ndm_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:382: undefined reference to `bep_bem_nz_um_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:383: undefined reference to `bep_bem_ng_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:384: undefined reference to `bep_bem_nwr_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:385: undefined reference to `bep_bem_nf_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:386: undefined reference to `bep_bem_ngb_u_'
/ssd2/WRF/src/WRF-4.2.1/share/module_check_a_mundo.f90:387: undefined reference to `bep_bem_nbui_max_'
libwrflib.a(start_em.o): In function `start_domain_em_':
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1065: undefined reference to `module_physics_init_phy_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1305: undefined reference to `module_sf_noahmpdrv_groundwater_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:1343: undefined reference to `module_lightning_driver_lightning_init_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2181: undefined reference to `module_diag_pld_pld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2228: undefined reference to `module_diag_zld_zld_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2284: undefined reference to `module_trad_fields_trad_fields_'
/ssd2/WRF/src/WRF-4.2.1/dyn_em/start_em.f90:2346: undefined reference to `module_fr_fire_driver_wrf_fire_driver_em_init_'
Command exited with non-zero status 2
0.19user 0.08system 0:00.27elapsed 99%CPU (0avgtext+0avgdata 73876maxresident)k
0inputs+58184outputs (0major+21636minor)pagefaults 0swaps
make[1]: [Makefile:35: em_real] Error 2 (ignored)
make[1]: Leaving directory '/ssd2/WRF/src/WRF-4.2.1/main'
( cd test/em_real ; /bin/rm -f wrf.exe ; ln -s ../../main/wrf.exe . )

Tracing the first error I find: make[3]: [../configure.wrf:353: module_ra_goddard.o] Error 2 (ignored)

Then later I found an error message "module_ra_goddard.o" not found. I presume the undefined references also come from this object code yet I couldn't figure it out and working on it for several days now.

sudo chmod -R 777 /usr/local/
sudo chmod -R 777 /ssd2/

wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-c-4.7.4.tar.gz
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.5.2.tar.gz

tar xzvf netcdf-c-4.7.4.tar.gz
cd netcdf-c-4.7.4
CC=pgcc CXX=pgc++ FC=pgfortran CPPFLAGS="-fPIC -DpgiFortran" \
./configure --prefix=/ssd2/WRF/LIBRARIES/netcdf --disable-netcdf4 \
--disable-shared --disable-dap
make -j2
make install
cd ..

bashrc -> export LD_LIBRARY_PATH=/ssd2/WRF/LIBRARIES/netcdf/lib:$LD_LIBRARY_PATH;

tar xzvf netcdf-fortran-4.5.2.tar.gz
cd netcdf-fortran-4.5.2
CC=pgcc CXX=pgc++ FC=pgfortran CPPFLAGS="-fPIC -DpgiFortran -I/ssd2/WRF/LIBRARIES/netcdf/include" \
LDFLAGS="-L/ssd2/WRF/LIBRARIES/netcdf/lib" ./configure --prefix=/ssd2/WRF/LIBRARIES/netcdf
make
make install

bashrc ->

export PATH=/ssd2/WRF/LIBRARIES/netcdf/bin:$PATH;
export NETCDF=/ssd2/WRF/LIBRARIES/netcdf;

wget http://www.zlib.net/fossils/zlib-1.2.11.tar.gz
tar xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
CC=pgcc CXX=pgc++ FC=pgfortran ./configure --prefix=/ssd2/WRF/LIBRARIES/zlib
make -j2
make install

wget https://jztkft.dl.sourceforge.net/project/libpng/libpng16/1.6.37/libpng-1.6.37.tar.gz
tar xzvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
CC=pgcc CXX=pgc++ FC=pgfortran CPPFLAGS="-I/ssd2/WRF/LIBRARIES/zlib/include" \
LDFLAGS="-L/ssd2/WRF/LIBRARIES/zlib/lib" ./configure --prefix=/ssd2/WRF/LIBRARIES/libpng
make -j2
make install

bashrc -> export LD_LIBRARY_PATH=/ssd2/WRF/LIBRARIES/libpng/lib:$LD_LIBRARY_PATH;

cd ..
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-2.0.10.tar.gz
tar -xvzf jasper-2.0.10.tar.gz
cmake -G "Unix Makefiles" -H/ssd2/WRF/src/jasper-2.0.10 -B/ssd2/WRF/src/jasper-2.0.10-build
cd jasper-2.0.10-build/
make install

bashrc -> 
export PATH=/ssd2/WRF/LIBRARIES/jasper/bin:$PATH;
export LD_LIBRARY_PATH=/ssd2/WRF/LIBRARIES/jasper/lib64:$LD_LIBRARY_PATH;

terminal->
export MALLOC_CHECK_=0;
export WRFIO_NCD_LARGE_FILE_SUPPORT=1;

cd ..
wget https://codeload.github.com/wrf-model/WRF/tar.gz/v4.2.1
tar -xvzf v4.2.1
cd WRF-4.2.1
./configure
"4" "1"

configure.wrf açılır -> 

CPPFLAGS        =    $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) -DpgiFortran

./compile em_real>&cc&
tail -f cc

Here are the steps I follow when I'm installing WRF, I also tried several other netcdf etc, with jasper or not etc. All pg and mpi compilers are from PGI 19.10 community edition

I also have a computer that installed WRF with PGI 19.5 and I suspect this problem is related to pgi mpif90 yet since it is not community edition I can't test with that. When configuring WRF I select "55" and "1" yet I tried with a lot more configuration settings, same result with PGI.

Here are the operating system details:

NAME="CentOS Linux" VERSION="8 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="8"

MrGranddy commented 4 years ago

Exactly the same problems with: smpar PGI (pgf90/gcc) dm+sm PGI (pgf90/pgcc) dm+sm PGI (pgf90/gcc)

weiwangncar commented 4 years ago

@MrGranddy Please post this to the Forum: https://forum.mmm.ucar.edu/. Thanks.