WRF compile problem: undefined reference to 'xxx'

Dear all,
I am doing WRF3.2 compiling.
I typed the following in the command line: ./configure, and I chose 11 (dmpar) INTEL (ifort with icc), it succeeded.
However, when I typed the following in the command line: ./compile em_real >&log.compile , I got the following errors (see in WRF-comile.txt):

make[1]: [em_real] Error 1 (ignored)

I installed hdf5-1.10.4, mpich-4.0.2, netcdf-3.6.3, ioapi-3.2, libpng-1.6.37 and zlib-1.2.11 .

~/.bashrc
source /opt/intel/oneapi/setvars.sh intel64
export CC=icx
export CXX=icpx
export FC=ifort
export CFLAGS=-m64-diag-disable=10441
export F77=ifort
export FFLAGS=-m64
export DIR=/disk2/public/usr_local
export F90=ifort
export AR=xiar
export LD=xild

I would appreciate it if you would take the time out of your busy schedule to check out my posts and give suggestions.
Best regards,
Janice
.bashrc.txt (1.1 KB)
configure.wrf.txt (20.6 KB)
WRF-compile.txt (61.9 KB)

This one also looks like you need -lnetcdff -lnetcdf instead of just -lnetcdf. See https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4

the version of netcdf is 3.6.3, it won’t generate the lnecdff.a file.

When netCDF was configured, did whoever did it disable the Fortran interfaces?

I am not sure if I happen to disable the Fortran interfaces.

I used the following commands to install:

./configure --prefix=$DIR/netcdf |& tee c.log
make |& tee m.log
make check |& tee mc.log
make install |& tee mi.log

Also, I don’t know if the file in packages disable the Fortran interfaces. Since netcdf-3.6.3 isn’t available online, I copied the netcdf-3.6.3.tar.gz package from other servers. So I post the compile file and the configure file in the tar.gz package.
the ‘compile’ file in ‘netcdf.tar.gz’.txt (3.6 KB)
the ‘configure’ file in ‘netcdf.tar.gz’.txt (1.0 MB)
m.log.txt (28.6 KB)
mc.log.txt (69.3 KB)
mi.log.txt (20.8 KB)

What does the command
nm libnetcdf | grep nf_
say?

here is the netcdf-3.6.3.tar.gz I used:

password:tnkh

its size is over the upload limit (8 M), so I use a link to share.

Oops – I hadn’t had my coffee yet.

Go to the directory that contains libnetcdf.a and then issue the command
nm libnetcdf.a | grep nf_

Haha, take your time and enjoy your coffee :smiley: .
It is so kind of you, I’m so grateful for your help.

find / -name "libnetcdf.a"
/disk2/public/usr_local/LIBRARIES/netcdf/lib/libnetcdf.a
/disk2/public/usr_local/LIBRARIES/netcdf-3.6.3/libsrc/.libs/libnetcdf.a

