#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 CPP=g++ # 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 -lstdc++ # Set the source files DEPS = test_la.f # Set the object files OBJ = test_la.o # Make rules follow %.o: %.cpp $(DEPS) $(CPP) $(FFLAGS) -c -o $@ $< test_la_cpp: $(OBJ) $(FC) $(FFLAGS) -o $@ $^ $(LIBPATH) $(LIBS) clean: /bin/rm -f test_la_cpp test_la.o # Command line version # # g++ -c -o test_la.o test_la.cpp # gfortran -o test_la_cpp test_la.o -L$LAPACK_PATH -llapack -lblas -lstdc++