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

Instruction needed to install WRF v4.3.3 on Mac with M1-Max chip and version 13.0.1 Ventura

Update: I just recompiled WRF after creating the symlinks suggested by @Whatheway , and now the WPS compilation works like a charm. Will run some real examples to confirm that everything is working as it should. Thanks a lot, everyone.
Glad to hear it worked for you.
 
Here are the few addition
  • After setting up the WPS and WRF , I tried to run WPS, I got stuck on running the geogrid.exe, it always failed. I check my namelist.wps it seems fine. Then I noticed the error which is not related to namelist.wps it is something related to netcdf because it failed to initiate. I then realise that libraries are installed using apple clang not Homebrew gcc. Although it is mentioned in WRF online tutorial that "one should build libraries using same compiler as he is going to use for WRF and WPS". So, I then reinstall all libraries using Homebrew gcc and build & compile WPS and WRF.
  • Then I struggle with jasper during executing ungrib.exe. WRF tutorial suggested jasper version 1.9 whereas for Mac minimum version was 2.1. I tried with 2.1 and 3.0.6 but it was not helpful (not sure what's the exact problem). So I did a research to install jasper 1.9 , I found a solution in which it suggest to replace "config.guess & config.sub" file from jasper library with automake of Homebrew (config.guess & config.sub).
  • Doing above steps I am able to run WPS (georgid.exe. ungrib.exe and metgrib.exe) and WRF (real.exe and WRF .exe).
    I will now learn how to analyse this output.

View attachment 7750
Could you please give some suggestions about the JasPer installation? My case is: all the libraries except 'jasper' was installed manually, when I 'compile the wps' there is no .exe file generated.
 
Could you please give some suggestions about the JasPer installation? My case is: all the libraries except 'jasper' was installed manually, when I 'compile the wps' there is no .exe file generated.
hello
I am not sure if I had the same issue like you are facing but I can suggest what I done when face jasper related issue.
Please install the Jasper library as recommended on the WRF forum, specifically version 1.9. In order to do this, you will need to copy the "config.guess" and "config.sub" files from the "automake" folder in Homebrew, and paste them into the "aac" folder within the Jasper 1.9 directory where these files are located. You can download Jasper 1.9 from the following link: https://ece.engr.uvic.ca/~frodo/jasper/#download.

This link was helpful in resolving the Jasper library issue: How to resolve configure guessing build type failure?.

please note that I am using Mac with M1-Max and this solution is tested on same machine.
 
hello
I am not sure if I had the same issue like you are facing but I can suggest what I done when face jasper related issue.
Please install the Jasper library as recommended on the WRF forum, specifically version 1.9. In order to do this, you will need to copy the "config.guess" and "config.sub" files from the "automake" folder in Homebrew, and paste them into the "aac" folder within the Jasper 1.9 directory where these files are located. You can download Jasper 1.9 from the following link: https://ece.engr.uvic.ca/~frodo/jasper/#download.

This link was helpful in resolving the Jasper library issue: How to resolve configure guessing build type failure?.

please note that I am using Mac with M1-Max and this solution is tested on same machine.
Hi,
Thanks for your advice!
I have solved the problem by following these steps (btw I am using Mac with M2 chip).
When I compiled the WPS there is no ungrib.exe file. For my case, it's because the wrong setting about the 'JASPERINC' & 'JASPERLIB'.
 
hello
I am not sure if I had the same issue like you are facing but I can suggest what I done when face jasper related issue.
Please install the Jasper library as recommended on the WRF forum, specifically version 1.9. In order to do this, you will need to copy the "config.guess" and "config.sub" files from the "automake" folder in Homebrew, and paste them into the "aac" folder within the Jasper 1.9 directory where these files are located. You can download Jasper 1.9 from the following link: https://ece.engr.uvic.ca/~frodo/jasper/#download.

This link was helpful in resolving the Jasper library issue: How to resolve configure guessing build type failure?.

please note that I am using Mac with M1-Max and this solution is tested on same machine.
Hello,
Another question is: how do you run the compiled exe file on mac? Did you use a virtual machine or something else?

Thanks!
 
Update: I just recompiled WRF after creating the symlinks suggested by @Whatheway , and now the WPS compilation works like a charm. Will run some real examples to confirm that everything is working as it should. Thanks a lot, everyone.
Great to hear
 
I would greatly appreciate it if someone could upload a video of the entire process. For some reason, I am stuck at the NetCDF stage (incompatible version). I have tried using other versions, but unfortunately, I have not seen any improvement in the results.
Best regards
 
Hi, I was doing the jasper installation and after doing the replace of config.guess and config.sub with automake I can configure correctly, but when I run make I got this :

error: implicit declaration of function 'jas_eprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration]

Any Idea how to solve this? (I'm using M3 Pro)
 
This is a known issue with some older versions of Jasper, especially when using modern compilers that are more strict with function declarations. which gcc you are using ? The issue i had was fixed using the below link. and it was on M1 Max.
 

@rcrafa
@Claudio.Iturra
Hi William, I tried to install WRF-MOSIT in both macOS and ubuntu and both failed, in ubuntu is an error that I had when I compile WRF and no getting .exe files and in Mac OS I'm not sure if its the chip of my Mac because its M3 pro Screenshot 2024-10-29 at 6.31.30 PM.png
 
I could install jasper lib but now I have this issue when I configure wrf, it displays this message

checking for perl5... no


checking for perl... found /opt/homebrew/bin/perl (perl)





Will use NETCDF in dir: /Users/rafaelruales/Build_WRF/LIBRARIES/netcdf


ADIOS2 not set in environment. Will configure WRF for use without.


Will use HDF5 in dir: /opt/local/


PHDF5 not set in environment. Will configure WRF for use without.


building WRF with chemistry option


building WRF with KPP chemistry option


Will use 'time' to report timing information








If you REALLY want Grib2 output from WRF, modify the arch/Config.pl script.


Right now you are not getting the Jasper lib, from the environment, compiled into WRF.
and when I compile displays :

starting compile_wkc


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





WKC - WRF-Chem/KPP coupler








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





KPP - symbolic chemistry Kinetics PreProcessor, Version 2.1


(http://www.cs.vt.edu/~asandu/Software/KPP)


KPP is distributed under GPL, the general public licence


(The GNU General Public License v3.0 - GNU Project - Free Software Foundation)


(C) 1995-1997, V. Damian & A. Sandu, CGRER, Univ. Iowa


(C) 1997-2003, A. Sandu, Michigan Tech


(C) 2003-2005, A. Sandu, Virginia Polytechnic Institute and State University


with contributions from:


R. Sander, Max-Planck Institute for Chemistry, Mainz, Germany








The current version of KPP was modified for WRF-Chem.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


------------------------------------------


configure_kpp, settings:


No libfl.a or libfl.so in /opt/local/lib


check if FLEX_LIB_DIR environment variable is set correctly


(FLEX_LIB_DIR should be the complete pathname of the FLEX library libfl.a or libfl.so)


OR: Enter full path to flex library on your system

Any idea how to solve this?
 
I could compile WRF and WPS, I got stuck installing NCL but I resolved using macports. Now im trying to do an example test (hurricane Mathew), it was great the WPS but when I set the WRF real.exe failed, here is my log.


Code:
taskid: 0 hostname: MacBook-Pro-2.local
 ./module_io_quilt_old.F        2931 T
 Ntasks in X            2 , ntasks in Y            2
*************************************
Configuring physics suite 'conus'

         mp_physics:      8
         cu_physics:      6
      ra_lw_physics:      4
      ra_sw_physics:      4
     bl_pbl_physics:      2
  sf_sfclay_physics:      2
 sf_surface_physics:      2
*************************************
  Domain # 1: dx = 27000.000 m
REAL_EM V4.6.1 PREPROCESSOR
git commit d66e442fccc04111067e29274c9f9eaccc3cef28 1 file changed, 3 insertions(+), 3 deletions(-)
 *************************************
 Parent domain
 ids,ide,jds,jde            1          91           1         100
 ims,ime,jms,jme           -4          52          -4          57
 ips,ipe,jps,jpe            1          45           1          50
 *************************************
DYNAMICS OPTION: Eulerian Mass Coordinate
   alloc_space_field: domain            1 ,             136755772  bytes allocated
*** The MPI_Comm_f2c() function was called before MPI_INIT was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.
[MacBook-Pro-2.local:30475] Local abort before MPI_INIT completed completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!

Here is my .bashrc (Compiles WRF (options 17 , 1)

Code:
export DIR=/path_to_dir/Build_WRF/LIBRARIES
export CC=gcc
export CXX=g++
export FC=gfortran
export FCFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export NCDIR=/path_to_dir/Build_WRF/LIBRARIES/netcdf
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
export PATH=/opt/homebrew/Cellar/mpich/4.2.3/bin:$PATH
export DYLD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
export NFDIR=/path_to_dir/Build_WRF/LIBRARIES/netcdf

#---hdf5---
export HDF5=/opt/homebrew/Cellar/hdf5/1.14.5
export HDF5_INCDIR=$HDF5/include
export HDF5_LIBDIR=$HDF5/lib
export LD_LIBRARY_PATH=$HDF5_LIBDIR:$LD_LIBRARY_PATH

#---ADIOS2---
export ADIOS2=/opt/homebrew/Cellar/adios2/2.10.2
export PATH=$ADIOS2/bin:$PATH
export LD_LIBRARY_PATH=$ADIOS2/lib:$LD_LIBRARY_PATH

#---Grib2 and Jasper settings---
export JASPERLIB=/path_to_dir/Build_WRF/LIBRARIES/grib2/lib
export JASPERINC=/path_to_dir/Build_WRF/LIBRARIES/grib2/include

#--- NetCDF and HDF5 with support for NetCDF-4 ---
export DIR=/path_to_dir/Build_WRF/LIBRARIES
export NETCDF=$DIR/netcdf
export PATH=$NETCDF/bin:$HDF5/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF/lib:$HDF5/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I$NETCDF/include -I$HDF5/include"
export LDFLAGS="-L$NETCDF/lib -L$HDF5/lib"
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
export NETCDF_classic=1
ulimit -s unlimited
export MALLOC_CHECK_=0
export EM_CORE=1
export NMM_CORE=0
export WRF_CHEM=0
export WRF_KPP=1
export YACC='/opt/homebrew/bin/yacc -d'
export FLEX='/opt/homebrew/Cellar/flex'
export FLEX_LIB_DIR=/opt/homebrew/Cellar/flex//2.6.4_2/lib/

#---NCL (MacPorts)----
export NCARG_ROOT=/opt/local
export PATH=$NCARG_ROOT/bin:$PATH
export NCARG_LIB=$NCARG_ROOT/lib
export NCARG_RESOURCES=$NCARG_ROOT/lib/ncarg/resfiles
export NCARG_DATABASE=$NCARG_ROOT/lib/ncarg/database
export NCARG_FONTCAPS=$NCARG_ROOT/lib/ncarg/fontcaps
export NCARG_GRAPHCAPS=$NCARG_ROOT/lib/ncarg/graphcaps
export NDV_COLORMAP_PATH=$NCARG_ROOT/lib/ncarg/colormaps
 
Last edited:
Top