[SciPy-dev] {Num, Sci}Py on 64bit Intel Macs with icc, ifort, mkl

Ulrik Günther ulrik@42degreesoffreedom....
Sat Jun 14 09:44:22 CDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

I have a little patch here for numpy/distutils/fcompiler/gnu.py, which  
seems to relieve the dynamic_lookup problem
when linking a .so :

@@ -100,8 +100,8 @@
                      'MACOSX_DEPLOYMENT_TARGET reset to %s.%s' %  
(major, minor))
              os.environ['MACOSX_DEPLOYMENT_TARGET'] = '%s.%s' % (major,
                  minor)
- -
- -            opt.extend(['-undefined', 'dynamic_lookup', '-bundle'])
+
+            self.linker_so.extend(['-undefined', 'dynamic_lookup', '- 
bundle'])
          else:
              opt.append("-shared")
          if sys.platform.startswith('sunos'):
@@ -189,6 +189,9 @@
                      opt.append('-mcpu='+a)
                      opt.append('-mtune='+a)
                      break
+
+            opt.append('-framework Python')
+            opt.append('-undefined dynamic_lookup')
              return opt

          # default march options in case we find nothing better
@@ -374,9 +377,12 @@
  if __name__ == '__main__':
      from distutils import log
      log.set_verbosity(2)
- -    compiler = GnuFCompiler()
- -    compiler.customize()
- -    print compiler.get_version()
+    try:
+        compiler = GnuFCompiler()
+        compiler.customize()
+        print compiler.get_version()
+    except Exception, msg:
+        print msg
      raw_input('Press ENTER to continue...')
      try:
          compiler = Gnu95FCompiler()

My problem with this solution is the following:

in the function get_flags_linker_so(), there is a line of code in the  
beginning:

 >> opt = self.linker_so[1:]

where the opt array is modified in the following, then returned. What  
I noticed is that
whatever is put into that array is not passed on. So my solution here  
is to directly modify the
self.linker_so array with the corresponding options. I do not think  
that this is a clean solution,
but it works for the moment. I'd be glad if you could comment a bit on  
the patch (if it is okay, if
the problem should be solved elsewhere, etc.).

Thanks,

ulrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFIU9lGy06DkvPH780RAivhAJ0eVOhOWDhy38YzJCOo3lQeJVEQiACeJGFj
sJpSQ+3cnaBeteeA0eOTGK0=
=xhkn
-----END PGP SIGNATURE-----


More information about the Scipy-dev mailing list