Installing netCDF on macOS 10.15

257 views
Skip to first unread message

osp...@bangor.ac.uk

unread,
Nov 26, 2020, 11:59:38 AM11/26/20
to GOTM-users
I'm trying to install GOTM.

I have downloaded the package 'gfortran-10.2-Catalina 14.56.08.dmg' and run it to install gfortran and a simple "hello world" program compiles and runs.

I also downloaded 'cmake-3.19.1-Darwin-x86_64.dmg', ran the package without problems.  From a terminal window I used:

  PATH="/Applications/CMake.app/Contents/bin":"$PATH"

to enable command line operation.

I then downloaded 'netcdf-fortran-4.5.3.zip' which expanded without any apparent errors, such that I now have a folder GOTM and two subfolders:

~\GOTM\code\  % contains the cloned GOTM code from GitHub
~\GOTM\netcdf-fortran-4.5.3\ % contains the unzipped files

From the Terminal window I cd to ~\GOTM and then enter:

  cmake netcdf-fortran-4.5.3

which produces the following output:

-- The Fortran compiler identification is GNU 10.2.0
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/local/bin/gfortran - skipped
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Found m4: /usr/bin/m4
CMake Error at CMakeLists.txt:466 (MESSAGE):
  libnetcdf not found.  Please reinstall and try again.

Can anyone advise what I have done wrong?  What am I actually meant to be reinstalling?

Also, is there a recommended directory structure for the various components and a recommended folder from which to run CMake?

Thanks for your help.  Brian

Karsten Bolding

unread,
Nov 26, 2020, 12:07:23 PM11/26/20
to gotm-...@googlegroups.com
Hi Brian

https://gotm.net/portfolio/software/

the installation of Fortran compilers and NetCDF is not a GOTM issue.

It is better to seek advice from the experts on Fortran and NetCDF for your platform.

Sometimes I work on a Mac and I use ports to install software - but some use brew.

Best regards
Karsten

--
You received this message because you are subscribed to the Google Groups "GOTM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gotm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gotm-users/11d49d02-1b5c-431b-8042-74e8a73fed71n%40googlegroups.com.


--

Jorn Bruggeman

unread,
Nov 26, 2020, 12:45:13 PM11/26/20
to gotm-...@googlegroups.com

Hi Brian,

 

Your error message suggests that you haven’t installed NetCDF-C yet. That needs to be done before installing NetCDF-Fortran, since that’s built on top of the NetCDF C library.

 

Regarding the recommended directory structure: the main thing I would recommend is to create a new empty build directory for every package you build with cmake (e.g., netcdf, gotm). So rather than running cmake from ~/GOTM, I’d create an empty ~/GOTM/build-netcdf-fortran and repeat your cmake command from there (but after first installing NetCDF-C).

 

Cheers,

 

Jorn

osp...@bangor.ac.uk

unread,
Nov 26, 2020, 12:54:35 PM11/26/20
to GOTM-users
Ah, that all makes sense.  Thanks, Brian
Reply all
Reply to author
Forward
0 new messages