Firstly, We have to install Xcode and then install Command Line Tools (Preferences -> Downloads).
Then, We have to install gfortran. I currently choose to use the relevant tar-file provided at the High Performance Computing web page. There are up-to-date distributions for some systems (only Mac OS X 10.7 (Lion) and 10.8 (Mountain Lion) as of the last update of this page). For simplicity, I would recommend only to install the relevant "gfortran only" distributions.
The files are gzip'd tar-files which should be unpacked, for instance by using the Terminal application, as follows:
sudo tar xvfz [tar-file] -C /
Note that the files are installed in /usr/local system directories which require the administrator password.
No special treatment how to install zlib in OS Lion or Linux. In Macintosh, you can install them via Fink, but i prefer not to do that to make sure where the library of zlib goes. Even zlib for Mac OS X is already included as part of Mac OS X
1. Download the source code here. I used zlib1.2.5 version.
2. tar xzf zlib-1.2.5.tar.gz
3. cd zlib-1.2.5
4. ./configure --prefix=/usr/local
5. make
6. make install
Thanks to the software engineer of HDF5 especially Madam Barbara Jones who helped me figure it out my difficulties on HDF5 installation at OS Lion. Here, I put the step by step how to install HDF5 1.8.7 for lion.
1. Download the source code of HDF5 1.8.7 from HDF5 URL. I used Mac OS X 10.7.0 (Intel 64-bit) static version
2. Open terminal and tar them
3. If you previously failed to install them, get a clean copy of the HDF5 source code. (Alternately, run “make distclean”)
4. In the top directory of the HDF5 source code, you will see the config/ directory. Go into the config/ directory. using “cd config”
5. You will see a file called: “gnu-flags”
6. Edit the “gnu-flags” file using emacs or vi and search for “PROD_CFLAGS”. Change the value of PROD_CFLAGS to “-O0″ (capital “O” letter + zero) for “gcc-4.*”.
7. ./configure –with-zlib=/usr/local –prefix=/usr/local –enable-fortran . Here you download HDF5 under “/usr/local” root.
8. make
9. make check
10. make install
11. sudo make install
Install NetCDF follow this tutorial.
1. Download the 4.1.3 release source code is available from the following URL (http://www.unidata.ucar.edu/blogs/news/entry/netcdf_c_fortran_c_version)
2. open “terminal”
3. write “tar xvf netcdf-4.1.3.tar” on terminal and continue to write the below commands:
4. export FC=gfortran
5. export F77=gfortran
6. export F90=gfortran
7. export CFLAGS=’-O3′
8. go to the folder where you extracted netCDF source file *tar.gz file: ”cd netcdf-4.1.3″
9. ./configure –prefix=/opt/netcdf4/gfortran –enable-netcdf-4 –with-hdf5=/usr/local . Here you installed netCDF file under /opt/netcdf4/gfortran folder. If you have different compilers such as “ifort” , you can later installed another netCDF4 under different folder, let say “/opt/netcdf4/ifort”.
10. make
11. make check
12. sudo make install
No comments:
Post a Comment