Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during compilation #56

Closed
Rabia-Noureen opened this issue Jul 24, 2017 · 1 comment
Closed

Error during compilation #56

Rabia-Noureen opened this issue Jul 24, 2017 · 1 comment

Comments

@Rabia-Noureen
Copy link

Sir thank you for providing us such a great NER tagger. I was trying to run the tagger in Anaconda Prompt and cmd but i got the following error on Windows 7 32 bit
00878 {
00879 // save references to outputs prior to updating storage contai
ners
00880 assert (self->n_output_vars >= self->n_updates);
00881 Py_DECREF(rval);
00882 rval = PyList_New(self->n_output_vars);
00883 for (int i = 0; i < (self->n_output_vars); ++i)
00884 {
00885 Py_ssize_t src = self->output_vars[i];
00886 PyObject * item = PyList_GetItem(self->var_value_cells[src
], 0);
00887 if ((output_subset == NULL || output_subset[i]) &&
00888 self->var_computed[src] != 1)
00889 {
00890 err = 1;
00891 PyErr_Format(PyExc_AssertionError,
00892 "The compute map of output %d should cont
ain "
00893 "1 at the end of execution, not %d.",
00894 i, self->var_computed[src]);
00895 break;
00896 }
00897 Py_INCREF(item);
00898 PyList_SetItem(rval, i, item);
00899 }
00900 }
00901
00902 if (!err)
00903 {
00904 // Update the inputs that have an update rule
00905 for (int i = 0; i < self->n_updates; ++i)
00906 {
00907 PyObject* tmp = PyList_GetItem(rval, self->n_output_vars -
self->n_updates + i);
00908 Py_INCREF(tmp);
00909 Py_ssize_t dst = self->update_storage[i];
00910 PyList_SetItem(self->var_value_cells[dst], 0, tmp);
00911 }
00912 }
00913 }
00914
00915 /*
00916 Clear everything that is left and not an output. This is needed
00917 for lazy evaluation since the current GC algo is too conservative
00918 with lazy graphs.
00919 /
00920 if (self->allow_gc && !err)
00921 {
00922 for (Py_ssize_t i = 0; i < self->n_vars; ++i)
00923 {
00924 int do_cleanup = 1;
00925 if (!self->var_has_owner[i] || !self->var_computed[i])
00926 continue;
00927 for (int j = 0; j < self->n_output_vars; ++j)
00928 {
00929 if (i == self->output_vars[j])
00930 {
00931 do_cleanup = 0;
00932 break;
00933 }
00934 }
00935 if (!do_cleanup)
00936 continue;
00937 Py_INCREF(Py_None);
00938 PyList_SetItem(self->var_value_cells[i], 0, Py_None);
00939 }
00940 }
00941 if (output_subset != NULL)
00942 free(output_subset);
00943
00944 Py_DECREF(one);
00945 Py_DECREF(zero);
00946 if (err)
00947 {
00948 Py_DECREF(rval);
00949 return NULL;
00950 }
00951 return rval;
00952 }
00953
00954 #if 0
00955 static PyMethodDef CLazyLinker_methods[] = {
00956 {
00957 //"name", (PyCFunction)CLazyLinker_accept, METH_VARARGS, "Return t
he name, combining the first and last name"
00958 },
00959 {NULL} /
Sentinel /
00960 };
00961 #endif
00962
00963
00964 static PyObject *
00965 CLazyLinker_get_allow_gc(CLazyLinker self, void closure)
00966 {
00967 return PyBool_FromLong(self->allow_gc);
00968 }
00969
00970 static int
00971 CLazyLinker_set_allow_gc(CLazyLinker self, PyObject value, void closu
re)
00972 {
00973 if(!PyBool_Check(value))
00974 return -1;
00975
00976 if (value == Py_True)
00977 self->allow_gc = true;
00978 else
00979 self->allow_gc = false;
00980 return 0;
00981 }
00982
00983 static PyGetSetDef CLazyLinker_getset[] = {
00984 {(char
)"allow_gc",
00985 (getter)CLazyLinker_get_allow_gc,
00986 (setter)CLazyLinker_set_allow_gc,
00987 (char
)"do this function support allow_gc",
00988 NULL},
00989 {NULL, NULL, NULL, NULL} /
Sentinel /
00990 };
00991 static PyMemberDef CLazyLinker_members[] = {
00992 {(char
)"nodes", T_OBJECT_EX, offsetof(CLazyLinker, nodes), 0,
00993 (char
)"list of nodes"},
00994 {(char
)"thunks", T_OBJECT_EX, offsetof(CLazyLinker, thunks), 0,
00995 (char
)"list of thunks in program"},
00996 {(char*)"call_counts", T_OBJECT_EX, offsetof(CLazyLinker, call_count
s), 0,
00997 (char*)"number of calls of each thunk"},
00998 {(char*)"call_times", T_OBJECT_EX, offsetof(CLazyLinker, call_times)
, 0,
00999 (char*)"total runtime in each thunk"},
01000 {(char*)"position_of_error", T_INT, offsetof(CLazyLinker, position_o
f_error), 0,
01001 (char*)"position of failed thunk"},
01002 {(char*)"time_thunks", T_INT, offsetof(CLazyLinker, do_timing), 0,
01003 (char*)"bool: nonzero means call will time thunks"},
01004 {(char*)"need_update_inputs", T_INT, offsetof(CLazyLinker, need_upda
te_inputs), 0,
01005 (char*)"bool: nonzero means Function.call must implement update
mechanism"},
01006 {NULL} /* Sentinel */
01007 };
01008
01009 static PyTypeObject lazylinker_ext_CLazyLinkerType = {
01010 #if defined(NPY_PY3K)
01011 PyVarObject_HEAD_INIT(NULL, 0)
01012 #else
01013 PyObject_HEAD_INIT(NULL)
01014 0, /ob_size/
01015 #endif
01016 "lazylinker_ext.CLazyLinker", /tp_name/
01017 sizeof(CLazyLinker), /tp_basicsize/
01018 0, /tp_itemsize/
01019 CLazyLinker_dealloc, /tp_dealloc/
01020 0, /tp_print/
01021 0, /tp_getattr/
01022 0, /tp_setattr/
01023 0, /tp_compare/
01024 0, /tp_repr/
01025 0, /tp_as_number/
01026 0, /tp_as_sequence/
01027 0, /tp_as_mapping/
01028 0, /*tp_hash /
01029 CLazyLinker_call, /tp_call/
01030 0, /tp_str/
01031 0, /tp_getattro/
01032 0, /tp_setattro/
01033 0, /tp_as_buffer/
01034 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /tp_flags/
01035 "CLazyLinker object", /
tp_doc /
01036 0, /
tp_traverse /
01037 0, /
tp_clear /
01038 0, /
tp_richcompare /
01039 0, /
tp_weaklistoffset /
01040 0, /
tp_iter /
01041 0, /
tp_iternext /
01042 0,//CLazyLinker_methods, /
tp_methods /
01043 CLazyLinker_members, /
tp_members /
01044 CLazyLinker_getset, /
tp_getset /
01045 0, /
tp_base /
01046 0, /
tp_dict /
01047 0, /
tp_descr_get /
01048 0, /
tp_descr_set /
01049 0, /
tp_dictoffset /
01050 (initproc)CLazyLinker_init,/
tp_init /
01051 0, /
tp_alloc /
01052 CLazyLinker_new, /
tp_new */
01053 };
01054
01055 static PyObject * get_version(PyObject *dummy, PyObject *args)
01056 {
01057 PyObject *result = PyFloat_FromDouble(0.211);
01058 return result;
01059 }
01060
01061 static PyMethodDef lazylinker_ext_methods[] = {
01062 {"get_version", get_version, METH_VARARGS, "Get extension version."},

01063 {NULL, NULL, 0, NULL} /* Sentinel /
01064 };
01065
01066 #if defined(NPY_PY3K)
01067 static struct PyModuleDef moduledef = {
01068 PyModuleDef_HEAD_INIT,
01069 "lazylinker_ext",
01070 NULL,
01071 -1,
01072 lazylinker_ext_methods,
01073 NULL,
01074 NULL,
01075 NULL,
01076 NULL
01077 };
01078 #endif
01079 #if defined(NPY_PY3K)
01080 #define RETVAL m
01081 PyMODINIT_FUNC
01082 PyInit_lazylinker_ext(void) {
01083 #else
01084 #define RETVAL
01085 PyMODINIT_FUNC
01086 initlazylinker_ext(void)
01087 {
01088 #endif
01089 PyObject
m;
01090
01091 lazylinker_ext_CLazyLinkerType.tp_new = PyType_GenericNew;
01092 if (PyType_Ready(&lazylinker_ext_CLazyLinkerType) < 0)
01093 return RETVAL;
01094 #if defined(NPY_PY3K)
01095 m = PyModule_Create(&moduledef);
01096 #else
01097 m = Py_InitModule3("lazylinker_ext", lazylinker_ext_methods,
01098 "Example module that creates an extension type.")
;
01099 #endif
01100 Py_INCREF(&lazylinker_ext_CLazyLinkerType);
01101 PyModule_AddObject(m, "CLazyLinker", (PyObject *)&lazylinker_ext_CLa
zyLinkerType);
01102
01103 return RETVAL;
01104 }
01105

Problem occurred during compilation with the command line below:
"C:\MinGW\bin\g++.exe" -shared -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m
32 -I"C:\ProgramData\Anaconda2\lib\site-packages\numpy\core\include" -I"C:\Progr
amData\Anaconda2\include" -I"C:\ProgramData\Anaconda2\lib\site-packages\theano\g
of" -L"C:\ProgramData\Anaconda2\libs" -L"C:\ProgramData\Anaconda2" -o C:\Users\R
abia Noureen\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86_Family_6
Model_42_Stepping_7_GenuineIntel-2.7.13-32\lazylinker_ext\lazylinker_ext.pyd C:
\Users\Rabia Noureen\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86

Family_6_Model_42_Stepping_7_GenuineIntel-2.7.13-32\lazylinker_ext\mod.cpp -lpyt
hon27
g++.exe: error: Noureen\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x
86_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.13-32\lazylinker_ext\lazylinker
_ext.pyd: No such file or directory
g++.exe: error: C:\Users\Rabia: No such file or directory
g++.exe: error: Noureen\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x
86_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.13-32\lazylinker_ext\mod.cpp: N
o such file or directory

Traceback (most recent call last):
File "./tagger.py", line 8, in
from loader import prepare_sentence
File "C:\ProgramData\Anaconda2\tagger-master\tagger-master\loader.py", line 4,
in
from utils import create_dico, create_mapping, zero_digits
File "C:\ProgramData\Anaconda2\tagger-master\tagger-master\utils.py", line 5,
in
import theano
File "C:\ProgramData\Anaconda2\lib\site-packages\theano_init_.py", line 66,
in
from theano.compile import (
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\compile_init_.py",
line 10, in
from theano.compile.function_module import *
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\compile\function_modul
e.py", line 21, in
import theano.compile.mode
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\compile\mode.py", line
10, in
import theano.gof.vm
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\gof\vm.py", line 662,
in
from . import lazylinker_c
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\gof\lazylinker_c.py",
line 127, in
preargs=args)
File "C:\ProgramData\Anaconda2\lib\site-packages\theano\gof\cmodule.py", line
2316, in compile_str
(status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): g++.exe: error: Noureen\AppData
\Local\Theano\compiledir_Windows-7-6.1.7601-SP1-x86_Family_6_Model_42_Stepping_7
_GenuineIntel-2.7.13-32\lazylinker_ext\lazylinker_ext.pyd: No such file or direc
. g++.exe: error: Noureen\AppData\Local\Theano\compiledir_Windows-7-6.1.7601-SP1
-x86_Family_6_Model_42_Stepping_7_GenuineIntel-2.7.13-32\lazylinker_ext\mod.cpp:
. o such file or directory

Kindly respond asap as it am stuck in this issue.

@janwendt
Copy link

@Rabia-Noureen i have the same problem how did you fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants