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

compile error .. landread.c, unknown type name 'XDR'

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
I'm a new user. I will appreciate it if you could give me some comments.

WRF Version: 4.0
Option in configure.wrf: # Compiler choice: 2, # Nesting option: 0

Compilation did not complete. I think that one cause is that landread.o was not created as follows;

2013 landread.c:125:8: error: unknown type name 'XDR'
2014 static XDR *xdrs;
2015 ^~~
2016 landread.c: In function 'tsInitTileSet':
2017 landread.c:405:11: error: 'XDR' undeclared (first use in this function)
2018 xdrs = (XDR *) malloc(sizeof(XDR));
2019 ^~~
2020 landread.c:405:11: note: each undeclared identifier is reported only once f or each function it appears in
2021 landread.c:405:16: error: expected expression before ')' token
2022 xdrs = (XDR *) malloc(sizeof(XDR));
2023 ^
2024 landread.c:406:29: error: 'XDR_DECODE' undeclared (first use in this functi on)
2025 xdrstdio_create(xdrs, fp, XDR_DECODE);
2026 ^~~~~~~~~~
2027 make[2]: [../configure.wrf:372: landread.o] Error 1 (ignored)

There was no rpc/types.h and rpc/xdr.h. So I copied these files from other directory.
Then I did not know whether or not types.h and xdr.h are correct file which the WRF requires.

Could you please tell me what is next matter I should do?
If I should post further information, please tell me.

Thank you very much.
Take a look at this previous forum post that addresses this issue:

If that does not solve the problem, please let us know.
Hi kwerner
Hi all

Thank you very much for your valuable comments.
I could build four exe files.
Maybe I will have a lot of trouble before I obtain appropriate result of simulation.
I will appreciate it if you could any valuable comments.
I'm so glad to hear that the post helped you to compile. Thank you for letting us know.
I'm not sure what specific questions you have about the WRF process. However, there is a lot of information available for new users.

Online Tutorial:

WRF Users’ Guide:

Compilation Tutorial:

Presentations from our WRF tutorial:
(specifically, for a "Best Practices" talk, see:

Technical Note:

Best Practice for Namelists (helps you to make good decisions when setting up your domain and namelist settings:

(and for other information on downloading, etc. you can see) WRF Users’ Home Page: