[SciPy-dev] segmentation with scipy+icc during test

Stijn De Weirdt stijn.deweirdt@ugent...
Fri Dec 5 15:58:50 CST 2008


> > no. i modified the numpy distutils a little bit so it would accept the
> > -Bstatic and -Bdynamic switches, for everything else i used standard
> > numpy buld procedure (i also change intelccompiler.py a bit so numpy
> > would use icpc as cxx compiler)
> 
> I think a lot of people would love to what you did ;)
> 
i paste my site.cfg and a patch here (i have no idea if the mailing list
accepts attachments ;)
keep in mind that -Bstatic and -Bdynamic are toggles and this has been
tested with ictce 3.2.0.017

(warning: ugly ;)

stijn


site.cfg (mkl related stuff, you get the idea)
-----------------------------------------------
[fftw]
libraries = -Bstatic,fftw3xc_intel,fftw3xf_intel,-Bdynamic
[mkl]
lapack_libs = -Bstatic,mkl_lapack,-Bdynamic
#mkl_libs = -Bstatic,mkl_intel_lp64, mkl_intel_thread,
mkl_core,-Bdynamic,iomp5, guide

mkl_libs = -Bstatic,mkl_em64t,-Bdynamic,iomp5, guide

-----------------------------------------------

patch for numpy, against 1.2.1

-----------------------------------------------
diff -ur --exclude='*pyc' --exclude='*~'
numpy-1.2.1.orig/numpy/distutils/fcompiler/intel.py
numpy-1.2.1/numpy/distutils/fcompiler/intel.py
--- numpy-1.2.1.orig/numpy/distutils/fcompiler/intel.py	2008-10-28
12:21:48.000000000 +0100
+++ numpy-1.2.1/numpy/distutils/fcompiler/intel.py	2008-12-04
22:40:19.000000000 +0100
@@ -152,9 +152,9 @@
 
     executables = {
         'version_cmd'  : None,
-        'compiler_f77' : [None, "-FI", "-w90", "-w95"],
-        'compiler_fix' : [None, "-FI"],
-        'compiler_f90' : [None],
+        'compiler_f77' : [None, "-FI", "-w90", "-w95","-v"],
+        'compiler_fix' : [None, "-FI","-v"],
+        'compiler_f90' : [None,"-v"],
         'linker_so'    : ['<F90>', "-shared"],
         'archiver'     : ["ar", "-cr"],
         'ranlib'       : ["ranlib"]
@@ -166,6 +166,13 @@
             opt.extend(['-tpp7', '-xW'])
         return opt
 
+    def library_option(self, lib):
+        if lib[0]=='-':
+            return lib
+        else:
+            return "-l" + lib
+        
+
 # Is there no difference in the version string between the above
compilers
 # and the Visual compilers?
 
diff -ur --exclude='*pyc' --exclude='*~'
numpy-1.2.1.orig/numpy/distutils/intelccompiler.py
numpy-1.2.1/numpy/distutils/intelccompiler.py
--- numpy-1.2.1.orig/numpy/distutils/intelccompiler.py	2008-10-28
12:21:49.000000000 +0100
+++ numpy-1.2.1/numpy/distutils/intelccompiler.py	2008-12-04
23:28:08.000000000 +0100
@@ -8,16 +8,30 @@
     """
 
     compiler_type = 'intel'
-    cc_exe = 'icc'
+    cc_exe = 'icc -v'
+    cxx_exe = 'icpc -v'
 
     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')
+        compiler_cxx = self.cxx_exe
+
+        opt=' -fPIC -O3 -unroll'
+        linkopt=' -shared -static-intel '
+
+        self.set_executables(compiler=compiler+opt,
+                             compiler_so=compiler+opt,
+                             compiler_cxx=compiler_cxx+opt,
+                             linker_exe=compiler+opt,
+                             linker_so=compiler+linkopt)
+
+    def library_option(self, lib):
+        if lib[0]=='-':
+            return lib
+        else:
+            return "-l" + lib
+
+                
 
 class IntelItaniumCCompiler(IntelCCompiler):
     compiler_type = 'intele'
diff -ur --exclude='*pyc' --exclude='*~'
numpy-1.2.1.orig/numpy/distutils/system_info.py
numpy-1.2.1/numpy/distutils/system_info.py
--- numpy-1.2.1.orig/numpy/distutils/system_info.py	2008-10-28
12:21:49.000000000 +0100
+++ numpy-1.2.1/numpy/distutils/system_info.py	2008-12-04
01:18:43.000000000 +0100
@@ -559,6 +559,9 @@
             lib_prefixes = ['lib']
         # for each library name, see if we can find a file for it.
         for l in libs:
+            if l[0]=='-':
+                liblist.append(l)
+                continue
             for ext in exts:
                 for prefix in lib_prefixes:
                     p = self.combine_paths(lib_dir, prefix+l+ext)
-----------------------------------------------------------------------



More information about the Scipy-dev mailing list