标签:
high-level interface:
Matlab
Octave
NAG Numerical Librairies
Maple
R project
Scilab
操作系统版本:Windows 8
使用的编译器:gfortran (GCC版本4.6.2 MinGW环境)
Lapack版本: 3.4.2
####################################################################
# LAPACK make include file. #
# LAPACK, Version 3.4.0 #
# April 2012 #
####################################################################
#
SHELL = /bin/sh
#
# Modify the FORTRAN and OPTS definitions to refer to the
# compiler and desired compiler options for your machine. NOOPT
# refers to the compiler options desired when NO OPTIMIZATION is
# selected. Define LOADER and LOADOPTS to refer to the loader and
# desired load options for your machine.
#
FORTRAN = gfortran
OPTS = -O2
DRVOPTS = $(OPTS)
NOOPT = -O0
LOADER = gfortran
LOADOPTS =
#
# Timer for the SECOND and DSECND routines
#
# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
#TIMER = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
# TIMER = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
TIMER = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
# TIMER = INT_CPU_TIME
# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
# TIMER = NONE
#
# Configuration LAPACKE: Native C interface to LAPACK
# To generate LAPACKE library: type ‘make lapackelib‘
# Configuration file: turned off (default)
# Complex types: C99 (default)
# Name pattern: mixed case (default)
# (64-bit) Data model: LP64 (default)
#
# CC is the C compiler, normally invoked with options CFLAGS.
#
CC = gcc
CFLAGS = -O3
#
# The archiver and the flag(s) to use when building archive (library)
# If you system has no ranlib, set RANLIB = echo.
#
ARCH = ar
ARCHFLAGS= cr
RANLIB = ranlib
#
# Location of the extended-precision BLAS (XBLAS) Fortran library
# used for building and testing extended-precision routines. The
# relevant routines will be compiled and XBLAS will be linked only if
# USEXBLAS is defined.
#
# USEXBLAS = Yes
XBLASLIB =
# XBLASLIB = -lxblas
#
# The location of the libraries to which you will link. (The
# machine-specific, optimized BLAS library should be used whenever
# possible.)
#
BLASLIB = ../../librefblas.a
LAPACKLIB = liblapack.a
TMGLIB = libtmglib.a
LAPACKELIB = liblapacke.a
lib: blaslib lapacklib tmglib
liblapack.a
librefblas.a
libtmglib.a
gfortran program.f90 -llapack -lrefblas -o program.exe
gfortran program.f90 liblapack.a librefblas.a -o program.exe
gfortran program.f90 -L./Lapack -llapack -lrefblas -o program.exe
!Testlapack.f90
program main
implicit none
real :: a(3,3),b(3)
integer :: v(3),iflag
!external sgesv
a=reshape([2.0,0.0,0.0,0.0,3.0,0.0,0.0,0.0,4.0],[3,3])
b=[998.0,999.0,1000.0]
print *,‘a=‘,a
print *,‘b=‘,b
call sgesv(3,1,a,3,v,b,3,iflag)
print *,‘solve=‘,b
end program main
gfortran TestLapack.f90 -L./Lapack -llapack -lrefblas -o TestLapack.exe -Wall
Windows下Fortran编译Lapack库及使用的方法(转自新浪)
标签:
原文地址:http://www.cnblogs.com/panscience/p/4966404.html