作者flied (libertines)
看板Linux
标题Re: [问题] 安装软体的路径错误
时间Mon Jan 27 10:26:10 2014
以下是soem大的回应
还有我的问题
(徵得soem大同意附上)
※ 引述《flied (libertines)》之铭言:
: ※ 引述《soem (流水)》之铭言:
: : 这应该就是可以直接call得到talys指令了
: : 这是之前的文章
: : 这是後来你执行的状况
: : 请注意你现在的所在目录,
: : 比对两次结果,你是不是该去 ~/physics/talys/samples 寻找你的verify
: : 虽然不知道为甚麽你会在/bin里面,姑且推论一下你的想法好了:
: : 1. 你可能认为执行档要在/bin底下才能跑?
: : => 实际上不用,跟档案权限有关系
: : 但要注意的是,如果你要执行的不是在系统$PATH里面的程式,
: : 要用相对或绝对路径的方式去呼叫。
: : 像是你在 ~/physics/talys/samples里面呼叫相对路径 "./":
: : ~/physics/talys/samples$ ./verify
: : 或是绝对路径
: : /home/你的帐号/physics/talys/samples/verify
: : 若是你直接呼叫verify,就是呼叫到系统预先有的那只verify工具。
: : 2. 你可能不确定chmod的功能以及"bash: ./verify: 拒绝不符权限的操作"的成因
: : => 首先无论是script或程式一般来说都需要档案权限才能执行;
: : 这边的权现有两个面向:你的权限,和设定给档案的权限。
: : 我们先来看看一般权限的呈现方式:
: : $ ls -ld /bin/bash
: : -rwxr-xr-x 1 root root 959120 Mar 29 2013 /bin/bash
: : 第一组rwx是这个档案的拥有者root所能做的事情
: : read, write, execute
: : 第二组rwx是这个档案的拥有者群组,root群组所能做的事情
: : 所以有在root群组且非使用者root则会参考这组设定
: : 第三组rwx则是除此以外的人的权限。
: : 所以说,我们可以看到/bin/bash这个档案,
: : - 拥有者root具有所有权限;
: : - 拥有者群组root没有修改(写入)的权限,但可以读取和执行;
: : - 剩下的人亦是没有修改、有读取执行的权限。
: : 一般的文字档案类型往往是644,例如:
: : $ ls -ld /etc/hosts
: : -rw-r--r-- 1 root root 342 Jan 22 20:16 /etc/hosts
: : 我想你的~/physics/talys/samples/verify应该也是类似的情形,
: : 因此你需要的是帮他加上execute
: : ~/physics/talys/samples/$ chmod +x verify
: : sudo 可以帮你取得不同使用者的权限,但针对x这项设定通常需要用chmod来调整。
: 谢谢
: 我执行了这行成功
: lee@lee-X402CA:~/physics/talys/samples$ ./verify
: bash: ./verify: 拒绝不符权限的操作
: lee@lee-X402CA:~/physics/talys/samples$ chmod +x verify
: lee@lee-X402CA:~/physics/talys/samples$ ./verify
: /home/lee/physics/talys/samples/17/a/new
: /home/lee/physics/talys/samples/17/b/new
: /home/lee/physics/talys/samples/17/c/new
: /home/lee/physics/talys/samples/11/new
: /home/lee/physics/talys/samples/10/a/new
: /home/lee/physics/talys/samples/10/b/new
: /home/lee/physics/talys/samples/20/new
: /home/lee/physics/talys/samples/1/f/new
: /home/lee/physics/talys/samples/1/g/new
: /home/lee/physics/talys/samples/1/e/new
: /home/lee/physics/talys/samples/1/h/new
: /home/lee/physics/talys/samples/1/a/new
: /home/lee/physics/talys/samples/1/b/new
: /home/lee/physics/talys/samples/1/d/new
: /home/lee/physics/talys/samples/1/i/new
: /home/lee/physics/talys/samples/1/c/new
: /home/lee/physics/talys/samples/8/new
: /home/lee/physics/talys/samples/21/new
: /home/lee/physics/talys/samples/3/a/new
: /home/lee/physics/talys/samples/3/b/new
: /home/lee/physics/talys/samples/3/d/new
: /home/lee/physics/talys/samples/3/c/new
: /home/lee/physics/talys/samples/22/new
: /home/lee/physics/talys/samples/9/new
: /home/lee/physics/talys/samples/6/a/new
: /home/lee/physics/talys/samples/6/b/new
: /home/lee/physics/talys/samples/19/new
: /home/lee/physics/talys/samples/16/a/new
: /home/lee/physics/talys/samples/16/b/new
: /home/lee/physics/talys/samples/16/d/new
: /home/lee/physics/talys/samples/16/c/new
: /home/lee/physics/talys/samples/2/new
: /home/lee/physics/talys/samples/24/new
: /home/lee/physics/talys/samples/25/new
: /home/lee/physics/talys/samples/12/new
: /home/lee/physics/talys/samples/23/new
: /home/lee/physics/talys/samples/14/new
: /home/lee/physics/talys/samples/5/new
: /home/lee/physics/talys/samples/15/new
: /home/lee/physics/talys/samples/18/a/new
: /home/lee/physics/talys/samples/18/b/new
: /home/lee/physics/talys/samples/4/a/new
: /home/lee/physics/talys/samples/4/b/new
: /home/lee/physics/talys/samples/13/new
: /home/lee/physics/talys/samples/7/new
: 似乎成功
: 但readme如下
: Verification
: ------------
: - cd samples
: - verify
: Under Linux/Unix, this should run all sample cases (about 1 hour on
: a fast PC).
: 我这大概3秒就结束
: 所以应该还没有装好
: : 这边就只是你的系统有安装一个叫做verify的指令,
: : 但这你的使用经验看来,那个指令并不是你这次安装的步骤中需要呼叫到的。
: Your own calculations
: ---------------------
: - talys < input > output
: where you can make your own input file starting from the many sample cases
: we provide.
: 我试着计算执行
: 错误如下
: lee@lee-X402CA:~/physics/talys/test$ talys input output5
soem:
先说这行:
$ talys < input > output
< :把档案读进stdin
> :把s
"如果"我没有误会他的readme的话,这行命令是:
1. 应该是要你准备个名叫input且符合他的格式的input档案
2. 然後,会输出结果到output档案
格式的话,照他readme这句是他有提供一些sample可以参考。
不晓得你下面的input是不是有照这个方式呢?
(不过你得到的错误讯息是下面那件事情)
me:
我的input是直接从sample复制贴上到test资料夹
所以格式内容是一模一样
: TALYS-error: Structure database not installed: change path in machine.f
: 我的machine.f 在 /home/lee/physics/talys/source
: https://www.dropbox.com/s/zmbhzustk6hnp6v/2014-01-26%2021%3A39%3A35.png
: 内容如下
: https://www.dropbox.com/s/yq6o4hbraqftuf6/2014-01-26%2021%3A32%3A21.png
因为我看不懂fortran所以只能用猜的...
他似乎是需要...嗯...可能是
home/structure/abundance/z001
那个
home就是你改的变数,看看该路径是不是有这个档案。
有
https://www.dropbox.com/s/e46dmelae22v3jw/2014-01-27%2009%3A49%3A55.png
: c ********************* Set directory for structure data ***************
: c
: c path : directory containing structure files to be read
: c lenpath: length of pathname
: c
: c The maximum length of the path is 60 characters
: c
: home='/home/lee/physics/talys/' (我改这行)
: lenhome=0
: do 10 i=1,60
: if (home(i:i).eq.' ') goto 100
: lenhome=lenhome+1
: 10 continue
: 100 path=home(1:lenhome)//'structure/'
: lenpath=lenhome+10
: c
: c Test to check accessibility of structure files
: c
: inquire (file=path(1:lenpath)//'abundance/z001',exist=lexist)
: if (lexist) return
: write(*,'(" TALYS-error: Structure database not installed:",
: + " change path in machine.f")')
: stop
: end
: Copyright (C) 2013 A.J. Koning, S. Hilaire and S. Goriely
: 我改的只有这部份
: 原本是 home='.'
: 不能执行後,我改成
: home='/home/lee/physics/talys/'
: 这样改对吧?
soem :
之前FedoraHanT给的hint中这行:
sed -i 's|/home/finux01b/akoning/talys/|.|' machine.f
就是把他换成 '.'
me: 所以原本的 home='.' 是对的?
但我改回
执行的错误一样
TALYS-error: Structure database not installed: change path in machine.f
soem :
不过更重要的是,fortan是要重新compile的喔!
所以你改过之後也得重新compile出新的执行档才有用。
me: 抱歉,我是超弱手,这边要如何compile?
※ 编辑: flied 来自: 61.220.220.27 (01/27 10:53)