Hello all,
I am trying to run ROMS on macOS Sierra bases on the tutorial provided by wikiROMS.
However, it was based on a installation on Mac OS X 10.5.4 Tiger and most of the features are outdated and I am having trouble updating NETCdf and gfortran.
Can I use ifort to compile ROMS? About other features, could you please help me installing ROMS on Mac?
Thanks in advance!
Running ROMS in macOS Sierra
-
- Posts: 3
- Joined: Wed Dec 02, 2015 9:06 pm
- Location: COPPE
Re: Running ROMS in macOS Sierra
What exactly do you need to know? Yes, ifort should work to compile ROMS, though I don't have it on my Mac. I have gfortran which was installed via brew. My netcdf might have come from brew, might have been installed by me, plus there's parts which seem to have come in via Anaconda:
I don't run anything fancier than UPWELLING on the Mac.
Code: Select all
Kates-MacBook-Pro.local % which nc-config
/Users/kate/anaconda3/bin/nc-config
Kates-MacBook-Pro.local % which nf-config
/usr/local/bin/nf-config
-
- Posts: 3
- Joined: Wed Dec 02, 2015 9:06 pm
- Location: COPPE
Re: Running ROMS in macOS Sierra
Thanks for the reply Kate!
I have installed netcdf successfully via MacPorts. Now I am having trouble compiling ROMS.
When I run ./build.bash, the following error is shown:
ROMS/Bin/cpp_clean /Users/Bernardo/ROMS/Projects/Upwelling/Build/mod_kinds.f90
cd /Users/Bernardo/ROMS/Projects/Upwelling/Build; -c -frepack-arrays -g -fbounds-check -fno-bounds-check mod_kinds.f90
/bin/sh: -c: command not found
make: *** [ROMS/Modules/Module.mk:15: /Users/Bernardo/ROMS/Projects/Upwelling/Build/mod_kinds.o] Error 127
I have used 'dos2unix' command but it is returning the same error. Could you please help me with this?
Thanks once again for the help!
I have installed netcdf successfully via MacPorts. Now I am having trouble compiling ROMS.
When I run ./build.bash, the following error is shown:
ROMS/Bin/cpp_clean /Users/Bernardo/ROMS/Projects/Upwelling/Build/mod_kinds.f90
cd /Users/Bernardo/ROMS/Projects/Upwelling/Build; -c -frepack-arrays -g -fbounds-check -fno-bounds-check mod_kinds.f90
/bin/sh: -c: command not found
make: *** [ROMS/Modules/Module.mk:15: /Users/Bernardo/ROMS/Projects/Upwelling/Build/mod_kinds.o] Error 127
I have used 'dos2unix' command but it is returning the same error. Could you please help me with this?
Thanks once again for the help!
Re: Running ROMS in macOS Sierra
I wrote about it here, third bullet.
Re: Running ROMS in macOS Sierra
I run ROMS on Sierra with Macports. One thing I learned is that you need to use the same compiler for everything. So for a gfortran build, the command to install all dependencies using gcc5 would be something like:
I also have to make sure the correct gfortran is selected in my case, so I do:
I'm not sure if this is the best way, but it works. Then make sure you have your build.bash and Darwin-gfortran.mk set correctly as Kate mentioned above. Hope this helps.
EDIT: Sorry missed that you were using ifort. If you prefer to use ifort instead of gfortran, then I think you might need to compile netcdf, etc. with ifort. There is no ifort variant for netcdf in Macports, so you may need to compile from source. Otherwise, just use gfortran. Macports also has mpich and openmpi variants for netcdf.
Code: Select all
sudo port install hdf5 +fortran +gcc5 +hl +szip +cxx netcdf +gcc5 +netcdf4 netcdf-fortran +gcc5 +dap
Code: Select all
sudo ln -s /opt/local/bin/gfortran-mp-5 /opt/local/bin/gfortran
EDIT: Sorry missed that you were using ifort. If you prefer to use ifort instead of gfortran, then I think you might need to compile netcdf, etc. with ifort. There is no ifort variant for netcdf in Macports, so you may need to compile from source. Otherwise, just use gfortran. Macports also has mpich and openmpi variants for netcdf.