LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: hyper

How to install the file install.sh in the debian operating system?

[复制链接]
 楼主| 发表于 2005-6-24 21:31:57 | 显示全部楼层
How to install gcc and g77 on the ubuntu?
Is it difficult?
I think it maybe need gcc or g77 to compile.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-24 21:38:45 | 显示全部楼层
I think the ifc and mkl is not installed on debian system now.
Maybe one day it will.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-24 21:39:50 | 显示全部楼层
Thank you all the same.
回复 支持 反对

使用道具 举报

发表于 2005-6-24 22:39:13 | 显示全部楼层
Post by hyper

I think the ifc and mkl is not installed on debian system now.
Maybe one day it will.

多数问题会在google里找到答案,虽然好多商业的东西首选测试平台不是debian,自己做起来麻烦点和对自己的要求高了些而已
Intel Compiler Installer Script (in Python) for Debian
[Debian/Linux]

雖然 Intel Compiler for Linux 的 install.sh 本?砭涂梢园 binary 安裝到 Debian 裡,不過會使用到 rpm 資料庫;我不喜歡。

因此,我擴充之前作的字串取代 python script,?娀 installer,已測試過 Intel C++ Compiler 與 Intel Fortran Compiler 8.1 與 9.0 版。

以下是這個 script 的內容,檔名請取為 icinst.py :

#!/usr/bin/env python
# -*- coding: UTF-8 -*-

"""
Intel Compiler 安裝指令稿

利用 alien ?戆 Intel Compiler 安裝在 Debian 上。

在安裝完畢後,會將:
1. <INSTALLDIR>/bin 目錄內各文字檔內的安裝目錄位置取代為
   絕對路?健
2. <INSTALLDIR>/bin 目錄內各指令稿檔案內, RedHat 系所使
   用的 'man -w' 取代為 Debian 使用的 'manpath'。

請利用參數 '-h' 取得詳細的參數說明。

$Id: icinst.py,v 1.1 2005/06/24 04:45:49 yungyuc Exp $
"""

import sys, os
from popen2 import popen2

__revision__ = "$Revision: 1.1 $".split()[1]

class parameters:
  """
  處理指令行引數。
  """
  def __init__(self):
    from optparse import OptionParser, OptionGroup
    op = OptionParser(
        usage = "usage: %prog <rpmpackage> <dir>",
        version = "%prog, " + "%s" % __revision__
        )
    op.add_option("-f", action="store_true", \
        dest="forcedel", default=False, \
        help="if destination directory exists, delete it without warning."
        )
    self.op = op
    (self.options, self.args) = self.op.parse_args()
params = parameters()

def test_prerequisite( targets ):
  """
  測試安裝所需的工具是否存在。
  """
  result = []
  for target in targets:
    so, si = popen2( "whereis %s" % target )
    if len(so.read().split()) == 1:
      result.append( False )
    else:
      result.append( True )
  return result

def subs(old, new, fn):
  """
  執行取代工作的函式
  old: 被取代字串
  new: 新取代字串
  fn:  工作的目標檔名
  """
  import re
  # 讀取?碓促Y料
  f = open( fn, 'r' );
  orig = f.read();
  f.close()
  # 執行取代
  replaced = re.sub( old, new, orig )
  # 把取代後的整筆資料寫回檔案
  f = open( fn, 'w' )
  f.write( replaced )
  f.close()

def extract_rpm( rpmfn ):
  """
  用 alien 把 .rpm 拆開,
  傳回暫存目錄 itmp。
  """
  so, si = popen2( "fakeroot alien -s -d %s" % rpmfn )
  tbuf = so.read().split()
  itmp = tbuf[1]
  return itmp

def install_setpath( itmp, inst_destination ):
  """
  ? itmp 裡找出包含 'bin', 'lib' 等目錄的父目錄,
  據以決定 (isrc, idst) ?K且傳回。
  """
  for root, dirs, filenames in os.walk( itmp ):
    if "bin" in dirs:
      skel = ""
      while root != itmp:
        root, tail = os.path.split(root)
        skel = os.path.join( tail, skel )
  isrc = os.path.join(itmp, skel)[:-1]
  idst = os.path.join(inst_destination, skel)[:-1]
  while True:
    try:
      os.renames( isrc, idst )
      break
    except OSError, (errno, strerror):
      if errno == 39:
        if not params.options.forcedel:
          sys.stderr.write(
              "[ERROR] destination dir '%s' not empty, "
              "clean up tmp dir '%s' \n" %
              ( idst, itmp )
              )
          os.system( "rm -rf %s" % itmp )
          sys.exit(39)
        else:
          sys.stderr.write(
              "[WARN] destination dir '%s' not empty, "
              "but I am forced to delete it anyway\n" %
              idst
              )
          os.system( "rm -rf %s" % idst )
  return isrc, idst

