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

Robert Kern robert.kern@gmail....
Sat Jun 14 17:31:15 CDT 2008


On Sat, Jun 14, 2008 at 09:44, Ulrik Günther
<ulrik@42degreesoffreedom.com> wrote:
> -----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.).

It needs to be solved elsewhere. Why does modifying
.../fcompiler/gnu.py affect compiling C modules with Intel C
compilers?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Scipy-dev mailing list