2014-08-30 4 views
1

내가 pip install 할 때 rpy2를 컴파일 오류로 실행이 :오류로 인해 python3.4에 RPY2를 컴파일 -Werror = 선언 - 후 문

./rpy/rinterface/_rinterface.c:2376:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 

(그리고 더 많은 좋아)

이 파이썬 컴파일러로 만든 것을 호출입니다 : 일부 인터넷 검색으로

gcc -pthread -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/home/hen/miniconda3/envs/fitts/include/python3.4m -I/usr/share/R/include -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.4/./rpy/rinterface/_rinterface.o 

답변

3

, 나는이 문제는 -Werror=declaration-after-statement 플래그 것을 결정했다. 이 깃발의 출처를 알아내는 중입니다. 나는 결국에왔다 this Python issue :

3.4 용 모듈을 재구성하는 동안 오류가 발생했습니다. 이것은 ISO C90 오류 였지만 setup.py는 명시 적으로 -std=c99을 gcc 매개 변수에 추가하며 실제로 사용됩니다.

fifo.h:114:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] uint32_t ofs = fifo->write_count - fifo->write_offset;

그러나, Py를 3.4 확장 모듈도 -Werror=declaration-after-statement을 추가 할 것으로 보인다. 이것은 일어나서는 안됩니다 (Yhg1s in #python).

수정이 당신에게 길을 만드는까지

,이 pip install 또는 python setup.py install을 실행하기 전에

export CFLAGS="-Wno-error=declaration-after-statement" 

을 실행하여 해결할 수 있습니다.

+0

아마도 여기 같은 문제가 있습니다. https://bitbucket.org/lgautier/rpy2/issue/203/problems-building-rpy2-hg-repository-on. 수정은 Python 3.4.2에서 이루어져야합니다. – lgautier

+0

3.4.2가 문제를 해결했는지 확인할 수 있습니다. –