当前位置: 技术问答>linux和unix
设置环境变量求助
来源: 互联网 发布时间:2016-11-27
本文导语: 老板给了我一个128核的服务器的supervisor的权限,叫我跑模拟。机器装的是rhle5. 但是我不能正确装 软件。老板的账户ssh进去可以正常工作,他也给了我几个环境变量: PATH=/usr/local/bin:/usr/lib64/qt- 3.3/bin:/usr/kerberos/bin:/...
老板给了我一个128核的服务器的supervisor的权限,叫我跑模拟。机器装的是rhle5. 但是我不能正确装
软件。老板的账户ssh进去可以正常工作,他也给了我几个环境变量:
PATH=/usr/local/bin:/usr/lib64/qt-
3.3/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/lib64/openmpi/1.
4-
gcc/bin:/usr/lib64/openmpi/1.4-gcc/lib
LD_LIBRARY_PATH=/usr/lib64/openmpi/1.4-gcc/lib
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
MPICC=/usr/lib64/openmpi/1.4-gcc/bin/mpicc
MPIEXEC=/usr/lib64/openmpi/1.4-gcc/bin/mpiexec
LIBS=/usr/lib64/openmpi/1.4-gcc/lib/libmpi_cxx.so.0
我用我的账户登进去,进行设置。
我在tcsh下面用这种格式:
setenv PATH $PATH":/usr/local/bin:/usr/lib64/qt-
3.3/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/lib64/openmpi/1.
4-
gcc/bin:/usr/lib64/openmpi/1.4-gcc/lib"
把第一行搞定了。但是不知道为什么mpicc和 mpieexec 的该如何输入。
用setenv PATH $MPICC":/usr/lib64/openmpi/1.4-gcc/bin/mpicc" 这种吗?
我试了好像不行。
又找了老板,他说我需要自己改写 .mycshrc文件。我找到了我默认的home。找到了这个文件。请问我该如何把他给我的环境变量给转换成那个.mycshrc的格式呢?
我的.cshrc的格式如下:
################################################################################
# #
# .cshrc file (initial setup file for C-Shells) #
# #
# WARNING: PLEASE READ THE REST OF THIS FILE BEFORE MAKING ANY CHANGES !!! #
# #
################################################################################
if (-d /usr/athena/lib/skeleton) then
set skeleton=/usr/athena/lib/skeleton
else
set skeleton=/afs/bp.ncsu.edu/system/common/skeleton
endif
if (-r $skeleton/cshrc) then
source $skeleton/cshrc
else
if ($?prompt) then
echo "WARNING: System-wide initialization files were not found."
echo " C-Shell initialization has not been performed."
endif
set path = (/bin $HOME/bin /usr/local/bin /usr/bin/X11 /usr/athena/bin
/usr/afsws/bin /usr/ucb /usr/bin .)
limit coredumpsize 0
set prompt="eos% "
set ignoreeof
umask 077
alias rm rm -i
endif
if ($?XSESSION) then
if (-r /usr/athena/bin/end_session) alias logout '/usr/athena/bin/end_session && exit '
if (-r /usr/bin/end_session) alias logout '/usr/bin/end_session && exit '
endif
################################################################################
# #
# If you would like to modify any of these variables, please make #
# the changes in a file called .mycshrc located in the top level #
# of your home directory. #
# #
#----- HOW TO C U S T O M I Z E YOUR OWN E N V I R O N M E N T ------#
# #
# .mycshrc This file is sourced by the system to override any default C #
# shell variables. You can use the unset/unalias or set/alias #
# commands to customize your own C shell environment. #
# #
# .xsession This file is invoked by the system to start up your own X11 #
[ Read 6
是不是我就把它复制一个起名叫.mycshrc? 然后格式完全按照这个。只不过把我需要加的那些参数按照格式替换
set path = (/bin $HOME/bin /usr/local/bin /usr/bin/X11 /usr/athena/bin
/usr/afsws/bin /usr/ucb /usr/bin .)
就可以了?
软件。老板的账户ssh进去可以正常工作,他也给了我几个环境变量:
PATH=/usr/local/bin:/usr/lib64/qt-
3.3/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/lib64/openmpi/1.
4-
gcc/bin:/usr/lib64/openmpi/1.4-gcc/lib
LD_LIBRARY_PATH=/usr/lib64/openmpi/1.4-gcc/lib
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
MPICC=/usr/lib64/openmpi/1.4-gcc/bin/mpicc
MPIEXEC=/usr/lib64/openmpi/1.4-gcc/bin/mpiexec
LIBS=/usr/lib64/openmpi/1.4-gcc/lib/libmpi_cxx.so.0
我用我的账户登进去,进行设置。
我在tcsh下面用这种格式:
setenv PATH $PATH":/usr/local/bin:/usr/lib64/qt-
3.3/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/lib64/openmpi/1.
4-
gcc/bin:/usr/lib64/openmpi/1.4-gcc/lib"
把第一行搞定了。但是不知道为什么mpicc和 mpieexec 的该如何输入。
用setenv PATH $MPICC":/usr/lib64/openmpi/1.4-gcc/bin/mpicc" 这种吗?
我试了好像不行。
又找了老板,他说我需要自己改写 .mycshrc文件。我找到了我默认的home。找到了这个文件。请问我该如何把他给我的环境变量给转换成那个.mycshrc的格式呢?
我的.cshrc的格式如下:
################################################################################
# #
# .cshrc file (initial setup file for C-Shells) #
# #
# WARNING: PLEASE READ THE REST OF THIS FILE BEFORE MAKING ANY CHANGES !!! #
# #
################################################################################
if (-d /usr/athena/lib/skeleton) then
set skeleton=/usr/athena/lib/skeleton
else
set skeleton=/afs/bp.ncsu.edu/system/common/skeleton
endif
if (-r $skeleton/cshrc) then
source $skeleton/cshrc
else
if ($?prompt) then
echo "WARNING: System-wide initialization files were not found."
echo " C-Shell initialization has not been performed."
endif
set path = (/bin $HOME/bin /usr/local/bin /usr/bin/X11 /usr/athena/bin
/usr/afsws/bin /usr/ucb /usr/bin .)
limit coredumpsize 0
set prompt="eos% "
set ignoreeof
umask 077
alias rm rm -i
endif
if ($?XSESSION) then
if (-r /usr/athena/bin/end_session) alias logout '/usr/athena/bin/end_session && exit '
if (-r /usr/bin/end_session) alias logout '/usr/bin/end_session && exit '
endif
################################################################################
# #
# If you would like to modify any of these variables, please make #
# the changes in a file called .mycshrc located in the top level #
# of your home directory. #
# #
#----- HOW TO C U S T O M I Z E YOUR OWN E N V I R O N M E N T ------#
# #
# .mycshrc This file is sourced by the system to override any default C #
# shell variables. You can use the unset/unalias or set/alias #
# commands to customize your own C shell environment. #
# #
# .xsession This file is invoked by the system to start up your own X11 #
[ Read 6
是不是我就把它复制一个起名叫.mycshrc? 然后格式完全按照这个。只不过把我需要加的那些参数按照格式替换
set path = (/bin $HOME/bin /usr/local/bin /usr/bin/X11 /usr/athena/bin
/usr/afsws/bin /usr/ucb /usr/bin .)
就可以了?
|
setenv PATH $MPICC":/usr/lib64/openmpi/1.4-gcc/bin/mpicc"
这个意思设置环境变量PATH, $MPICC意思是在这次设置PATH值时MPICC的值。
如果MPICC=/usr则
PATH=/usr:/usr/lib64/openmpi/1.4-gcc/bin/mpicc
改成这样
setenv MPICC $MPICC":/usr/lib64/openmpi/1.4-gcc/bin/mpicc"
这个意思设置环境变量MPICC, $MPICC意思是在这次设置MPICC值时MPICC的值。
你应该可以明白了
这个意思设置环境变量PATH, $MPICC意思是在这次设置PATH值时MPICC的值。
如果MPICC=/usr则
PATH=/usr:/usr/lib64/openmpi/1.4-gcc/bin/mpicc
改成这样
setenv MPICC $MPICC":/usr/lib64/openmpi/1.4-gcc/bin/mpicc"
这个意思设置环境变量MPICC, $MPICC意思是在这次设置MPICC值时MPICC的值。
你应该可以明白了
|
一般卸载你的~/.cshrc理就行了
格式应该是export $PATH:你的path
格式应该是export $PATH:你的path