Skip to content
Snippets Groups Projects
Commit 47f5cb17 authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

get back to previous dlopen flags after importing libs that need the hack;...

get back to previous dlopen flags after importing libs that need the hack; don't trigger the hack on non-linux systems
parent db878498
Branches
No related tags found
No related merge requests found
......@@ -17,18 +17,24 @@ __doc__ = """The actual chunker implementation."""
# SWIG bug workaround: loading multiple SWIG modules brought unwrapped
# swig::stop_iteration exceptions
import ctypes, sys
if 'setdlopenflags' in sys.__dict__:
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
import platform
if 'Linux' in platform.system():
# this prevents from problems with multiple SWIG wrappers
# (probably bug in SWIG) and possible problems with locating Maca plugin
dlflags = sys.getdlopenflags()
sys.setdlopenflags(dlflags | ctypes.RTLD_GLOBAL)
import corpus2
# TODO: get back to default dlopen policy?
import corpio, config, classify
if 'Linux' in platform.system():
# get back to default dlopen policy
sys.setdlopenflags(dlflags)
import os, codecs
import ConfigParser
from operator import itemgetter as ig
import corpio, config, classify
def get_layers(conf):
layers = [(k, v.split(',')) for (k, v) in conf.items(config.S_LAYERS)]
for layer in layers:
......
......@@ -15,12 +15,20 @@
# SWIG bug workaround: loading multiple SWIG modules brought unwrapped
# swig::stop_iteration exceptions
import ctypes, sys
if 'setdlopenflags' in sys.__dict__:
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
import platform
if 'Linux' in platform.system():
# this prevents from problems with multiple SWIG wrappers
# (probably bug in SWIG) and possible problems with locating Maca plugin
dlflags = sys.getdlopenflags()
sys.setdlopenflags(dlflags | ctypes.RTLD_GLOBAL)
import corpus2, wccl
# TODO: get back to default dlopen policy?
if 'Linux' in platform.system():
# get back to default dlopen policy
sys.setdlopenflags(dlflags)
import config
import codecs, os
......
......@@ -4,7 +4,7 @@
from setuptools import setup
setup(name='iobber',
version='1.0.0',
version='1.0.1',
description='Chunker for Slavic languages based on CRF++ and WCCL',
author= "Adam Radziszewski",
author_email="adam.radziszewski@pwr.wroc.pl",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment