| 查看: 621 | 回复: 2 | |||
| 当前主题已经存档。 | |||
[交流]
【求助】请教大家关于cygwin上安装gfortran
|
|||
|
我从http://gcc.gnu.org/wiki下载了gfortran-4.5-Cygwin-i686.tar.bz2,网上说明如下: Install using the following command: tar -xjvf gfortran-4.4-Cygwin-i686.tar.bz2 -C / This will install gfortran in /usr/local/gfortran. You can then either set /usr/local/gfortran/bin to be in your search path or set up a link in your local ~/bin directory with this command as an example: ln -s /usr/local/gfortran/bin/gfortran.exe ~/bin/gfc Alternatively you can put links in the /usr/local/bin like this: ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfc or ln -s /usr/local/gfortran/bin/gfortran.exe /usr/local/bin/gfortran You can read the man pages for gfortran with this: man -M /usr/local/gfortran/man gfortran Assuming ~/bin is in your search path, you can invoke gfortran with: gfc --version Here is an example session: > cd /home > wget gfortran-Cygwin-i686.tar.bz2 > tar -jxvf gfortran-Cygwin-i686.tar.bz2 -C / > ln -s /usr/local/gfortran/bin/gfortran.exe ~/bin/gfc > gfc --version GNU Fortran 95 (GCC 4.4.0 20070210 (experimental))... Copyright (C) 2005 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING 随后我按照该网上说明将gfortran-4.5-Cygwin-i686.tar.bz2安装在E:\cygwin\usr\local\gfortran目录下,接着 ln -s /usr/local/gfortran/bin/gfortran.exe /bin/gfc 就在/bin生成gfc快捷键 (红色字体按照网上gfortran-4.5-Cygwin-i686说明) ln -s /usr/local/gfortran/bin/gfortran /bin/gfc 就在/bin生成gfc.exe (红色字体按照网上gfortran-4.5-linux 说明) 在/bin生成gfc快捷键和gfc.exe情况下使用命令 man -M /usr/local/gfortran/man gfortran 结果非常长,很多很多 而gfc –version 均未反应 请求解答问题1:这是怎么回事? 于是我考虑按照说明的“You can then either set /usr/local/gfortran/bin to be in your search path” ,将/usr/local/gfortran/bin目录加入到PATH中,而不是“set up a link in your local ~/bin directory”的ln –s 以下是我为了将/usr/local/gfortran/bin目录加入到PATH中查的网上资料取其中部分 一说法 “在你的 ~/.bashrc 里面写 export PATH=$PATH:/tools/bin 注销以后重新登陆就可以。 ” 二说法 “举例:修改PATH变量 我们安装完某个软件,一般都希望把这个软件加入到PATH变量中 这样我们以后就可以随时随地的打开这个软件而不需要进入到某个固定目录去打开它 网上都说要作这样的操作,比如说我们希望加入到PATH变量的是一个fortran的编译器gfortran 他在我的电脑中的目录是 /usr/local/gfortran/bin 那么输入命令: export PATH=$PATH:/usr/local/gfortran/bin 或者 export PATH=/usr/local/gfortran/bin:$PATH 都可以 然后请注意,很多转载的教程到这里就结束了,如果你也在这里结束 那么你下次启动终端的时候,依然会发现PATH变量中没有你要的这个目录(/usr/local/gfortran/bin) 怎么长久性的加入你的PATH变量,就通过我们刚才所说的修改 .bash_profile 文件 我们再把 export PATH=$PATH:/usr/local/gfortran/bin 加入到 .bash_profile 中( 使用命令 vi 编辑) OK,重启cygwin 请求解答问题2 (在我的目录E:\cygwin\home\administrator下,有.bashrc和.bash_profile) 按一说法,用什么打开~/.bashrc ?注销是什么意思? 请对二说法 “我们再把 export PATH=$PATH:/usr/local/gfortran/bin 加入到 .bash_profile 中( 使用命令 vi 编辑)”解释一下,不知怎么使用? 我试用以下命令后不知怎么做 vi .bash_profile |
» 猜你喜欢
国社科又开始会评了,不知道这次命运如何
已经有12人回复
麻烦专家们看看评委们的意见(F口面上)
已经有13人回复
售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急
已经有4人回复
售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急
已经有6人回复
为什么资助数各大高校都创新高,自己申请怎么就这么难
已经有15人回复
科研人应该花精力去思考如何解决问题,而不是去凝练问题
已经有14人回复
要骂人了,新模版改版就是要淡化问题凝练这种虚的东西,结果有个评委还在说凝练得不够
已经有17人回复
基金系统什么内容也没有
已经有10人回复
学科评审组评审是指会评吗?
已经有5人回复
面上函评意见出来了,像什么等级?
已经有17人回复
sandf
木虫 (正式写手)
- 应助: 15 (小学生)
- 金币: 1631.4
- 散金: 121
- 红花: 2
- 帖子: 604
- 在线: 136.6小时
- 虫号: 305516
- 注册: 2006-12-10
- 性别: GG
- 专业: 理论和计算化学

2楼2010-03-12 16:40:19
snoopyzhao
至尊木虫 (职业作家)
- 程序强帖: 16
- 应助: 157 (高中生)
- 贵宾: 0.02
- 金币: 18844.7
- 红花: 29
- 帖子: 3803
- 在线: 1422.4小时
- 虫号: 183750
- 注册: 2006-02-13
- 专业: 污染生态化学
3楼2010-03-13 23:24:43










回复此楼
20