def install( rpmsrc, inst_destination ):
  """
  安裝 .rpm 到指定的目錄。
  """
  sys.stdout.write( "Extracting %s\n" % rpmsrc )
  itmp = extract_rpm( rpmsrc )
  isrc, idst = install_setpath( itmp, inst_destination )

  # 掃瞄 bin 裡的檔案型態
  so, si = popen2( 'file %s' % os.path.join(idst, "bin", '*') )
  fns = []
  for line in so.readlines():
    tokens = line.split(':')
    fns.append( tokens[:2] )

  sys.stdout.write(
      "Substituting '<INSTALLDIR>' with proper idst (%s) for: \n" %
      os.path.abspath(idst)
      )
  for fn, des in fns:
    if des.find('text') != -1:
      subs("<INSTALLDIR>", os.path.abspath(idst), fn)
      sys.stdout.write( " \""+os.path.basename(fn)+"\"" )
  sys.stdout.write( "\nin %s .\n" % os.path.join(idst, "bin"))

  sys.stdout.write(
      "Substituting 'man -w' with 'manpath' for: \n"
      )
  for fn, des in fns:
    if des.find('shell script') != -1:
      subs("man -w", "manpath", fn)
      sys.stdout.write( " \""+os.path.basename(fn)+"\"" )
  sys.stdout.write( "\nin %s .\n" % os.path.join(idst, "bin"))

  os.system( "rm -rf %s" % itmp )
  sys.stdout.write( "Installed at %s\n" % idst )

def main():
  """
  主函式。
  """

  # 檢查必要的工具程式
  prs = 'fakeroot', 'alien'
  sys.stdout.write( "Tools" )
  for pr in prs: sys.stdout.write( " '%s'" % pr )
  sys.stdout.write( " would be used to do the installation.\n" )
  rprs = test_prerequisite( prs )
  missing = False
  for pr, rpr in zip(prs,rprs):
    if rpr == False:
      sys.stdout.write( "[ERROR] tool '%s' missing.\n" % pr )
      missing = True
  if missing:
    sys.exit(5)
  sys.stdout.write( "\n" )

  if len(params.args) < 2:
    sys.stdout.write( "please specify correct parameters.\n\n" )
    params.op.print_help()
    sys.exit(-1)
  else:
    install( params.args[0], params.args[1] )
  
if __name__ == '__main__':
  main()


http://yungyuc.net/365
http://yungyuc.net/
回复 支持 反对

使用道具 举报

发表于 2005-6-24 22:55:51 | 显示全部楼层
直接apt-get install alien什么问题就搞掂了.说那么多废话干吗?关键install.sh要依赖librpm4,rpm这两个文件
回复 支持 反对

使用道具 举报

发表于 2005-6-24 23:35:47 | 显示全部楼层
Post by LittlesnowLinux
直接apt-get install alien什么问题就搞掂了.说那么多废话干吗?关键install.sh要依赖librpm4,rpm这两个文件


what he gets is not a rpm file but a source

but ,what's alien used to do ? make *.rpm to *.deb!
回复 支持 反对

使用道具 举报

发表于 2005-6-24 23:43:07 | 显示全部楼层
Post by hyper
How to install gcc and g77 on the ubuntu?
Is it difficult?
I think it maybe need gcc or g77 to compile.


how to install software on debian or ubuntu ?
apt-get install XXXX
gcc and g++ are apps as QQ and firefox etc.
回复 支持 反对

使用道具 举报

发表于 2005-12-23 14:26:46 | 显示全部楼层
Post by LittlesnowLinux
直接apt-get install alien什么问题就搞掂了.说那么多废话干吗?关键install.sh要依赖librpm4,rpm这两个文件

我不喜欢你这种态度

这个东西主要是install.sh里面有一些post-installation modifications

