mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-28 07:51:42 +00:00
update binding
This commit is contained in:
parent
f9a6db3287
commit
d7c8e51e1d
@ -99,14 +99,7 @@ static PyObject *judger_run(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
}
|
||||
}
|
||||
|
||||
void *handler = dlopen("/usr/lib/judger/libjudger.so", RTLD_LAZY);
|
||||
void (*judger_run)(struct config *, struct result *);
|
||||
|
||||
if (!handler) {
|
||||
RaiseValueError("dlopen error")
|
||||
}
|
||||
judger_run = dlsym(handler, "run");
|
||||
judger_run(&_config, &_result);
|
||||
run(&_config, &_result);
|
||||
|
||||
return Py_BuildValue("{s:i, s:l, s:i, s:i, s:i, s:i, s:i}",
|
||||
"cpu_time", _result.cpu_time,
|
||||
|
@ -4,4 +4,6 @@ from distutils.core import setup, Extension
|
||||
|
||||
setup(name='_judger',
|
||||
version='2.1',
|
||||
ext_modules=[Extension('_judger', sources=['_judger.c'], libraries=["dl"])])
|
||||
ext_modules=[Extension('_judger',
|
||||
sources=['_judger.c'],
|
||||
extra_link_args=["-L", "/usr/lib/judger", "-l", "judger", "-Wl,-rpath=/usr/lib/judger"])])
|
||||
|
Loading…
Reference in New Issue
Block a user