Fortran 如何定制makefile文件来编译BLACS库

Fortran 如何定制makefile文件来编译BLACS库,fortran,scalapack,Fortran,Scalapack,我有一个makefile文件来用Fortran编译代码。 这个makefile已经编译了Lapack库。 鉴于我已经在我的系统中安装了BLACS库,如何修改这个makefile以编译BLACS库 我的生成文件: #$preamble # A simple hand-made makefile for a package including applications # built from Fortran 90 sources, taking into account the usual # d

我有一个makefile文件来用Fortran编译代码。 这个makefile已经编译了Lapack库。 鉴于我已经在我的系统中安装了BLACS库,如何修改这个makefile以编译BLACS库

我的生成文件:

#$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)
#$preamble
#包含应用程序的包的简单手工制作的makefile
#从Fortran 90源代码构建,考虑到
#依赖案例。
#这个makefile与gnumake命令一起工作,gnumake命令位于
#GNU/Linux系统,通常在非GNU系统上称为gmake,如果您
#正在使用旧样式的make命令,请查看该文件
#Makefile\u与包一起提供的旧样式。
# ======================================================================
#让我们从声明开始
# ======================================================================
#编译程序
FC=gfortran
#调试或最大性能的标志,必要时进行注释
FCFLAGS=-g-fbounds检查
FCFLAGS=-O3-ffix-line-length-0-ffree-line-length-0
LDFLAGS=-llapack-lblas
#所有标记(例如,查找system.mod文件,gfortran中需要)
FCFLAGS+=-I/usr/include
#链接所需的库,示例中未使用
#LDFLAGS=-li\u需要这个库
#要在包中生成的可执行文件列表
程序=exe
#“make”构建所有
全部:$(程序)
#从prog.o生成prog的一般规则;$^(GNU扩展)是
#用于列出在其上
#可执行文件取决于
%:%
$(FC)$(FCFLAGS)-o$@$^$(LDFLAGS)
#从prog.f90或prog.f90生成prog.o的一般规则;$<是
#用于仅列出第一个先决条件(源文件)
#而不是附加的先决条件,如模块或包含文件
%.o:%.f90
$(FC)$(FCFLAGS)-c$<
%.o:%.F90
$(FC)$(FCFLAGS)-c$<
#效用目标
.冒牌货:干净的veryclean
清洁:
rm-f*.o*.mod*.mod exe
veryclean:干净
rm-f*~$(程序)

我不理解你的问题,因为这个makefile不编译LAPACK或BLAS,只链接它们。我想你指的是BLAS,而不是BLACS应该是BLACS-