cd /disk2/public/usr_local/LIBRARIES/netcdf/lib/
nm libnetcdf.a | grep nf_
0000000000000bb0 T nf_get_att_double_
0000000000000770 T nf_get_att_int_
0000000000000330 T nf_get_att_int1_
0000000000000550 T nf_get_att_int2_
0000000000000990 T nf_get_att_real_
0000000000000110 T nf_get_att_text_
0000000000000a90 T nf_put_att_double_
0000000000000650 T nf_put_att_int_
0000000000000210 T nf_put_att_int1_
0000000000000430 T nf_put_att_int2_
0000000000000870 T nf_put_att_real_
0000000000000000 T nf_put_att_text_
0000000000000980 T nf_abort_
00000000000004e0 T nf_close_
0000000000000110 T nf__create_
0000000000000000 T nf_create_
00000000000005e0 T nf__create_mp_
00000000000004f0 T nf_delete_
0000000000000850 T nf_delete_mp_
00000000000004b0 T nf__enddef_
00000000000004a0 T nf_enddef_
0000000000000960 T nf_inq_base_pe_
0000000000000350 T nf__open_
0000000000000240 T nf_open_
0000000000000720 T nf__open_mp_
0000000000000490 T nf_redef_
0000000000000950 T nf_set_base_pe_
0000000000000990 T nf_set_default_format_
0000000000000470 T nf_set_fill_
00000000000004d0 T nf_sync_
0000000000000000 T nf_def_dim_
0000000000000240 T nf_inq_dim_
0000000000000120 T nf_inq_dimid_
00000000000004f0 T nf_inq_dimlen_
00000000000003a0 T nf_inq_dimname_
0000000000000520 T nf_rename_dim_
00000000000005b0 T nf_copy_att_
00000000000008c0 T nf_del_att_
0000000000000000 T nf_inq_att_
0000000000000130 T nf_inq_attid_
0000000000000350 T nf_inq_attlen_
0000000000000460 T nf_inq_attname_
0000000000000240 T nf_inq_atttype_
00000000000006d0 T nf_rename_att_
0000000000000000 T nf_inq_
0000000000000100 T nf_inq_format_
00000000000000b0 T nf_inq_natts_
0000000000000070 T nf_inq_ndims_
0000000000000090 T nf_inq_nvars_
00000000000000d0 T nf_inq_unlimdim_
0000000000000780 T nf_copy_var_
0000000000000000 T nf_def_var_
0000000000000150 T nf_inq_var_
00000000000005f0 T nf_inq_vardimid_
0000000000000330 T nf_inq_varid_
0000000000000440 T nf_inq_varname_
0000000000000640 T nf_inq_varnatts_
00000000000005c0 T nf_inq_varndims_
0000000000000590 T nf_inq_vartype_
0000000000000670 T nf_rename_var_
0000000000000000 T nf_inq_libvers_
0000000000000120 T nf_issyserr_
0000000000000130 T nf_strerror_
00000000000000b0 T nf_get_var_double_
0000000000000070 T nf_get_var_int_
0000000000000030 T nf_get_var_int1_
0000000000000050 T nf_get_var_int2_
0000000000000090 T nf_get_var_real_
0000000000000010 T nf_get_var_text_
00000000000000a0 T nf_put_var_double_
0000000000000060 T nf_put_var_int_
0000000000000020 T nf_put_var_int1_
0000000000000040 T nf_put_var_int2_
0000000000000080 T nf_put_var_real_
0000000000000000 T nf_put_var_text_
0000000000000410 T nf_get_var1_
0000000000000370 T nf_get_var1_double_
0000000000000230 T nf_get_var1_int_
00000000000000f0 T nf_get_var1_int1_
0000000000000190 T nf_get_var1_int2_
00000000000002d0 T nf_get_var1_real_
0000000000000050 T nf_get_var1_text_
00000000000003c0 T nf_put_var1_
0000000000000320 T nf_put_var1_double_
00000000000001e0 T nf_put_var1_int_
00000000000000a0 T nf_put_var1_int1_
0000000000000140 T nf_put_var1_int2_
0000000000000280 T nf_put_var1_real_
0000000000000000 T nf_put_var1_text_
00000000000005b0 T nf_get_vara_
00000000000004d0 T nf_get_vara_double_
0000000000000310 T nf_get_vara_int_
0000000000000150 T nf_get_vara_int1_
0000000000000230 T nf_get_vara_int2_
00000000000003f0 T nf_get_vara_real_
0000000000000070 T nf_get_vara_text_
0000000000000540 T nf_put_vara_
0000000000000460 T nf_put_vara_double_
00000000000002a0 T nf_put_vara_int_
00000000000000e0 T nf_put_vara_int1_
00000000000001c0 T nf_put_vara_int2_
0000000000000380 T nf_put_vara_real_
0000000000000000 T nf_put_vara_text_
0000000000000840 T nf_get_varm_double_
0000000000000540 T nf_get_varm_int_
0000000000000240 T nf_get_varm_int1_
00000000000003c0 T nf_get_varm_int2_
00000000000006c0 T nf_get_varm_real_
00000000000000c0 T nf_get_varm_text_
0000000000000780 T nf_put_varm_double_
0000000000000480 T nf_put_varm_int_
0000000000000180 T nf_put_varm_int1_
0000000000000300 T nf_put_varm_int2_
0000000000000600 T nf_put_varm_real_
0000000000000000 T nf_put_varm_text_
0000000000000820 T nf_get_vars_
00000000000006e0 T nf_get_vars_double_
0000000000000460 T nf_get_vars_int_
00000000000001e0 T nf_get_vars_int1_
0000000000000320 T nf_get_vars_int2_
00000000000005a0 T nf_get_vars_real_
00000000000000a0 T nf_get_vars_text_
0000000000000780 T nf_put_vars_
0000000000000640 T nf_put_vars_double_
00000000000003c0 T nf_put_vars_int_
0000000000000140 T nf_put_vars_int1_
0000000000000280 T nf_put_vars_int2_
0000000000000500 T nf_put_vars_real_
0000000000000000 T nf_put_vars_text_

When I configure gcc-4.4.7, I set C and C++ as the enabled languages.
Does it relate to these problems?

gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc -enable-threads=posix -disable-checking -disable-multilib -enable-languages=*c,c++* --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/mpfr --with-mpc=/usr/local/mpc
Thread model: posix
gcc version 4.4.7 (GCC)