天天看點

Mac上netcdf4.1.3安裝記錄

1.安裝zlib-1.2.8

tar -zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

FC=gfortran F90=gfortran F77=gfortran ./configure --prefix=/usr/local/zlib

sudo make

sudo make check

sudo make install

2. 安裝hdf5-1.8.19

tar -zxvf hdf5-1.8.19.tar.gz

cd hdf5-1.8.19

FC=gfortran F90=gfortran F77=gfortran ./configure --prefix=/usr/local/hdf5 --with-zlib=/usr/local/zlib --enable-hl

sudo make 

sudo make check(可省略,安裝過程中沒有check,安裝完了補check,all passed)

sudo make install

3. 安裝netcdf-4.1.3

tar -zxvf netcdf-4.1.3.tar.gz

cd netcdf-4.1.3

FC=gfortran F90=gfortran F77=gfortran ./configure --prefix=/usr/local/netcdf CPPFLAGS="-I/usr/local/zlib/include -I/usr/local/hdf5/include" LDFLAGS="-L/usr/local/zlib/lib -L/usr/local/hdf5/lib" --enable-netcdf4 --enable-large-file-tests

sudo make

sudo make check(可省略)

sudo make install

最後看到Congratulations表示安裝成功!

+-------------------------------------------------------------+

| Congratulations! You have successfully installed netCDF!    |

|                                                             |

| You can use script "nc-config" to find out the relevant     |

| compiler options to build your application. Enter           |

|                                                             |

|     nc-config --help                                        |

|                                                             |

| for additional information.                                 |

|                                                             |

| CAUTION:                                                    |

|                                                             |

| If you have not already run "make check", then we strongly  |

| recommend you do so. It does not take very long.            |

|                                                             |

| Before using netCDF to store important data, test your      |

| build with "make check".                                    |

|                                                             |

| NetCDF is tested nightly on many platforms at Unidata       |

| but your platform is probably different in some ways.       |

|                                                             |

| If any tests fail, please see the netCDF web site:          |

| http://www.unidata.ucar.edu/software/netcdf/                |

|                                                             |

| NetCDF is developed and maintained at the Unidata Program   |

| Center. Unidata provides a broad array of data and software |

| tools for use in geoscience education and research.         |

| http://www.unidata.ucar.edu                                 |

+-------------------------------------------------------------+

繼續閱讀