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

Unable to install WRF v4.4.1 on MAC with M1-Max chip running Ventura 13.0

ihaseeburrehman

New member
Hi all
I am wondering is there any instructions to configure/compile this model on Mac OS, because I have been struggling to install this for last two weeks and not succeeded.
I configured it and generated the wrf config file but not able to compile. I have lot of errors related to modules, make file etc.
I have install all required libraries through home brew e.g. NETCDF, mpic, Libpng, Zlib, jasper, hdf5 etc which are required for WRF. I am using bash as shell in terminal.
I search on internet but not able to find any profitable solution. Although there is script available on GitHub to install WRF but that is for v3.
Any help will really be appreciated.
I attached my log file here.
 

Attachments

  • log compile.pdf
    559.9 KB · Views: 6
Hi,
Take a look at this thread and see if there is any helpful information in there. I think there have been issues compiling with Clang and perhaps with Brew/homebrew, as well.

If you recompile, please attach your configure.wrf file, as well as the actual compile log. It does not need to be in .pdf format, which is a bit harder to look through. Thanks!
 
Hi all
I am wondering is there any instructions to configure/compile this model on Mac OS, because I have been struggling to install this for last two weeks and not succeeded.
I configured it and generated the wrf config file but not able to compile. I have lot of errors related to modules, make file etc.
I have install all required libraries through home brew e.g. NETCDF, mpic, Libpng, Zlib, jasper, hdf5 etc which are required for WRF. I am using bash as shell in terminal.
I search on internet but not able to find any profitable solution. Although there is script available on GitHub to install WRF but that is for v3.
Any help will really be appreciated.
I attached my log file here.
Hello,

Mac has some command changes and different repo packages needed to run WRF.

If you post what @kwerner said about the packages as well as your libraries you are using i can look at them too.
 
Hi All
thanks for your reply . After checking your instruction on this Link , I came to know that home-brew may cause the problem. So I decided to manually install libraries.
While installing library NETCDF I got error ( I am following this link for installation)
"checking if Fortran "byte" is C "signed char"... configure: error: Could not compile conftest.c".
(logs file attached)
I think it's because of my gcc version. WRF forum suggest to use gcc 4.6 or above. But I have currently gcc 12 with Xcode 14. I can't use gcc 4.6 because it is only supported by previous Xcode version.
can you suggest me some work around ?
I have following queries if you can answer ...
  1. do you think I need to install these libraries (NETCDF, Zlib, epic,libpng etc) manually , although I also install these through home brew.?
  2. if I really need to install these libraries then should I remove the libraries which are installed through home brew ?
  3. is it possible for WRF support to upload the instruction video for installation of latest version of WRF on latest Mac ? Because we are team of more than 3 people having Mac and we all need this model on them. and also the available instructions available on WRF are for linux based system I guess. It will be highly appreciated. :)
Thanks
 

Attachments

  • config.log
    51.4 KB · Views: 3
do you think I need to install these libraries (NETCDF, Zlib, epic,libpng etc) manually , although I also install these through home brew.?
if I really need to install these libraries then should I remove the libraries which are installed through home brew ?
is it possible for WRF support to upload the instruction video for installation of latest version of WRF on latest Mac ? Because we are team of more than 3 people having Mac and we all need this model on them. and also the available instructions available on WRF are for linux based system I guess. It will be highly appreciated. 

There are a couple of things that might help. First GCC 12 you will probably need this fix:

1. Installing them manually is easier then homebrew in my opinion. That way you can get the path to the files easier. With homebrew you are installing the libraries to root and finding the path isn't always easy. I recommend putting them into a library folder something like this:
Bash:
export HOME=`cd;pwd`
export DIR=$HOME/WRF/Libs
mkdir $HOME/WRF
cd $HOME/WRF
mkdir Downloads
mkdir WRFPLUS
mkdir WRFDA
mkdir Libs
mkdir Libs/grib2
mkdir Libs/NETCDF
mkdir Libs/MPICH

cd $HOME/WRF/Downloads
tar -xvzf v1.2.13.tar.gz
cd zlib-1.2.13/
CC= CXX= ./configure --prefix=$DIR/grib2
make -j $CPU_HALF_EVEN
make -j $CPU_HALF_EVEN install
#make check

