#Simple Makefile # # IMPORTANT # If you are using modules, you must set the appropriate # module so the fftw3 libraries can be found. # # module load fftw3-gnu4 # # will load the fftw3 module for gnu4 compilers # # This step will automatically set FFTW3_PATH and # FFTW3_INCLUDE in your environment. FFTW3_PATH points # to the fftw3 library directory and FFTW3_INCLUDE points to # to the fftw3 include directory for your compiler. # See modules section in the documentation for # more information # # # Set Fortran compiler (G77, Gfortran for GNU, pgf90 for Portland Group FC=gfortran # Set gfortran Flags FFLAGS= -O2 # Set Path to your library files. FFTW3_PATH is defined by # modules, or you can enter a specific path LIBPATH= -L$(FFTW3_PATH) # Set Path to your include files. FFTW3_INCLUDE is defined by # modules, or you can enter a specific path here INCPATH= -I$(FFTW3_INCLUDE) # Set the libraries you need LIBS_SINGLE= -lfftw3f LIBS_DOUBLE= -lfftw3 # Set the source files DEPS = fftw3-test-single.f fftw3-test-double.f # Set the object files OBJ_DOUBLE = fftw3-test-double.o OBJ_SINGLE = fftw3-test-single.o # Make rules follow %.o: %.f $(DEPS) $(FC) $(FFLAGS) $(INCPATH) -c -o $@ $< all: fftw3-test-single fftw3-test-double fftw3-test-double: $(OBJ_DOUBLE) $(FC) $(FFLAGS) -o $@ $^ $(LIBPATH) $(LIBS_DOUBLE) fftw3-test-single: $(OBJ_SINGLE) $(FC) $(FFLAGS) -o $@ $^ $(LIBPATH) $(LIBS_SINGLE) clean: /bin/rm -f fftw3-test-single fftw3-test-single.o fftw3-test-double fftw3-test-double.o # Command line version # # double precision # gfortran -o fftw3-test-double fftw3-test-double.f -I$FFTW3_INCLUDE -ffixed-line-length-none -lfftw3 -L$FFTW3_PATH # single precision #gfortran -o fftw3-test-single fftw3-test-single.f -I$FFTW3_INCLUDE -ffixed-line-length-none -lfftw3f -L$FFTW3_PATH