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

WRF-v4.3.3 compilation on macOS Monterey Version 12.1

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.

Rajarshi Sharma

New member

I am new to WRF and trying to install it in macOS.

I have successfully installed all my libraries and done compatibility tests. Also configured WRF-v4.3.3 (latest bug-fixed version).

But I am unable to generate the executables. Compilation not successful.

I have attached the compile.log file.

Thanks in advance.


  • log.compile
    1.1 MB · Views: 22
Hi Raj,
The first error message in your log file is
gcc  -I. -w -O3 -c  -DMACOS  -DDM_PARALLEL -DLANDREAD_STUB=1 -DMAX_HISTORY=25 -DNMM_CORE=0 -I/Users/rajarshisharma/Build_WRF/LIBRARIES/grib2/include   -c dec_jpeg2000.c
enc_jpeg2000.c:142:11: error: no member named 'inmem_' in 'jas_image_t'
    ~~~~~ ^
1 error generated.
make[5]: [enc_jpeg2000.o] Error 1 (ignored)
which seems strange, and potentially trying to do something with an image file?

1) When you cloned or downloaded WRF, did you put it in its own clean directory?
2) Did you make any sort of modifications to the WRF code prior to compiling?
3) Are there any files or images that shouldn't be in the grib2/include directory?

After checking those items, can you clean the code again and try to recompile?

./clean -a
./compile em_real >& log.compile

Please send the new log.compile file, along with your configure.wrf file. Thanks!
Hi kwerner,

Thanks for responding to my query.

I am compiling WRF-v4.3.3 using grib2 output and I have used jasper-2.0.33 for the purpose.
Please note that the issue might have been faced by other users as well using latest versions of jasper :
I have disabled grib2 output and still getting the same compile error.
Have attached both the log.compile file and configure.wrf file.
Thanks in advance!


  • compile.log
    906.9 KB · Views: 13
  • configure.wrf
    20.8 KB · Views: 13
Hi Raj,
Thank you for the clarification. Can modify the file


and comment out line 142 (image.inmem_=1;), then try to compile again? I believe you'll need to do a "clean -a" and reconfigure again too. Let me know if that makes any difference. Thanks!
Hi kwerner,

Sorry for the late reply.

I tried out many solutions to correct the error but it all turned out that I was using the clang version of gcc and trying to compile the model using normal gcc. MacOS by default uses clang gcc, I did not know that. Anyways, I have now used updated compilers and also used an older version of jasper-1.900.2. This time errors are bit lesser, however executable files are not built even after running for almost 18 minutes.

Can you please provide some suggestions? Attaching the configure and log compile file. I have tried the WRF-v4.3.1 this time.




  • configure.wrf
    20.9 KB · Views: 11
  • log.compile
    981.6 KB · Views: 11
Just to ensure this is a clean build, can you do the following steps?
1) ./clean -a
2) ./configure
3) export J="-j 1" (for bash)
setenv J "-j 1" (for csh/tcsh)
4) ./compile em_real >& log.compile

Then send the new compile log and configure. Make sure you're still using the correct GNU version, as well.

Another thought - since you are using a different (gcc) version of GNU now, you need to make sure all the libraries are now installed with the new GNU, and that all your paths are now pointing to the correct compiler and library paths (following this page).
Hi kwerner,

I have followed the steps as you showed and have attached the files. Regarding the libraries, I have used the same compilers as I have used for the model. Thanks.


  • configure.wrf
    20.9 KB · Views: 9
  • log.compile
    979.6 KB · Views: 9
The errors I'm seeing now are
/var/folders/86/wr56qvpx2pq9b_qr9dzslxn00000gn/T//cc58lzXZ.s:131461:2: error: addend too big for relocation
        add     x7, x24, ___module_mp_p3_MOD_itabcoll_3mom@PAGEOFF+9591676;momd
/var/folders/86/wr56qvpx2pq9b_qr9dzslxn00000gn/T//cc58lzXZ.s:131461:2: error: fixup value out of range
        add     x7, x24, ___module_mp_p3_MOD_itabcoll_3mom@PAGEOFF+9591676;momd
       15.20 real        14.76 user         0.42 sys
make[3]: [module_mp_p3.o] Error 1 (ignored)

I've done a bit of online searching and this seems to always be related to using Homebrew. As you're using a Mac, which comes with a simple terminal window and allows you to install things, can you try to do this without Homebrew and see if that makes any difference?