Running ROMS in macOS Sierra

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
bernardoliveira
Posts: 3
Joined: Wed Dec 02, 2015 9:06 pm
Location: COPPE

Running ROMS in macOS Sierra

#1 Unread post by bernardoliveira »

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! :D

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Running ROMS in macOS Sierra

#2 Unread post by kate »

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:

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
I don't run anything fancier than UPWELLING on the Mac.

bernardoliveira
Posts: 3
Joined: Wed Dec 02, 2015 9:06 pm
Location: COPPE

Re: Running ROMS in macOS Sierra

#3 Unread post by bernardoliveira »

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!

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Running ROMS in macOS Sierra

#4 Unread post by kate »

I wrote about it here, third bullet.

JDTilley
Posts: 63
Joined: Tue May 31, 2011 3:31 pm
Location: University of Southern Mississippi

Re: Running ROMS in macOS Sierra

#5 Unread post by JDTilley »

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:

Code: Select all

sudo port install hdf5 +fortran +gcc5 +hl +szip +cxx netcdf +gcc5 +netcdf4 netcdf-fortran +gcc5 +dap
I also have to make sure the correct gfortran is selected in my case, so I do:

Code: Select all

sudo ln -s /opt/local/bin/gfortran-mp-5 /opt/local/bin/gfortran
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.

Post Reply