我在ubuntu9.04下编译一个fortran程序,这个程序是网上下载的,它的makefile默认的编译器是g77,同时还提供了其他的编译选择,我先用默认的编译,出错了,然后我将FC改为ifort,还是不行,哪位大侠告诉我该怎么办啊?
另外,我希望这个程序运行时能给出每一步迭代所花的时间,这个貌似也要改makefile,可我不知道怎么改
下面是我的makefile部分内容,拜托好心人帮我看看,先谢谢了
#----------------------Linux with g77 -------- --------------------------------
FC = g77
FFLAGS = -c -u -O
FFLAGSundecl = -c -O
FFLAGSslamc1 = -c
TIMEIT = timeit_linux
LDFLAGS =
#----------------------- Linux pgf77 ------------------------------------------
# pgf77 = Portland Group compiler (http://www.pgroup.com)
#FC = pgf77
#FFLAGS = -c -fast
#FFLAGSundecl = -c -fast
#FFLAGSslamc1 = -c
#LDFLAGS = -Bstatic
#TIMEIT = timeit_linux
#----------------------- Linux ifc --------------------------------------------
# ifc = intel fortran compiler
#FC = ifc
#FFLAGS = -c -O3
#FFLAGSundecl = -c -O3
#FFLAGSslamc1 = -c
#LDFLAGS = -Vaxlib
#TIMEIT = timeit_linux
#---------------------- OSF on Compaq alpha -----------------------------------
#FC = f77
#FFLAGS = -c -fast
#FFLAGSundecl = -c -fast
#FFLAGSslamc1 = -c
#LDFLAGS =
#TIMEIT = timeit_osf
#------------------------- Sun fortran ----------------------------------------
#FC = f77
#FFLAGS = -fast -u
#FFLAGSundecl = -fast -O3 -c
#FFLAGSslamc1 = -c
#LDFLAGS = -fast -O3
#TIMEIT = timeit_sun
#---------------------- AIX fortran on RS6000 ---------------------------------
#FC = xlf
#FFLAGS = -O
#FFLAGSundecl = -O -c
#FFLAGSslamc1 = -c
#LDFLAGS = -O
#TIMEIT = timeit_ibm6000
#------------------------ SGI IRIX on R4000 -----------------------------------
# -mips2 option generates code using the MIPS 2 instruction set [R4000 cpu]
#FC = f77
#FFLAGS = -u -mips2 -O2
#FFLAGSundecl = -mips2 -O2 -c
#FFLAGSslamc1 = -c
#LDFLAGS = -mips2 -O2
#TIMEIT = timeit_sgi
#--------- SGI IRIX on R5000, R8000, or R10000 systems ------------------------
# -mips4 option generates code using the MIPS IV instruction set [supported on
# R5000, R8000, and R10000 cpus]
#FC = f77
#FFLAGS = -u -mips4 -O2
#FFLAGSundecl = -mips4 -O2 -c
#FFLAGSslamc1 = -c
#LDFLAGS = -mips4 -O2
#TIMEIT = timeit_sgi
#----------------------- HP AUX -----------------------------------------------
#FC = f77
#FFLAGS = -O3 -c
#FFLAGSundecl = -O3
#FFLAGSslamc1 = -c
#LDFLAGS =
#TIMEIT = timeit_hp
求教:在ubuntu9.04下编译fortran程序时出现问题
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 12
- 注册时间: 2009-10-04 20:56
- pisit
- 帖子: 413
- 注册时间: 2008-07-08 10:39
Re: 求教:在ubuntu9.04下编译fortran程序时出现问题
错误提示贴上来。
-
- 帖子: 12
- 注册时间: 2009-10-04 20:56
Re: 求教:在ubuntu9.04下编译fortran程序时出现问题
楼上的大侠,我刚才发的那个makefile是一个较低版本的,现在我才发现那个软件又出了个新的版本,这个软件是用fortran90编写的,它的makefile是这样的:
#******************************************************************************
#
# Compiler and options
#
# FC specifies the fortran 90 compiler
# FFLAGS are compilation options
# LFLAGS are flags for linking
#
#############################################################################
# Examples
# 1. g95 compiler
# sp + no MKL + no OpenMP + no MPI
# define the following:
PRECISION = dp
CXFFTMKL.f = cxfft3_mkl_fake.f90
CXFFTMKL.o = cxfft3_mkl_fake.o
MKLM =
DOMP =
OPENMP =
MPI.f = mpi_fake.f90
MPI.o = mpi_fake.o
DMPI =
FC = g95
FFLAGS = -O2
LFLAGS =
#-------------------------------------------------------------------
# 2. gfortran compiler
# sp + no MKL + OpenMP + no MPI
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP = -fopenmp
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = gfortran
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 3. NAG f95 compiler
# sp + no MKL + no OpenMP + no MPI
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = f95
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 4. ifort compiler
# sp + no MKL + no OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 5. ifort compiler
# sp + MKL + no OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 6. ifort compiler
# sp + no MKL + OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 7. ifort compiler
# sp + MKL + OpenMP + no MPI
# following definitions work for artemis
# before compiling, type
# module purge
# module load intel-mkl
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = $(MPI_f)
#MPI.o = $(MPI_o)
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS = -traceback -lmkl_em64t -lmkl_intel_thread -lmkl_core \
# -lguide -lpthread -lmkl_intel_lp64
#----------------------------------------------------------------------
# 8. ifort compiler (via mpif90)
# sp + MKL + OpenMP + MPI
# following definitions work for artemis
# before compiling, type
# module purge
# module load intel-mkl openmpi
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = $(MPI_f)
#MPI.o = $(MPI_o)
#DMPI = -Dmpi
#FC = mpif90
#FFLAGS = -O2
#LFLAGS = -traceback -lmkl_em64t -lmkl_intel_thread -lmkl_core \
# -lguide -lpthread -lmkl_intel_lp64 -lmpi
#******************************************************************************
我把FC用g95,gfortran,g95,ifort都试过了,但是都出错,比如我用g95时,出现如下:
cpp -P -traditional-cpp -Ddp ddprecision.f90 \
ddprecision_cpp.f90
g95 -c -O2 ddprecision_cpp.f90 -o ddprecision.o
make: g95: Command not found
make: *** [ddprecision.mod] Error 127
#******************************************************************************
#
# Compiler and options
#
# FC specifies the fortran 90 compiler
# FFLAGS are compilation options
# LFLAGS are flags for linking
#
#############################################################################
# Examples
# 1. g95 compiler
# sp + no MKL + no OpenMP + no MPI
# define the following:
PRECISION = dp
CXFFTMKL.f = cxfft3_mkl_fake.f90
CXFFTMKL.o = cxfft3_mkl_fake.o
MKLM =
DOMP =
OPENMP =
MPI.f = mpi_fake.f90
MPI.o = mpi_fake.o
DMPI =
FC = g95
FFLAGS = -O2
LFLAGS =
#-------------------------------------------------------------------
# 2. gfortran compiler
# sp + no MKL + OpenMP + no MPI
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP = -fopenmp
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = gfortran
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 3. NAG f95 compiler
# sp + no MKL + no OpenMP + no MPI
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = f95
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 4. ifort compiler
# sp + no MKL + no OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 5. ifort compiler
# sp + MKL + no OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP =
#OPENMP =
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 6. ifort compiler
# sp + no MKL + OpenMP + no MPI,
# define the following:
#PRECISION = sp
#CXFFTMKL.f = cxfft3_mkl_fake.f90
#CXFFTMKL.o = cxfft3_mkl_fake.o
#MKLM =
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = mpi_fake.f90
#MPI.o = mpi_fake.o
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS =
#----------------------------------------------------------------------
# 7. ifort compiler
# sp + MKL + OpenMP + no MPI
# following definitions work for artemis
# before compiling, type
# module purge
# module load intel-mkl
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = $(MPI_f)
#MPI.o = $(MPI_o)
#DMPI =
#FC = ifort
#FFLAGS = -O2
#LFLAGS = -traceback -lmkl_em64t -lmkl_intel_thread -lmkl_core \
# -lguide -lpthread -lmkl_intel_lp64
#----------------------------------------------------------------------
# 8. ifort compiler (via mpif90)
# sp + MKL + OpenMP + MPI
# following definitions work for artemis
# before compiling, type
# module purge
# module load intel-mkl openmpi
# define the following:
#PRECISION = sp
#CXFFTMKL.f = $(MKL_f)
#CXFFTMKL.o = $(MKL_o)
#MKLM = $(MKL_m)
#DOMP = -Dopenmp
#OPENMP = -openmp
#MPI.f = $(MPI_f)
#MPI.o = $(MPI_o)
#DMPI = -Dmpi
#FC = mpif90
#FFLAGS = -O2
#LFLAGS = -traceback -lmkl_em64t -lmkl_intel_thread -lmkl_core \
# -lguide -lpthread -lmkl_intel_lp64 -lmpi
#******************************************************************************
我把FC用g95,gfortran,g95,ifort都试过了,但是都出错,比如我用g95时,出现如下:
cpp -P -traditional-cpp -Ddp ddprecision.f90 \
ddprecision_cpp.f90
g95 -c -O2 ddprecision_cpp.f90 -o ddprecision.o
make: g95: Command not found
make: *** [ddprecision.mod] Error 127
-
- 帖子: 12
- 注册时间: 2009-10-04 20:56
Re: 求教:在ubuntu9.04下编译fortran程序时出现问题
拜托大侠耐心点帮我看看,我都快急死了