Hi,

I've been carrying these modifcations of the build-in compiler
command line arguments for the 32-bit Intel compilers for quite 
some while now; maybe they are interesting for other people as 
well... I've been using this with ifort (IFORT) 10.1 20080801 
on a Suse Linux 10.3.

Rationale for individual changes:

 - numpy-1.3.0rc1/numpy/distutils/fcompiler/intel.py:

   - For pentiumM's, options are changed from '-tpp7 -xB' to '-xN': 
        The compiler documentation says that -tpp<?> and -xB are 
        deprecated and will be removed in future versions.
   - 'linker_so' gets an additional "-xN": If code is compiled 
        with -x<?>, additional "vector math" libraries (libvml*) need
        to be linked in, or loading the shared objects may fail at
        runtime; so I added this to the link command. If other '-x<?>'
        options are used by the numpy distutils, the linker command 
        should be modified accordingly - so this patch probably is 
        not generic.


 - numpy-1.3.0rc1/numpy/distutils/intelccompiler.py:

   - A dedicated C++ compiler (icpc) is introduced and used for 
     compiling C++ code, *and* for linking: I have found that C++
     extensions require additional runtime libraries that are not 
     linked in with the normal icc command, causing the loading 
     of C++ extensions to fail at runtime. This used to be a problem
     with scipy in earlier versions, but I think currently, there's
     no C++ any more in scipy (but I could be wrong).

Hope this is useful,

  Christian.

diff -r -C3 -N numpy-1.3.0rc1.orig/numpy/distutils/fcompiler/intel.py numpy-1.3.0rc1/numpy/distutils/fcompiler/intel.py
*** numpy-1.3.0rc1.orig/numpy/distutils/fcompiler/intel.py	2009-03-24 06:54:52.000000000 +0100
--- numpy-1.3.0rc1/numpy/distutils/fcompiler/intel.py	2009-03-29 12:05:32.000000000 +0200
***************
*** 37,43 ****
          'compiler_f77' : [None, "-72", "-w90", "-w95"],
          'compiler_f90' : [None],
          'compiler_fix' : [None, "-FI"],
!         'linker_so'    : ["<F90>", "-shared"],
          'archiver'     : ["ar", "-cr"],
          'ranlib'       : ["ranlib"]
          }
--- 37,43 ----
          'compiler_f77' : [None, "-72", "-w90", "-w95"],
          'compiler_f90' : [None],
          'compiler_fix' : [None, "-FI"],
!         'linker_so'    : ["<F90>", "-shared", "-xN"],
          'archiver'     : ["ar", "-cr"],
          'ranlib'       : ["ranlib"]
          }
***************
*** 72,78 ****
          if cpu.is_PentiumPro() or cpu.is_PentiumII() or cpu.is_PentiumIII():
              opt.extend(['-tpp6'])
          elif cpu.is_PentiumM():
!             opt.extend(['-tpp7','-xB'])
          elif cpu.is_Pentium():
              opt.append('-tpp5')
          elif cpu.is_PentiumIV() or cpu.is_Xeon():
--- 72,78 ----
          if cpu.is_PentiumPro() or cpu.is_PentiumII() or cpu.is_PentiumIII():
              opt.extend(['-tpp6'])
          elif cpu.is_PentiumM():
!             opt.extend(['-xN'])
          elif cpu.is_Pentium():
              opt.append('-tpp5')
          elif cpu.is_PentiumIV() or cpu.is_Xeon():
***************
*** 90,96 ****
                  if cpu.has_sse2():
                      opt.append('-xN')
              elif cpu.is_PentiumM():
!                 opt.extend(['-xB'])
              if (cpu.is_Xeon() or cpu.is_Core2() or cpu.is_Core2Extreme()) and cpu.getNCPUs()==2:
                  opt.extend(['-xT'])
              if cpu.has_sse3() and (cpu.is_PentiumIV() or cpu.is_CoreDuo() or cpu.is_CoreSolo()):
--- 90,96 ----
                  if cpu.has_sse2():
                      opt.append('-xN')
              elif cpu.is_PentiumM():
!                 opt.extend(['-xN'])
              if (cpu.is_Xeon() or cpu.is_Core2() or cpu.is_Core2Extreme()) and cpu.getNCPUs()==2:
                  opt.extend(['-xT'])
              if cpu.has_sse3() and (cpu.is_PentiumIV() or cpu.is_CoreDuo() or cpu.is_CoreSolo()):
diff -r -C3 -N numpy-1.3.0rc1.orig/numpy/distutils/intelccompiler.py numpy-1.3.0rc1/numpy/distutils/intelccompiler.py
*** numpy-1.3.0rc1.orig/numpy/distutils/intelccompiler.py	2009-03-24 06:54:54.000000000 +0100
--- numpy-1.3.0rc1/numpy/distutils/intelccompiler.py	2009-03-29 12:05:32.000000000 +0200
***************
*** 8,23 ****
      """
  
      compiler_type = 'intel'
!     cc_exe = 'icc'
  
      def __init__ (self, verbose=0, dry_run=0, force=0):
          UnixCCompiler.__init__ (self, verbose,dry_run, force)
!         compiler = self.cc_exe
          self.set_executables(compiler=compiler,
                               compiler_so=compiler,
!                              compiler_cxx=compiler,
                               linker_exe=compiler,
!                              linker_so=compiler + ' -shared')
  
  class IntelItaniumCCompiler(IntelCCompiler):
      compiler_type = 'intele'
--- 8,25 ----
      """
  
      compiler_type = 'intel'
!     cc_exe  = 'icc'
!     cxx_exe = 'icpc'
  
      def __init__ (self, verbose=0, dry_run=0, force=0):
          UnixCCompiler.__init__ (self, verbose,dry_run, force)
!         compiler     = self.cc_exe
!         compiler_cxx = self.cxx_exe
          self.set_executables(compiler=compiler,
                               compiler_so=compiler,
!                              compiler_cxx=compiler_cxx,
                               linker_exe=compiler,
!                              linker_so=compiler_cxx + ' -shared')
  
  class IntelItaniumCCompiler(IntelCCompiler):
      compiler_type = 'intele'
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to