Ticket #42438: patch-setup.py.diff

File patch-setup.py.diff, 1.4 KB (added by petrrr, 11 years ago)

files/patch-setup.py.diff -- a NEW patch to the NEW setup.py

  • setup.

    old new  
    434434    libname = _get_lib_name("tau")
    435435    files = glob.glob(os.path.join(path, "*.f"))
    436436    # compiler specific options
    437     kwargs = {'libraries': []}
     437    # 2014-02-10, petr -- modification needed below
     438    kwargs = {}
     439    kwargs.update({'libraries': []})
     440    kwargs.update({'extra_link_args': []})
    438441    # XXX: The build subdirectory is difficult to determine if installed
    439442    # via pypi or other means. I could not find a reliable way of doing it.
    440443    new_interface_path = os.path.join("build", libname + os.extsep + "pyf")
     
    452455    # gfortran the option -lgcov is required
    453456    if os.environ.get('OBSPY_C_COVERAGE', ""):
    454457        kwargs['libraries'].append('gcov')
     458
     459    # 2014-02-10, petr -- workaround for unexpected numpy.distutils behaviour
     460    #   This hot fix is needed for Macports. Macports sets `LDFLAGS` via
     461    #   `Python Portgroup` to control build architecture setings.
     462    #   For Fortran extentions this causes the default link arguments to be
     463    #   canceled, which does not correspond to C bevavior. The fix below adds
     464    #   these arguments manually.
     465    #
     466    #   Should probably be adressed in numpy.distutils.
     467    #
     468    if platform.system() == 'Darwin':
     469        kwargs['extra_link_args'].append('-bundle')
     470        kwargs['extra_link_args'].append('-undefined dynamic_lookup')
     471
    455472    config.add_extension(libname, files, **kwargs)
    456473
    457474    add_data_files(config)