我曾经安装过ifc8.0和mkl7.2在hiweed 0.6上
方法是参考 这个安装的ifc
ttp://colt.projectgamma.com/intel/ixc-debian.html
                        Davor Ocelic, docelic+linux.hr, Mar 23, 2004.
                        Last update: updated teochem article url, Jun 30, 2004.
               

Debian packages and Intel Compilers (C++, Fortran, ...)

Ok, here we are. As you probably noticed, Intel distributes its compilers for linux in tarballs, which in turn consist of .rpm packages and accompanying legal notes which vividly describe you all the perverted, artificially imposed restrictions on the use of their software.

Personally, I wouldn't even bother with icc, but I have some Uni work to do, and I must use it. So here you'll find out how to register and download the Intel compiler of your choice, then turn it into a Debian package (.deb) and finally install it. (This procedure should probably work for other Intel packages for Linux as well.)

Giving credit where it's due, the web page http://www.theochem.uwa.edu.au/fortran/debian_intel.html was of help to me in writing this. NOTE:The URL was moved

    *

      In case of the Intel C++ compiler, you need to visit the C++ compiler's EULA page, accept the terms of the license, and provide your name and email on the next page. A confirmation email, with the attached license key should arrive in your mailbox "within 1 business day", or so they say.
    *

      While you're waiting for the license key, you can start downloading the actual compiler on the download page.
    *

      Once you download it, extract the tarball (tar zxf filename), and enter the newly created directory. If you're doing this on a (still) standard 32-bit PC, it's safe to just delete all files with '64' in their name (rm -rf *64*), as their won't be of use to you. (or the other way around, delete *32* if you have a 64bit machine). Then, use the alien (apt-get install alien) program to convert remaining .rpm files to .deb; here's a "session transcript":

        # tar zxf l_cc_p_8.0.055.tar.gz
        # cd l_cc_p_8.0.055
        # rm -rf *64*
        # alien *.rpm
        # rm *.rpm
               

    *

      So far so good. Now, we need to modify the postinst script of *only* the main .deb package (intel-icc8_8.0-45_i386.deb in this case), and rebuild the .deb. Let's first extract the .deb to a temporary location (tmp/) and add 1 line to the postinst script:

        # mkdir tmp
        # dpkg-deb -e intel-icc8_8.0-45_i386.deb tmp/DEBIAN
        # dpkg-deb -x intel-icc8_8.0-45_i386.deb tmp/
        # echo DESTINATION=/opt/`ls tmp/opt/`/ >> tmp/DEBIAN/postinst
               

    *

      Fine. 99% through the mess. Now open the original install.sh script (should be in your current directory), and search for string "for FILE" in it. You should see few "for FILE" blocks listed one by one in a row (all basically performing various substitutions on files in the DESTINATION directory, if you understand a little shell or sed syntax). Those few blocks are the ones you need to copy, and paste at the end of tmp/DEBIAN/postinst. To minimize the chance of confusion, here's the block you need to paste for both 8.* and 7.* versions:

      8.*:

    for FILE in $(find $DESTINATION/bin/ -regex '.*[ei](cc|fort|fc|cpc)$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' 2> /dev/null) ; do
        sed s@\@$DESTINATION@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done

    for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cc' 2> /dev/null) ; do
        sed s@\@$DESTINATION@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done

    for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]cpc' 2> /dev/null) ; do
        sed s@\@$DESTINATION@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done

    for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fort' 2> /dev/null) ; do
        sed s@\@$DESTINATION@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done

    for FILE in $(find $DESTINATION/bin/ -regex '.*[ei]fc' 2> /dev/null) ; do
        sed s@\@$DESTINATION@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done
               

      7.*:

    for FILE in $(find $DESTINATION/compiler70/ia??/bin/ -regex \
           '.*[ei][cf]p?c$\|.*cfg$\|.*pcl$\|.*vars[^/]*.c?sh$' \
           2> /dev/null) ; do
        sed -e s@\@$DESTINATION@g -e s@man\ \
           -w@manpath@g $FILE > ${FILE}.abs
        mv ${FILE}.abs $FILE
        chmod 755 $FILE
    done
               

      But don't directly copy this, do open your install.sh script and find this piece yourself since it could change at any time.
    *

      Now just rebuild the .deb and install it (first this "main" deb, then the rest of them):

                # dpkg-deb -b tmp intel-icc8_8.0-45_i386.deb
                # dpkg -i intel-icc8_8.0-45_i386.deb
                # dpkg -i intel-iidb7_7.3.1-86_i386.deb
                # dpkg -i --force-overwrite intel-isubh8_8.0-45_i386.deb
               

    *

      And copy the license file you received in your email to the appropriate place:

                # cp /where-ever/it/is/l_cpp_XXXXXXXX.lic /opt/intel_cc_80/licenses/
               

    *

      To setup your environment, run on the command line or put in startup scripts (like ~/.bash_profile):

                source `find /opt/intel_* -name 'i*vars.sh'`
               

