w*******U 发帖数: 256 | 1 用 gfortran 编译,
gfortran -o test test.f
结果报错
relocation truncated to fit
应该是stack的内存小于2G的问题,然后加上选项
gfortran -o test test.f -mcmodel=medium
结果没有报错,但有 warning
Warning: ignoring incorrect section type for .lbss
也生成了可执行代码,试运行了几步,也还行。但是不知道这样的 warning 会不会有
什么潜在的危险?
谢谢大家! |
|
m*******s 发帖数: 22 | 2 Hello everyone,
I have some data files which were originally written with a big_endian
machine.
Now, I try to use a fortran routine to read them with the compiler of
gfortran
built in a little_endian linux system. The input line is as follows:
open(8,file='file1' // cdat,
. form='unformatted',convert='big_endian',
. status='old',access='direct',recl=im*jm*4)
Where cdat is a string, say 198101.
When I compile the routine with gfortran, the system tip is: syntax error,
convert='big_endian'. If I r |
|
p******t 发帖数: 228 | 3 代码白痴请教fortran问题Orz
自己在试验一个算法,因为以前这方面的程序都是用fortran95写的,所以我现在借用
一下看看。
可是编译时就出现错误:(1) procedures must be either all SUBROUTINEs or all
FUNCTIONs
这个gfortran是gcc4.6自带的,在mac上运行
另外如果在linux下运行gcc4.6自带的gfortran去编译这个程序居然就通过了,不清楚
时啥原因造成的。。。
谢谢 |
|
m*******s 发帖数: 22 | 4 Hello everyone,
I have some data files which were originally written with a big_endian
machine.
Now, I try to use a fortran routine to read them with the compiler of
gfortran
built in a little_endian linux system. The input line is as follows:
open(8,file='file1' // cdat,
. form='unformatted',convert='big_endian',
. status='old',access='direct',recl=im*jm*4)
Where cdat is a string, say 198101.
When I compile the routine with gfortran, the system tip is: syntax error,
co |
|
m*******s 发帖数: 22 | 5 Hello everyone,
I have some data files which were originally written with a big_endian
machine.
Now, I try to use a fortran routine to read them with the compiler of
gfortran
built in a little_endian linux system. The input line is as follows:
open(8,file='file1' // cdat,
. form='unformatted',convert='big_endian',
. status='old',access='direct',recl=im*jm*4)
Where cdat is a string, say 198101.
When I compile the routine with gfortran, the system tip is: syntax error,
convert='big_endian'. If I r |
|
b****z 发帖数: 337 | 6 我知道Gfortran是个Free的Compiler
但是我还需要许多的其它Functions or Subroutines来进行运算,比如Matrix
operations
Random variable generations,Gfortran下用什么Library库函数 吗?
谢谢 |
|
p******t 发帖数: 228 | 7 代码白痴请教fortran问题Orz
自己在试验一个算法,因为以前这方面的程序都是用fortran95写的,所以我现在借用
一下看看。
可是编译时就出现错误:(1) procedures must be either all SUBROUTINEs or all
FUNCTIONs
这个gfortran是gcc4.6自带的,在mac上运行
另外如果在linux下运行gcc4.6自带的gfortran去编译这个程序居然就通过了,不清楚
时啥原因造成的。。。
谢谢 |
|
m*******s 发帖数: 22 | 8 Hello everyone,
I have some data files which were originally written with a big_endian
machine.
Now, I try to use a fortran routine to read them with the compiler of
gfortran
built in a little_endian linux system. The input line is as follows:
open(8,file='file1' // cdat,
. form='unformatted',convert='big_endian',
. status='old',access='direct',recl=im*jm*4)
Where cdat is a string, say 198101.
When I compile the routine with gfortran, the system tip is: syntax error,
convert='big_endian'. If I r |
|
F******l 发帖数: 90 | 9 【 以下文字转载自 Linux 讨论区 】
发信人: Football (Ball), 信区: Linux
标 题: gfortran 编译f90程序
发信站: BBS 未名空间站 (Wed Apr 30 12:52:03 2008), 转信
怎么也弄不对,不知道用什么option,看了半天manpage也不明白
那位递个援手?
谢了 |
|
O******e 发帖数: 734 | 10 What does the compiler tell you when you try to compile something?
Try compiling this program with just "gfortran" and no options.
PROGRAM MAIN
END PROGRAM MAIN
What does the compiler say? |
|
m*******g 发帖数: 284 | 11 一个fortran程序在windows的compaq Visual fortran能够运行。
在LINUX(unbuntu)下也能够用gfortran顺利编辑并生成可执行文件(无error提示)
可是运行这个可执行文件时,却发现运行不完整,得不到全部预期的结果。过程中,没
有出现任何error提示。
请问这是怎么回事?
小弟刚开始学linux,请大家指导,谢谢! |
|
O******e 发帖数: 734 | 12 Try Google "gfortran endian". |
|
b****z 发帖数: 337 | 13 一直以来是在Windows下用的Compaq visual fortran 或是Intel Visual fortran ,现在
想在Linux下用.对于Free的Gfortran, libgfortran是相当于CVF或IVF的IMSL吗?我在网上
也搜不到manual,请问大家一般是用的什么库?谢谢 |
|
|
p****e 发帖数: 1009 | 15 intel的efficiency and accuracy是最好的,同一个程序可能可以比gfortran快60%,
gfortran编译的程序运行起来慢,且我发现其计算结果不精确,在数值计算的研究里绝
对不应该用gfortran计算的结果来作为publication的内容。g95只是曾经用过,至少没
发现计算结果不准确的问题 |
|
d*******0 发帖数: 113 | 16 日志如下:请达人不吝赐教!
谢谢!
* Installing *source* package 'glmnet' ...
This package requires a fortran 90 compiler. We assume
that your fortran 90 environment is set up appropriately.
Reference: Section on 'Using F95 code' in R-exts manual.
R configured for gfortran...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gfortran -fdefault-real-8 -ffixed-form -fpic -g -O2 -c newermultGLMnet.f90 -
o newermultGLMnet.o
gfortran -shared -L/usr/local/lib64 -o glmnet.so newermultGLMn... 阅读全帖 |
|
k****5 发帖数: 546 | 17 大气模型软件需要cluster吧。是cluster,一定会预装pgi,intel.
如果自己编译玩玩:
intel v12 is free for academic.
if use gfortran, understand each options first, then find matching ones in
gfortran. check manpages. 如果linking library 出问题,需要gcc 再编译一下。
大气模型软件一般会用mpi, 用mpicc编译就行了。看看mpicc -compile-info 信息,确
定编译mpi的compiler 是gcc. |
|
j***x 发帖数: 1469 | 18 我使用的是 topHat 和cufflinks 处理。 参考文献是 :
nature protocols VOL.7 NO.3 | 2012
:Differential gene and transcript expression analysis of RNA-seq
experiments with TopHat and Cufflinks。
最后CummeRbund需要 R 环境,我安装了, 结果调用gfortran的时候找不到一个文件夹
, 我安装了gfortran,最新版。
错误信息如下:
[jokex@localhost download]$ R
/usr/lib64/R/bin/exec/R: error while loading shared libraries: libgfortran.
so.1: cannot open shared object file: No such file or directory
[jokex@localhost download]$ su --
Password:
[root@localhost download]# R
/usr... 阅读全帖 |
|
O******e 发帖数: 734 | 19 Even though it is advisable to use the same compiler suite (gcc/g77/gfortran,
or icc/ifort), I'm not sure that this is the cause of the problem. I've
been mixing gcc/g77/icc/ifort all the time when testing my code, and I have
never had any problem.
(I don't use gfortran because it is too buggy. I'm also curious why you
say ifort is slow? In my experience the code it produces is way faster
than g77 or pgf77/pgf90, but you have to make good use of the Fortran 9x
language. Well, maybe you are c |
|
b***y 发帖数: 10 | 20 Or you can make a link from gfortran (or other fortran's) to g77. You can
run the following command in the /usr/bin/ folder:
ln gfortran g77 |
|
z*******3 发帖数: 13709 | 21 jvm启动需要时间,掉入jit也需要时间
一般要调用两次以上的类才会使用jit
所以以前搞word ladder 2我都先强行让leetcode执行两遍之后
第三遍一般就过了,后来好像改了标准,懒得再搞了
纠结这点ms没啥意义,现实中你不会在乎这点东西的
少数情况比如android这种手机系统例外
客户端因为经常性启动关闭app,所以导致虚拟机调用的class经常换
所以如果启动太慢会影响客户体验,所以android用的是apk而不是jar以优化效率
实在不行,你把java文件编译成native code去执行
不过这样跨平台搞死人,一个最常见例子就是mac上安装scipy就跟疯了一样
要先装xcode,然后commandline,然后安装gfortran,然后numpy,然后scipy
期间还有无数的warning,胆战心惊
都是这些烂包不跨平台造成的恶果,不停地擦屁股 |
|
z****e 发帖数: 54598 | 22 现实生活中java的类库大概是python类库的五倍多
质量好至少两倍,debug成本至少低一半,运行效率快至少三倍
python的scipy库的例子
我在macosx上用,要先装xcode,再装commandline,再装gfortran,然后编译,一堆
warning
看得我胆战心惊,最后还要装numpy,然后才能装上scipy,就因为scipy里面有fortran
的东西
java相比之下,我download一个apache的project,无非几个jar文件,全部扔到lib里
面去
如果有maven gradle就更简单了,写一两行,自动download,安装
搞定,java lib没有不垮平台的,也没有说需要我再编译的
什么平台都一样,python这种东西,给学统计的用差不多
production的核心运行库我一定不用python,慢不说,平台的不兼容会带来无数问题
debug,maintenance这些就更不要说了 |
|
z****e 发帖数: 54598 | 23 python的lib的各种兼容性问题可以让人抓狂
我搞一个scipy都要重新编译gfortran
如果要绕开这种兼容性问题,其实最好用linux,比如楼上用的ubuntu
但是我是懒得折腾了,所以苦逼地折腾了好久scipy的安装
烦都烦死了,最可恶的上次有人还说我这么搞python不对…… |
|
w*****3 发帖数: 910 | 24 咱们这有谁对linux比较熟啊,linux下软件安装编译fortran 比如 gfortran, intel
fortran, portland fortran 啥的?请教些问题。 多谢! |
|
w*****3 发帖数: 910 | 25 My system is Ubuntu 10.10. I have a software which needs to compile from
source using Portland Group F90 compiler pgf90. However this compiler is not
free. I wonder whether I can use GNU free compiler, such as gfortran, to
compile the source code. There are some compiler configurations for
different compiler that I need to clarify. If somebody is a guru in this
field, please leave a message. I may contact you in person. Thanks a lot. |
|
P***a 发帖数: 4213 | 26 免费的就只有gcc/gfortran了
盗版的intel可能好一些 |
|
p****e 发帖数: 1009 | 27 盗版的intel比较好,免费的g95也不错,至少比gfortran好 |
|
d***r 发帖数: 2032 | 28 在LINUX下有免费的G77,GFORTRAN,gcc 等,但是MAC里似乎没有自带的编译器。请大
家给推荐几款类似的吧 |
|
s*****l 发帖数: 167 | 29 Why not use gfortran
★ 发自iPhone App: ChineseWeb 7.3.1 |
|
s********r 发帖数: 55 | 30 同一个程序我用Fortran写过,gfortran 和ifort 都编译过
Fortran比C慢不少,有接近10倍的速度差 |
|
z****e 发帖数: 54598 | 31 java的跨平台太重要了
python那些破包都不跨平台
破事多得让人想死
scipy在mac上要装xcode,还要重新编译gfortran
各种扯蛋的事 |
|
T*********r 发帖数: 11175 | 32 盗版估计有,
Mac就是多花钱
我一直用Intel Fortran这个在Linux的个人用户是不要钱的
跑Mac下就没这好事,这不,刚花了好几百买了一个academic version Intel Fortran
Compiler
(很多过去写的程序跑gfortran下搞不通,据说那东西比g77要picky) |
|
l***o 发帖数: 390 | 33 我以前遇到过这样的问题,大多是不同的编译器用不同的 name mangling 方法造成的
,特别是函数名字中有下划线时。比如用 gfortran 连接 g77 编译的库就要加上编译
选项 -ff2c。那个函数名中有下划线吗?
还有一种可能是连接库的顺序不对,不过比较少见,一般不会把 .o 文件放在 -
llapack 之后的。可以尝试把 lapack 库在待连接文件中的顺序向后调整一下。 |
|
|
Z**0 发帖数: 1119 | 35 这个年头都是用gfortran了。
MadGraphII' |
|
|
l***s 发帖数: 1405 | 37 最近编了一个程序, 在装了ubuntu的netbook上用gfortran编译完得到a.out,然后要
运行的这
个a.out时,总是不运行,出现一句 killed.
同样的程序在台式机的ubuntu上可以运行,有人知道是什么原因吗?
谢谢 |
|
w*****3 发帖数: 910 | 38 准备compile CMAQ 一个大气模型软件。
里面的module 指明用PGI or Intel Fortran 。
Requirements: I/O API & netCDF libs, CVS, and PGI or Intel Fortran
但这两个fortran compiler 都不免费。
想用GNU gfortran 但是module中 Flags参数不一样。
#> Portland Group 9.01 Fortran Compiler Flags
#set FSTD = "-Mfixed -Mextend"
#set LINK_FLAGS = "-Bstatic"
#> Intel Fortran 10.1 Compiler Flags
set FSTD = "-extend_source 132 -vec-report0 -cm -w95 -c"
set LINK_FLAGS = "-liomp5 -lpthread -Bstatic"
不知道有哪位高手可以指点一下。
多谢了 |
|
e**********a 发帖数: 279 | 39 fresh newbie of linux, 好不容易装好了ubuntu 11.10, 我的目标是用g77 编译一个
很老的一个东东。
网上依葫芦画瓢的装了个老版本的g77 和新版本的gcc, 发现还是不行, gfortran 可
行, gcc不行, 不管 g77 还是 c compiler, 据说是骨子里的问题。
linux-vdso.so.1 => (0x00007fff644af000)
libc.so.6 => /lib64/libc.so.6 (0x00000037eb800000)
/lib64/ld-linux-x86-64.so.2 (0x00000037eb400000)
英文的论坛里说的都不管用, 类似 ln -s,
现在有两个没试, 一个是装 libc6-dev
一个是卸了重装低版本的。
可惜这只是想法, 因为半调子,我都不知道具体的commands 去下载和重装 ( 之前都
是照着网上的step-by-step弄的, 比如, 改sources.list, 我找不到类似的联接,
或者联结上的links 太复杂,不知... 阅读全帖 |
|
b*********7 发帖数: 12 | 40 我试了,好像不行:(
Makefile 全文如下,麻烦这位大侠再给看看,好人啊!!!
# $Id: GMRFLib-Makefile,v 1.56 2007/09/06 21:57:38 hrue Exp $
# USER OPTIONS
# the full path to where to install the library, headerfiles and docs.
# if you use a relative path, you have to modify the Makefile in the
# $(PREFIX)/doc/examples yourself.
PREFIX = /usr/local
# what to call the library
GMRFLibNAME = GMRFLib
# select compilers and optimized compiler-options. add -march=.... etc
yourself
CC = gcc
FC = gfortran
FCEXTRAFLAGS = -fno-second-unders |
|
l********r 发帖数: 175 | 41 【 以下文字转载自 Linux 讨论区 】
发信人: lilyflower (smile), 信区: Linux
标 题: what kind of language this is and how to change it?
发信站: BBS 未名空间站 (Fri Aug 8 11:58:26 2008)
In my f90 source code files, it has following lines:
#ifdef SYNC
call mpi_barrier(mpi_comm_world,ierror)
#endif
what kind of languages that used? when using gfortran compiler to compile it
, I got warning message as: Illegal preprocessor directive.
I tried to correct it. How to change the source code or makefile a little
bit so that |
|
r****t 发帖数: 10904 | 42 that's usually done in the configuration step. why are you compiling numpy
yourself? Most numpy binaries today are compiled with gfortran instead of
g77 now. |
|
x********g 发帖数: 100 | 43 I am new to fortran programming, and I am using a linux os. |
|
w***g 发帖数: 5958 | 44 gcc那个支持的平台多,软件兼容性好。如果是intel的cpu,那么还是intel的那个编译
出来的代买快一点。Intel有个math kernel library,那个东西貌似也可以在gcc上用,
比ATLAS快不少。 |
|
|
x********g 发帖数: 100 | 46 why? If i'm on AMD cpu, will it be still faster? |
|
d****2 发帖数: 6250 | 47
yes. why? you need experts in compiler optimization to make it faster. gcc does
have best front end though.
intel's mkl has a russian team working on it and use some techniques very
specific to x86. |
|
|
|
p*********g 发帖数: 226 | 50 但我可以负责的告诉你: 没这时间看这么多乱哄哄的结果。对从没碰过fortran的人,
一个小时也搞不定。人家这辈子估计第一次也是最后一次碰 fortran了。
改用 MingW 上的 gfortran,轻松搞定。 |
|