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

WPS build fails when WRF was compiled with an 'smpar' option #110

Open
mgduda opened this issue Feb 18, 2019 · 9 comments
Open

WPS build fails when WRF was compiled with an 'smpar' option #110

mgduda opened this issue Feb 18, 2019 · 9 comments
Labels

Comments

@mgduda
Copy link
Collaborator

mgduda commented Feb 18, 2019

When WRF was compiled with an smpar option, the WRF I/O API library contains references to OpenMP libraries (e.g., 'GOMP' with the GNU compilers). Because the WPS doesn't support an smpar option and therefore never links the OpenMP library, the build of geogrid.exe and metgrid.exe will fail with errors like:

gfortran   -o geogrid.exe cio.o wrf_debug.o bitarray_module.o constants_module.o module_stringutil.o geogrid.o gridinfo_module.o hash_module.o interp_module.o list_module.o llxy_module.o misc_definitions_module.o module_debug.o module_map_utils.o output_module.o parallel_module.o process_tile_module.o proc_point_module.o queue_module.o read_geogrid.o smooth_module.o source_data_module.o \
        /dev/shm/WPS/../WRF/frame/module_driver_constants.o \
        /dev/shm/WPS/../WRF/frame/pack_utils.o /dev/shm/WPS/../WRF/frame/module_machine.o \
        /dev/shm/WPS/../WRF/frame/module_internal_header_util.o \
        -I/dev/shm/WPS/../WRF/external/io_netcdf -I/dev/shm/WPS/../WRF/external/io_grib_share -I/dev/shm/WPS/../WRF/external/io_grib1 -I/dev/shm/WPS/../WRF/external/io_int -I/dev/shm/WPS/../WRF/inc -I/sysdisk1/duda/Thursday_test/local/include \
        -L/dev/shm/WPS/../WRF/external/io_grib1 -lio_grib1 -L/dev/shm/WPS/../WRF/external/io_grib_share -lio_grib_share -L/dev/shm/WPS/../WRF/external/io_int -lwrfio_int -L/dev/shm/WPS/../WRF/external/io_netcdf -lwrfio_nf -L/sysdisk1/duda/Thursday_test/local/lib -lnetcdff -lnetcdf \

/dev/shm/WPS/../WRF/external/io_netcdf/libwrfio_nf.a(wrf_io.o): In function `__ext_ncd_support_routines_MOD_transpose._omp_fn.0':
wrf_io.f:(.text+0x77): undefined reference to `GOMP_loop_runtime_start'
wrf_io.f:(.text+0x463): undefined reference to `GOMP_loop_runtime_next'
wrf_io.f:(.text+0x470): undefined reference to `GOMP_loop_end_nowait'
/dev/shm/WPS/../WRF/external/io_netcdf/libwrfio_nf.a(wrf_io.o): In function `__ext_ncd_support_routines_MOD_transpose._omp_fn.1':
wrf_io.f:(.text+0x517): undefined reference to `GOMP_loop_runtime_start'
wrf_io.f:(.text+0x901): undefined reference to `GOMP_loop_runtime_next'
wrf_io.f:(.text+0x90e): undefined reference to `GOMP_loop_end_nowait'
/dev/shm/WPS/../WRF/external/io_netcdf/libwrfio_nf.a(wrf_io.o): In function `__ext_ncd_support_routines_MOD_transpose._omp_fn.2':
wrf_io.f:(.text+0x9b5): undefined reference to `GOMP_loop_runtime_start'
wrf_io.f:(.text+0xd7b): undefined reference to `GOMP_loop_runtime_next'
wrf_io.f:(.text+0xd88): undefined reference to `GOMP_loop_end_nowait'
/dev/shm/WPS/../WRF/external/io_netcdf/libwrfio_nf.a(wrf_io.o): In function `__ext_ncd_support_routines_MOD_transpose._omp_fn.3':
wrf_io.f:(.text+0xe25): undefined reference to `GOMP_loop_runtime_start'
wrf_io.f:(.text+0x11e9): undefined reference to `GOMP_loop_runtime_next'
wrf_io.f:(.text+0x11f6): undefined reference to `GOMP_loop_end_nowait'
/dev/shm/WPS/../WRF/external/io_netcdf/libwrfio_nf.a(wrf_io.o): In function `__ext_ncd_support_routines_MOD_transpose._omp_fn.4':
wrf_io.f:(.text+0x1295): undefined reference to `GOMP_loop_runtime_start'
wrf_io.f:(.text+0x1685): undefined reference to `GOMP_loop_runtime_next'
wrf_io.f:(.text+0x1692): undefined reference to `GOMP_loop_end_nowait'
@mgduda mgduda added the bug label Feb 18, 2019
@zephyr213
Copy link