And that's it. See if playing with /opt/intel_cc_80/bin/icc is any fun given the unusual trouble to set it up in the first place.

--------------------------------------------------------------------------------------------------------------------------
mkl7.2 我先运行它的脚本 会在临时目录生成一个RPM包  把它专程deb 安装就ok了
回复 支持 反对

使用道具 举报

发表于 2005-12-23 14:31:28 | 显示全部楼层
不过我今天重装 系统升级成了hiweed 0.7  
ifc 升级成了 9.0 mkl升级成了 8.0

原来的方法好像有点问题
安装ifc用的这个方法

Debian packages and Intel Compilers

Intel distributes their Linux compilers (Fortran and C/C++) using the RPM format for use on Redhat and Suse systems. However, their compilers work fine with Debian (assuming the correct libraries are installed).

The alien program can convert rpms to deb format, and is trivial to use. This is all you need to install the compilers on Debian, but then you need to make some post-installation modifications that the Intel installation script does. We can modify the deb packages to make these post-installation modifications for us. By doing so it's even easier to use than the original rpms with Intel's install scripts.

Below are the steps. This works for the ifc/ifort, icc and iidb packages. I haven't tried the icc-ide package yet, as I don't use an IDE. Note that alien will increment the version number of a package unless you give it the -k argument.

Version 7.1 compilers

Download the make_deb_7 script.

1. Convert the rpm package to deb format.

alien -k intel-ifc7-7.1-41.i386.rpm

2. Run the script.

./make_deb_7 intel-ifc7_7.1-41_i386.deb

3. Install the package.

dpkg -i intel-ifc7_7.1-41_i386.deb

Version 8.x compilers

Download the make_deb_8 script.

1. Convert the rpm package to deb format.

alien -k intel-ifort8-8.1-019.i386.rpm

2. Run the script.

./make_deb_8 intel-ifort8_8.1-019_i386.deb

3. Install the package.

dpkg -i intel-ifort8_8.1-019_i386.deb

Version 9.x compilers

Download the make_deb_9 script, and do the same as above.
Compiling C++ programs with 8.1

icpc should be used for compiling C++ programs instead of icc.

CXX = icpc
CXXFLAGS = -cxxlib-icc

If you get strange errors and have G++ 3.3.4 installed, try "ln -s /usr/include/c++/3.3 /usr/include/c++/3.3.4". If this works, the problem is a bug in the Intel compiler; it should ask G++ where it is located rather than assume something.
Notes

    * Make sure you "source" the iccvars.csh, ifortvars.csh and/or idbvars.csh files in tcsh before trying to use the compilers or other utilities. There are bash versions too. They are all in the bin directories.

    * If you want to submit bug reports to Intel, you might need the package id (I usually just give them the build number). The package id is normally shown by invoking the compiler with the -V flag. The package id is just stored in a file, and the scripts above don't fix this yet, and instead the -V flag prints out "installpackageid". The package id is something like l_fc_pc_8.1.024 or l_cc_8.1.028. If you really want, you can put it in the file yourself. Look for the file "csupport" or "fsupport" or "idbsupport" in the appropriate Intel doc directory.

    * If you get a filename conflict for uninstall.sh when installing packages, just add --force-overwrite to the dpkg command line.

Author

Daniel Grimwood
reaper@theochem.uwa.edu.au

Comments appreciated.
-------------------------------------------
似乎挺好
刚才也发现apt源里面有ifort8 ifort9了 呵呵

但是我用老办法装mkl8似乎有些问题 运行的时候总是提示
undefined symbol: _intel_fast_memset

不知道那位有解决的办法?:ask
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表