#Simple Makefile # - Basement Supercomputing (c) Copyright 2012 # # IMPORTANT # If you are using modules, you must set the appropriate # module so the openBLAS libraries can be found. # # module load openBLAS.SANDYBRIDGE-gnu4 # # will load the openBLAS module for gnu4 compilers (optimized for # the Sandy bridge processor) # # This step will automatically set $OPENBLAS_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 FC=gfortran CC=gcc # Set C and Fortran Flags FFLAGS= -O2 CCFLAGS = -O2 # Set Path to your library files $OPENBLAS_PATH is defined by # modules, or you can enter a specific path LIBPATH= -L$(OPENBLAS_PATH) # Set the libraries you need LIBS= -lopenblas # 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$OPENBLAS_PATH -lopenblas