I got the similar error building WPS. Neither dmpar nor dm+sm of WRF build works. I finally built WRF with serial, then the geogrid and metgrid can be built.

@weiwangncar
Copy link
Collaborator

This may not be ideal, but for most purposes, serially compiled WPS should work pretty well.

@yriveiro
Copy link

Same problem here, WRF 4.2.1 with dm+sm:

#22 28.20 /usr/sbin/ld: wrf_io.f:(.text+0x35c7): undefined reference to `GOMP_loop_maybe_nonmonotonic_runtime_next'
#22 28.20 /usr/sbin/ld: /var/lib/wrf/external/io_netcdf/libwrfio_nf.a(wrf_io.o): in function `__ext_ncd_support_routines_MOD_transpose._omp_fn.11':
#22 28.20 wrf_io.f:(.text+0x3a95): undefined reference to `GOMP_loop_maybe_nonmonotonic_runtime_start'

@hermannschwaerzlerUIBK
Copy link

hermannschwaerzlerUIBK commented Sep 18, 2020

I had a similar problem after compiling WRF 4.1 with an Intel compiler using option 14 (smpar).

My solution/workaround was this:

  1. ./clean
  2. ./configure # I chose option "17 ... Intel Compiler (serial)"
  3. edit configure.wps by adding -qopenmp at the end of the lines that set WRF_LIB (after -lnetcdff -lnetcdf)
  4. ./compile >& log.compile

Voila: everything is compiled as expected.

@MichaelLaufer
Copy link

@mgduda @hermannschwaerzlerUIBK
I am seeing this as well with WRF 4.2 compiled with dm+sm. While compiling with dmpar works just fine.

Any idea as to the root cause of this? Has this worked in the past?
Can we add logic to check the WRF configure.wrf file to see if it was compiled with smpar or dm+sm and make the changes?

Is this the place that would need changing in the configure script?
Config.pl location

@B4dWo1f
Copy link

B4dWo1f commented Jun 22, 2021

3. edit _configure.wps_ by adding **-qopenmp** at the end of the lines that set WRF_LIB (after _-lnetcdff -lnetcdf_)

I got an error suggesting that it was -fopenmp rather than "-qopenmp". It worked for me leaving line 107 in configure.wps like this:

-L$(NETCDF)/lib -lnetcdff -lnetcdf -fopenmp

@serbinsh
Copy link

In the chance that this is helpful, I am also running into a bunch of "undefined reference to " errors when trying to build WPS serial, parallel and non grib

However, looking at the comments above I tried editing

WRF_LIB         =       -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
                        -L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
                        -L$(WRF_DIR)/external/io_int -lwrfio_int \
                        -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
                        -L$(NETCDF)/lib -lnetcdff -lnetcdf

to

WRF_LIB         =       -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
                        -L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
                        -L$(WRF_DIR)/external/io_int -lwrfio_int \
                        -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
                        -L$(NETCDF)/lib -lnetcdff -lnetcdf -fopenmp
                        

And it compiled serial, parallel and with grib2. I still need to test it but the exe compiles

@kdo037
Copy link

kdo037 commented Aug 21, 2024

  • ./clean
  • ./configure # I chose option "17 ... Intel Compiler (serial)"
  • edit configure.wps by adding -qopenmp at the end of the lines that set WRF_LIB (after -lnetcdff -lnetcdf)
  • ./compile >& log.compile

It works. Thanks a lot!

@ee1yn
Copy link

ee1yn commented Jan 3, 2025

Why doesn't my configure.wrf have WRF_LIB? WRF Model Version 4.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants