#Simple Makefile # - Basement Supercomputing (c) Copyright 2007 # # IMPORTANT # If you are using modules, you must set the appropriate # module so the lapack and blas libraries can be found. # # module load lapack-gnu4 # # will load the lapack module for gnu4 compilers # # This step will automatically set $LAPACK_PATH for # the correct libraries for your compiler. # See modules section in the documentation for # more information # # Set C and Fortran compiler e.g. # gcc, G77 or Gfortran for GNU # pgf90, pgcc for Portland Group FC=gfortran CC=gcc # Set C and Fortran Flags FFLAGS= -O2 CCFLAGS = -O2 # Set Path to your library files $LAPACK_PATH is defined by # modules, or you can enter a specific path LIBPATH= -L$(LAPACK_PATH) # Set the libraries you need LIBS= -llapack -lblas # Set the source files DEPS = test_la.c # Set the object files OBJ = test_la.o # Make rules follow %.o: %.c $(DEPS) $(CC) $(FFLAGS) -c -o $@ $< test_la_c: $(OBJ) $(FC) $(FFLAGS) -o $@ $^ $(LIBPATH) $(LIBS) clean: /bin/rm -f test_la_c test_la.o # Command line version # # gcc -c -o test_la.o test_la.c # gfortran -o test_la_c test_la.o -L$LAPACK_PATH -llapack -lblas