Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Is it possible to compile WRF 4.4.1 with WPS 4.4 with GNU compilers _SMPAR_ without MPICH?

cupy

New member
Selected 33 GNU smpar, have one cpu with 6 cores 2 threads each, my host is Ubuntu 20.04. Using distro package libs etc as much as pos as I'm onld school and tend not to compile stuff that has native distro packages, unless there is a good and well justified reason.

(that includes netcdf, have 4.7.3-1:
dpkg -la | grep netcdf
ii libnetcdf-dev 1:4.7.3-1 amd64 creation, access, and sharing of scientific data
ii libnetcdf15:amd64 1:4.7.3-1 amd64 Interface for scientific data access to large binary data
ii libnetcdff-dev 4.5.2+ds-1build2 amd64 creation, access, and sharing of scientific data in Fortr
an
ii libnetcdff7 4.5.2+ds-1build2 amd64 Fortran interface for scientific data access to large bin
ary data
ii netcdf-bin 1:4.7.3-1 amd64 Programs for reading and writing NetCDF files)

Found some notes from earlier compilations (eg WRF 4.3) where the only way to get it compiled on PC workstation was use MPICH+OpenMP (smpar+dmpar) anyway, although that principially should not be needed. Now I have to run it through "mpirun -np 1 wrf.exe". And did not find any way to control topology of mapping the 'tiles' to 12 cpu cores - OpenMP does 1x12 rather than 4x3 I specify in namelist.input (nproc_x, nproc_x)

Getting this error while compiling WRF 4.4.1 - missing nf_* stuff. What is that nf_*? Is it connected with me trying to avoid use dmpar on SMP box? Or because of insisting on using distro package netcdf?

Code:
/usr/bin/ld: wrf_io.o: in function `__ext_ncd_support_routines_MOD_netcdf_err.part.0':
wrf_io.f.text+0x9c06): undefined reference to `nf_strerror_'
/usr/bin/ld: wrf_io.o: in function `__ext_ncd_support_routines_MOD_gettimeindex':
wrf_io.f.text+0xcbcd): undefined reference to `nf_put_vara_text_'
/usr/bin/ld: wrf_io.o: in function `ext_ncd_get_var_td_char_':
wrf_io.f.text+0x10a2b): undefined reference to `nf_inq_varid_'

/usr/bin/ld: libwrflib.a(module_trajectory.o): in function `__module_trajectory_MOD_handle_ncerr.part.0':
module_trajectory.f90.text+0x8a5): undefined reference to `nf_strerror_'
/usr/bin/ld: libwrflib.a(module_trajectory.o): in function `def_vars.30619':
module_trajectory.f90.text+0x1d50): undefined reference to `nf_def_var_'

wrf_io.f.text+0x9c06): undefined reference to `nf_strerror_'
wrf_io.f.text+0xcbcd): undefined reference to `nf_put_vara_text_'
wrf_io.f.text+0x10a2b): undefined reference to `nf_inq_varid_'
/usr/bin/ld: wrf_io.f.text+0x10a7c): undefined reference to `nf_inq_var_'
/usr/bin/ld: wrf_io.f.text+0x1106a): undefined reference to `nf_inq_dimlen_'
/usr/bin/ld: wrf_io.f.text+0x11136): undefined reference to `nf_get_vara_text_'
wrf_io.f.text+0x11c27): undefined reference to `nf_inq_varid_'
/usr/bin/ld: wrf_io.f.text+0x11c77): undefined reference to `nf_inq_var_'
/usr/bin/ld: wrf_io.f.text+0x1235d): undefined reference to `nf_inq_dimlen_'
/usr/bin/ld: wrf_io.f.text+0x12438): undefined reference to `nf_get_vara_int_'
wrf_io.f.text+0x13227): undefined reference to `nf_inq_varid_'
/usr/bin/ld: wrf_io.f.text+0x13277): undefined reference to `nf_inq_var_'
/usr/bin/ld: wrf_io.f.text+0x1395d): undefined reference to `nf_inq_dimlen_'
/usr/bin/ld: wrf_io.f.text+0x13a35): undefined reference to `nf_get_vara_double_'
wrf_io.f.text+0x14747): undefined reference to `nf_inq_varid_'
 
Last edited:
If I understand correctly, you'd like to just compile with the smpar option, correct? It should be possible to do that with only OpenMP. The error you're showing seems to indicate something is wrong with your netcdf. It could be that the netcdf you're pointing to in your path isn't the one that was compiled with the compiler you're using for WRF, or perhaps you don't have netcdf in your path. Take a look at this site to ensure you have everything installed correctly. Of course it's referencing an MPICH installation, but you can ignore that. The more important part is NetCDF.

If it's still failing after you've ensured all your libraries are installed correctly, please attach your configure.wrf file, and your full compile log. Thanks!
 
Thank you for reply, kwerner.

Yes I need smpar only on a (multi core) single cpu box.
When I was compiling V.4.3 earlier, about a year or so ago, on the same PC, I had to use dmpar+smpar, otherwise it would not build.
Compiling against the same version of NetCDF as now, and was successful.

FYI, As a good admin practice, I'm trying to avoid compiling libs and stuff when there exists a distro package, which is the case with NetCDF on Ubuntu 20.04 LTS. But perhaps the package is missing smpar version of the library to link with?

OK I'll compile NetCDF from source myself then and will try if that links together to build WRF in smpar.
 
Top