-
Notifications
You must be signed in to change notification settings - Fork 7
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
Not able to run this script on Mac OS Ventura 13.0 (M1-Max) #5
Comments
First off, this is a nightmare of a project to jump into as your first experience with Terminal. While most of the compilation process should be similar with an M1 chip and WRF v4, it doesn't look like it will be directly portable, so using my setup script will likely not be possible. Poking around in homebrew's repositories, it looks like the majority of the hacks that I had to do have been obsoleted in the intervening years, which means that you should be able to just run the installers directly: brew install --cask ncar-ncl
brew install m4 pv ncurses cairo libpng szip lzlib pixman doxygen tcsh hdf5 jasper netcdf-fortran If the above install commands complete successfully, then it should be possible to proceed with the WRF installation; however, I'd recommend configuring it manually rather than trying to use my setup script. The official instructions can be found here: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php#STEP4. The runner part of this project should still work, at least. It's written in Java, which can be installed via homebrew as is M1 compatible, and It doesn't actually rely on the precise internals of WRF - so long as their basic configuration files haven't changed it'll still work. |
So. Apparently, WRF doesn't build properly on MacOS anymore (at least, it looks like its newer features don't). rm share/landread.c
mv share/landread.c.dist share/landread.c That should bypass the error that you are currently seeing. You may need to rerun configure after making that change. |
It looks like the error occurred much earlier than that. Search for the first instance of "module_state_description". You'll likely see some other compile errors. If those compile errors include being unable to open another file, search for errors relating to that one. Rinse and repeat and you should eventually find the original error, which is what we'll need in order to fix this. |
Hi |
GCC 12 is significantly newer than 4.6 by over a decade, so that shouldn't be the issue. |
I have attached but I don't think we need to install NETCDF manually, because it is already installed through home-brew. As I can the see from running the command "which ncdump" and it return netcdf 4.9.0. which should be "SUCCESS test 1 fortran + c + netcdf" Here are the env which I Set ; |
Likely SolutionI've left my original recommendations below (and I still recommend reading them), but, on closer inspection, I think that all that you need to do is replace your setenv NETCDF /opt/homebrew/Cellar/netcdf/4.9.0 You also likely need to add NETCDF to your path, which can be done with: setenv PATH /opt/homebrew/Cellar/netcdf/4.9.0/bin:$PATH Finally, I suspect that your "grib2" directories are wrong. I'm not entirely sure how you derived them, but the Cellar directory of homebrew is two layers deep while your paths require it to be one layer - specifically, the full path for something in the Cellar directory is: Original RecommendationsThere are a couple of things that I'm confused by. First, the setenv usage is a bit odd. I'm assuming that you're running this in bash, in which case you can replace that block of instructions with: DIR='/opt/homebrew/Cellar'
export CC='gcc'
export CXX='g++'
export FC='gfortran'
export FCFLAGS='-m64'
export F77='gfortran'
export JASPERLIB="$DIR/grib2/lib"
export JASPERINC="$DIR/grib2/include"
export LDFLAGS="-L$DIR/grib2/lib"
export CPPFLAGS="-I$DIR/grib2/include"
export NETCDF="/opt/homebrew/Cellar/netcdf/4.9.0" I suspect that you'll want to add the following: export PATH="$PATH:$NETCDF/bin" In general, I'd recommend replacing any instances of |
Thanks for recommendation. now the problem rise when I start compiling, after successful configuration. let me know if you can see the logs and recommend something. The error is "registry.c:63:3: error: implicit declaration of function 'sym_forget' is invalid in C99 [-Werror,-Wimplicit-function-declaration] sym_forget() ;" |
That error is bizarre because it'd normally not be an error - you can see GCC's reason for outputting that message includes -Werror, which means that it's only an error because GCC is being forced to treat it as such. I was looking into getting this stuff set up myself, but the install process for wgrib2 is a bit insane. Did you manually download NETCDF 4.8.1 and whatever version of HDF5 it requires? I have a sneaking suspicion that a large portion of the errors in the logs are due to compatibility issues between the libraries being used. If you are willing to give macports a try, it looks like they have all of the libraries that you need pre-built, which should fix the compatibility issues. If macports isn't an option (or doesn't work), then I'm out of viable ideas - the other one requires significantly more work than I can dedicate to this right now. |
I can't install gcc with version lower than 11 because Mac "M1" does not support it even through Mac ports. What I realised I was making mistake , I was using clang compiler (which comes with Xcode ) instead of gcc from Homebrew. Because clang doesn't have <bits/stdc++.h> header, so I was getting weird errors. Although, it's bit tricky to switch to Homebrew gcc from apple clang (gcc) This video [https://www.youtube.com/watch?v=wY24ehH6mC0] helps me. But anyhow I succeeded in compiling the WRF. I had a fear that my compilation may run into errors because I built libraries (Netcdf, mpich, jasper etc) with clang compiler but compilation was ok in the end which was unexpected. I also concluded that Apple Mac with M1 chip is always challenging when compare to intel based Mac. May be it's new in the market. |
I am new to WRF. (Even new with Mac terminal :))
I tried to use this script to install WRF v 4.4.1.
But I got many issues e.g.
I wonder if anybody can help me. I have attached compile logs.
compile_wrf.log
The text was updated successfully, but these errors were encountered: