Problems with ROMS installation related to Homebrew maybe

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
moleculetang
Posts: 3
Joined: Thu Jan 27, 2022 1:52 pm
Location: Ocean University of China

Problems with ROMS installation related to Homebrew maybe

#1 Unread post by moleculetang »

Hi there, I'm a complete rookie in modeling and ROMS. Recently I have some spent a couple of days trying to handle the problems of installation and finally I failed to. Here's my final results.

tbbdeMBA:Upwelling moleculetang$ ./build_roms.sh
rm -f -r core *.ipo /Users/moleculetang/Documents/ROMS/Projects/Upwelling/Build_roms /Users/moleculetang/make_macros.mk
cp -f $(shell /usr/local/bin/nf-config --prefix)/include/netcdf.mod /Users/moleculetang/Documents/ROMS/Projects/Upwelling/Build_roms
/bin/sh: shell: command not found
cp: /include/netcdf.mod: No such file or directory
make: *** No rule to make target `/Users/moleculetang/Documents/ROMS/Projects/Upwelling/Build_roms/MakeDepend', needed by `all'. Stop.

I know they are all basic problems but some how I just can't figure them out.
For the first one, '/bin/sh: shell: command not found', I have not seen many posts on our forum which have similar problems as I do, thus I have no idea with the first one.
For the second one, 'cp: /include/netcdf.mod: No such file or directory', I actually have done a lot of works. In the beginning I add a declaration about nf-config in my PATH environment variables, which is in my build.sh, about 110 lines:
export MY_ROOT_DIR=/Users/moleculetang/Documents/ROMS
export MY_PROJECT_DIR=${MY_ROOT_DIR}/Projects/Upwelling
export NF_CONFIG_DIR=/usr/local/bin/nf-config

But it has no help. After that, I change the declaration in the my_build _paths.sh, like this:
export NETCDF=$I/usr/local/Cellar/netcdf/4.8.1/include
export NF_CONFIG=${NETCDF}/bin/nf-config
export NETCDF_INCDIR=${NETCDF}/include

And nothing happens either. When I'm going to give up I found a post: viewtopic.php?p=22133#p22133, which declares that it's all brew's fault. I download my gcc, netcdf, gnumake from the Homebrew. This time I modified the Darwin-gfortran.mk as the post tells me to, and nothing changes either.

For the third one, ‘ No rule to make target ...MakeDepend’, kate said it's due to the perl. I checked my perl and it works well, I also modified the first line of the sfmakedepend, and the problem is still there.
Frustrated and tired, I'm wondering if I miss something important or do something wrong. I don't use English as my mother language, so I'm struggling understanding some information. Plz give me a hand, thanks a lot!

P.S. I don't have 'lib' in my trunk when downloading the newest edition of ROMS through the svn, I'm wondering if it is normal.

moleculetang
Posts: 3
Joined: Thu Jan 27, 2022 1:52 pm
Location: Ocean University of China

Re: Problems with ROMS installation related to Homebrew maybe

#2 Unread post by moleculetang »

I have solved my first problem by checking the Darwin-gfortran.mk, but for the latter two, I still have no methods :(

User avatar
robertson
Site Admin
Posts: 219
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

Re: Problems with ROMS installation related to Homebrew maybe

#3 Unread post by robertson »

It appears from your output that you have not set USE_MY_LIBS to yes in your roms_build.sh. If you had, there would be a note about the full path to the my_build_paths.sh file being loaded. That is probably why you found it necessary to edit Darwin-gfortran.mk. I would suggest:
  1. undoing your edits to Darwin-gfortran.mk
  2. creating a ~/Compilers/ROMS directory
  3. copying Compilers/my_build_paths.sh and Compilers/Darwin-gfortran.mk from the ROMS source code to the ~/Compilers/ROMS directory
  4. edit ~/Compilers/ROMS/my_build_paths.sh setting NETCDF correctly (discussed below) in the appropriate section
  5. Change COMPILERS to ${HOME}/Compilers/ROMS in your roms_build.sh (line ~130 should just be commenting the active export line and un-commenting the next line)
To determine which section of your ~/Compilers/ROMS/my_build_paths.sh file will be read to set the NETCDF variable you need to know what FORT is set to (should be gfortran for you) and whether USE_PARALLEL_IO is set (should not be in your case) in your roms_build.sh script. If you get a result when you issue the which nf-config command then you will want to copy the portion of the path up to BEFORE /bin/nf-config to paste into your ~/Compilers/ROMS/my_build_paths.sh. If you do not get a result then it's possible that the Fortran NetCDF libraries were not installed and you will need to figure out how to get homebrew to include them.

With the NetCDF path on your clipboard, edit ~/Compilers/ROMS/my_build_paths.sh and paste it around line 330, replacing /opt/gfortransoft/serial/netcdf4 with what is on your clipboard. See how far that gets you.
P.S. I don't have 'lib' in my trunk when downloading the newest edition of ROMS through the svn, I'm wondering if it is normal.
The Lib directory was removed in revision 1079 this past July. See ticket #891 for details.

moleculetang
Posts: 3
Joined: Thu Jan 27, 2022 1:52 pm
Location: Ocean University of China

Re: Problems with ROMS installation related to Homebrew maybe

#4 Unread post by moleculetang »

See how far that gets you.
Thx! I'll try it. Maybe using the homebrew to install netcdf in Mac is the most convenient way... cuz I just tried downloading netcdf by myself and there's some contradiction between the installation package and the MacOs

Post Reply