#change to your own HDF5 library path HDF5_DIR=/mnt/hdf/kent/check_cf_example/hdf5bin #change to your own netcdf4 library path NETCDF4_DIR=/mnt/hdf/kent/check_cf_example/nc4bin #change to your own compiler, but make sure your hdf5 and netcdf4 # are built with the same compiler. CC=gcc CFLAGS=-I$(NETCDF4_DIR)/include -I$(HDF5_DIR)/include LDFLAGS=-L$(NETCDF4_DIR)/lib -L$(HDF5_DIR)/lib #uncomment -lsz if you don't use the szlib library. CLIBS=$(NETCDF4_DIR)/lib/libnetcdf.a $(HDF5_DIR)/lib/libhdf5_hl.a $(HDF5_DIR)/lib/libhdf5.a -lsz -lz -lm #CLIBS=$(NETCDF4_DIR)/lib/libnetcdf.a $(HDF5_DIR)/lib/libhdf5_hl.a $(HDF5_DIR)/lib/libhdf5.a -lz -lm all: clean netcdf-c netcdf-c: netcdf_ex1.c $(CC) $< $(CFLAGS) $(LDFLAGS) $(CLIBS) -o $@ clean: rm -rf netcdf-c *.o