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

Install gensim fails because C code is not ANSI-compliant #3377

Closed
hstk30 opened this issue Aug 10, 2022 · 1 comment · Fixed by #3378
Closed

Install gensim fails because C code is not ANSI-compliant #3377

hstk30 opened this issue Aug 10, 2022 · 1 comment · Fixed by #3378

Comments

@hstk30
Copy link
Contributor

hstk30 commented Aug 10, 2022

Problem description

Can't use pip install gensim to install the latest gensim

Steps/code/corpus to reproduce

building 'gensim.similarities.fastss' extension
    creating build/temp.linux-x86_64-3.6/gensim/similarities
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switch$s -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/nas/home/hstk/gitProject/venv/centaur/include -I/usr/include/python3.6m -I/nas/home/hstk/gitProject/venv/centaur/lib64/pyth$n3.6/site-packages/numpy/core/include -c gensim/similarities/fastss.c -o build/temp.linux-x86_64-3.6/gensim/similarities/fastss.o
    gensim/similarities/fastss.c: 在函数‘ceditdist’中:
    gensim/similarities/fastss.c:725:9: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
             for (WIDTH tmpi = 0; tmpi <= len_s1; tmpi++) row2[tmpi] = tmpi;
             ^
    gensim/similarities/fastss.c:725:9: 附注:使用 -std=c99 或 -std=gnu99 来编译您的代码
    gensim/similarities/fastss.c:727:9: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
             for (WIDTH i2 = 0; i2 < len_s2; i2++) {
             ^
    gensim/similarities/fastss.c:738:13: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
                 for (WIDTH i1 = 0; i1 < len_s1; i1++) {
                 ^
    error: command 'gcc' failed with exit status 1

Sorry, the error info have Chinese, but I think It's easy to figure out the error.

Now, I try to install gensim==4.0.0, it's OK.

Versions

Linux-3.10.0-1127.18.2.el7.x86_64-x86_64-with-centos-7.8.2003-Core
Python 3.6.8 (default, Apr  2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Bits 64
NumPy 1.19.5
SciPy 1.5.4
@piskvorky
Copy link
Owner

What's the error? Are you able to submit a PR with a fix?

@mpenkov mpenkov changed the title Install gensim faill cause gcc std=c99 Install gensim fail cause gcc std=c99 Aug 22, 2022
@mpenkov mpenkov changed the title Install gensim fail cause gcc std=c99 Install gensim fails because C code is not ANSI-compliant Aug 22, 2022
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

Successfully merging a pull request may close this issue.

2 participants