У меня есть файл makefile для компиляции моих кодов в Fortran.Этот make-файл уже компилирует библиотеку Lapack.В связи с тем, что в моей системе уже установлена библиотека BLACS, как изменить этот make-файл, чтобы также скомпилировать библиотеку BLACS.
Мой make-файл:
#$preamble
# A simple hand-made makefile for a package including applications
# built from Fortran 90 sources, taking into account the usual
# dependency cases.
# This makefile works with the GNU make command, the one find on
# GNU/Linux systems and often called gmake on non-GNU systems, if you
# are using an old style make command, please see the file
# Makefile_oldstyle provided with the package.
# ======================================================================
# Let's start with the declarations
# ======================================================================
# The compiler
FC = gfortran
# flags for debugging or for maximum performance, comment as necessary
FCFLAGS = -g -fbounds-check
FCFLAGS = -O3 -ffixed-line-length-0 -ffree-line-length-0
LDFLAGS = -llapack -lblas
#flags forall (e.g. look for system .mod files, required in gfortran)
FCFLAGS += -I/usr/include
# libraries needed for linking, unused in the examples
#LDFLAGS = -li_need_this_lib
# List of executables to be built within the package
PROGRAMS = exe
# "make" builds all
all: $(PROGRAMS)
# General rule for building prog from prog.o; $^ (GNU extension) is
# used in order to list additional object files on which the
# executable depends
%: %.o
$(FC) $(FCFLAGS) -o $@ $^ $(LDFLAGS)
# General rules for building prog.o from prog.f90 or prog.F90; $< is
# used in order to list only the first prerequisite (the source file)
# and not the additional prerequisites such as module or include files
%.o: %.f90
$(FC) $(FCFLAGS) -c $<
%.o: %.F90
$(FC) $(FCFLAGS) -c $<
# Utility targets
.PHONY: clean veryclean
clean:
rm -f *.o *.mod *.MOD exe
veryclean: clean
rm -f *~ $(PROGRAMS)