echo " "

2. If you install the libraries and path them correctly when installing the WRF, it won't matter that there are other libraries from homebrew in root.

3. It may be possible to ask for a instruction video for MAC installation. There are some that other users have put together on YouTube but for something officially from NCAR I would recommend putting a new topic/question in the General Questions forum and see what happens.
 
Hi Will Hatheway
Thank you so much for responding this. Today morning I tried to fix gcc issue describe on this link. But when I try to install netcdf 4.1.3 manually I got error "checking if Fortran "byte" is C "signed char"... configure: error: Could not compile conftest.c". This error was also there before.
I tried this on bash and tcsh shell.
(config.log attached)
WRF instruction site recommend to use tcsh as shell and suggest to have this environment set.
  • setenv DIR /path_to_directory/Build_WRF/LIBRARIES
  • setenv CC gcc
  • setenv CXX g++
  • setenv FC gfortran
  • setenv FCFLAGS -m64
  • setenv F77 gfortran
  • setenv FFLAGS -m64
  • setenv JASPERLIB $DIR/grib2/lib
  • setenv JASPERINC $DIR/grib2/include
  • setenv LDFLAGS -L$DIR/grib2/lib
  • setenv CPPFLAGS -I$DIR/grib2/include
let me know if you have any more suggestion.
Thanks
 

Attachments

  • config.log
    47.9 KB · Views: 2
try this

First install this via homebrew
Bash:
brew install gcc libtool automake autoconf make m4 java ksh git wget mpich grads ksh tcsh python3 python3-dev

Then download these libraries
Code:
wget -c -4 https://github.com/madler/zlib/archive/refs/tags/v1.2.13.tar.gz
wget -c -4 https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_13_2.tar.gz
wget -c -4 https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.0.tar.gz
wget -c -4 https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.0.tar.gz
wget -c -4 https://download.sourceforge.net/libpng/libpng-1.6.38.tar.gz
wget -c -4 https://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip

Set the compilers
Code:
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
echo " "
 
Hi Thanks for coming back
I did that, when I try to install netcdf I stuck on the error which I mention above.
Bash:
##############################Install NETCDF C Library############################
cd $WRF_FOLDER/Downloads
tar -xzvf v4.9.0.tar.gz
cd netcdf-c-4.9.0/
export CPPFLAGS=-I$DIR/grib2/include
export LDFLAGS=-L$DIR/grib2/lib
./configure --prefix=$DIR/NETCDF --disable-dap --enable-netcdf-4 --enable-netcdf4 --enable-shared
make
make install |& tee make.install.log
make check

export PATH=$DIR/NETCDF/bin:$PATH
export NETCDF=$DIR/NETCDF
echo " "
##############################NetCDF fortran library############################

cd $WRF_FOLDER/Downloads
tar -xvzf v4.6.0.tar.gz
cd netcdf-fortran-4.6.0/
export LD_LIBRARY_PATH=$DIR/NETCDF/lib:$LD_LIBRARY_PATH
export CPPFLAGS=-I$DIR/NETCDF/include
export LDFLAGS=-L$DIR/NETCDF/lib
./configure --prefix=$DIR/NETCDF --enable-netcdf-4 --enable-netcdf4 --enable-shared
make
make install |& tee make.install.log
make check


echo " "
 
This is what I did. Because netcdf 4.1.3 can not be install on apple m1 so I installed these version of netcdf-c and netcdf fortran. And please do remember by default apple clang is used as compiler and Clang doesn't have <bits/stdc++.h> header. We need to switch to lovely gcc from Homebrew first. Anyhow I am successful in building WRF executables now I am installing WPS.
I will post here if I will get success.
 
This is what I did. Because netcdf 4.1.3 can not be install on apple m1 so I installed these version of netcdf-c and netcdf fortran. And please do remember by default apple clang is used as compiler and Clang doesn't have <bits/stdc++.h> header. We need to switch to lovely gcc from Homebrew first. Anyhow I am successful in building WRF executables now I am installing WPS.
I will post here if I will get success.
can you show how to change to homebrew?
 
Here is the video link which show how to switch to gcc from clang.

I have posted detailed description of installation on M1 Mac on below link .
 
Top