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

pyrevolve installation error (g++) #27

Closed
motazalfarraj opened this issue Feb 16, 2019 · 11 comments
Closed

pyrevolve installation error (g++) #27

motazalfarraj opened this issue Feb 16, 2019 · 11 comments

Comments

@motazalfarraj
Copy link

I get this error whenever I try to install devito via pip
I tried different gcc/g++ version, all don't work

Installing collected packages: pyrevolve
  Running setup.py install for pyrevolve ... error
    Complete output from command /bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-woo3yxrq/pyrevolve/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-0yak8udq/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/pyrevolve
    copying pyrevolve/pyrevolve.py -> build/lib.linux-x86_64-3.6/pyrevolve
    copying pyrevolve/_version.py -> build/lib.linux-x86_64-3.6/pyrevolve
    copying pyrevolve/__init__.py -> build/lib.linux-x86_64-3.6/pyrevolve
    UPDATING build/lib.linux-x86_64-3.6/pyrevolve/_version.py
    set build/lib.linux-x86_64-3.6/pyrevolve/_version.py to '1.0.2'
    running build_ext
    building 'pyrevolve.crevolve' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/pyrevolve
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -B /compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I/include/python3.6m -c pyrevolve/crevolve.cpp -o build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from pyrevolve/../include/revolve_c.h:6:0,
                     from pyrevolve/crevolve.cpp:560:
    pyrevolve/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
    pyrevolve/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
      ~Revolve() { delete f, delete checkpoint; }
                          ^
    gcc -pthread -B compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I/include/python3.6m -c src/revolve_c.cpp -o build/temp.linux-x86_64-3.6/src/revolve_c.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from src/../include/revolve_c.h:6:0,
                     from src/revolve_c.cpp:1:
    src/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
    src/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
      ~Revolve() { delete f, delete checkpoint; }
                          ^
    gcc -pthread -B /compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I//include/python3.6m -c src/revolve.cpp -o build/temp.linux-x86_64-3.6/src/revolve.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from src/revolve.cpp:23:0:
    src/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
    src/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
      ~Revolve() { delete f, delete checkpoint; }
                          ^
    src/revolve.cpp: In member function ‘ACTION::action Revolve::revolve(int*, int*, int*, int, int*)’:
    src/revolve.cpp:1247:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete f;
                ^
    src/revolve.cpp:1254:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete f;
                ^
    src/revolve.cpp: In member function ‘ACTION::action Revolve::revolve()’:
    src/revolve.cpp:1273:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete f;
                ^
    src/revolve.cpp:1280:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete f;
                ^
    src/revolve.cpp: In member function ‘void Revolve::turn(int)’:
    src/revolve.cpp:1304:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete f;
                ^
    src/revolve.cpp:1306:12: warning: deleting object of polymorphic class type ‘Online’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
         delete g;
                ^
    src/revolve.cpp: In member function ‘int Revolve::get_r(int, int)’:
    src/revolve.cpp:1400:20: warning: unused variable ‘num’ [-Wunused-variable]
       int reps, range, num;
                        ^~~
    src/revolve.cpp: In member function ‘int Revolve::get_r()’:
    src/revolve.cpp:1431:20: warning: unused variable ‘num’ [-Wunused-variable]
       int reps, range, num;
                        ^~~
    g++ -pthread -shared -B compiler_compat -L/ib -Wl,-rpath=/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o build/temp.linux-x86_64-3.6/src/revolve_c.o build/temp.linux-x86_64-3.6/src/revolve.o -o build/lib.linux-x86_64-3.6/pyrevolve/crevolve.cpython-36m-x86_64-linux-gnu.so
    /compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
    /compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
    /compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
    /compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
    build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: file not recognized: file format not recognized
    collect2: error: ld returned 1 exit status
    error: command 'g++' failed with exit status 1
    
    ----------------------------------------
Command "/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-woo3yxrq/pyrevolve/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-0yak8udq/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-woo3yxrq/pyrevolve/

@navjotk
Copy link
Member

navjotk commented Feb 18, 2019

Can you post the result of the command g++ --version?

@motazalfarraj
Copy link
Author

g++ (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I also tried it with G++ 7.4 and got the same error.

@navjotk
Copy link
Member

navjotk commented Feb 20, 2019

Can you also please post the result of gcc --version? I suspect that it is trying to compile with different versions of gcc and g++. Else I'll try to do this on the same versions on my system to reproduce this error.

@motazalfarraj
Copy link
Author

Can you also please post the result of gcc --version? I suspect that it is trying to compile with different versions of gcc and g++. Else I'll try to do this on the same versions on my system to reproduce this error.

gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Same version

@navjotk
Copy link
Member

navjotk commented Feb 21, 2019

@angelsaj I think this is a different, and probably unrelated error. Is there a reason you believe this is related to the original issue, that I am missing?

@navjotk
Copy link
Member

navjotk commented Feb 21, 2019

Let's please deal with them separately.

@navjotk
Copy link
Member

navjotk commented Feb 21, 2019

@motazalfarraj I have now tested with multiple versions of gcc - including the ones you used, on different linux systems and am not able to reproduce this problem. Can you give me more information about your system? OS version? Output of printenv? Also, could you post the full output, including the command you gave to initiate this installation?

@motazalfarraj
Copy link
Author

@motazalfarraj I have now tested with multiple versions of gcc - including the ones you used, on different linux systems and am not able to reproduce this problem. Can you give me more information about your system? OS version? Output of printenv? Also, could you post the full output, including the command you gave to initiate this installation?

SHELL=/bin/bash
COLORTERM=truecolor
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
CONDA_EXE=/home/motaz/anaconda3/bin/conda
LC_ADDRESS=en_US.UTF-8
LC_NAME=en_US.UTF-8
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
DESKTOP_SESSION=deepin
LC_MONETARY=en_US.UTF-8
NO_AT_BRIDGE=1
EDITOR=/usr/bin/nano
GTK_MODULES=canberra-gtk-module
XDG_SEAT=seat0
PWD=/home/motaz
XDG_SESSION_DESKTOP=deepin
LOGNAME=motaz
XDG_SESSION_TYPE=x11
CONDA_PREFIX=/home/motaz/anaconda3
XAUTHORITY=/home/motaz/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/motaz
GTK2_RC_FILES=/home/motaz/.gtkrc-2.0
HOME=/home/motaz
LC_PAPER=en_US.UTF-8
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.pdf=00;32:.ps=00;32:.txt=00;32:.patch=00;32:.diff=00;32:.log=00;32:.tex=00;32:.doc=00;32:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga=00;36:.spx=00;36:.xspf=00;36:
XDG_CURRENT_DESKTOP=Deepin
VTE_VERSION=5403
CONDA_PROMPT_MODIFIER=
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
YAOURT_COLORS=nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35
XDG_SESSION_CLASS=user
IBUS_DISABLE_SNOOPER=1
TERM=xterm-256color
LC_IDENTIFICATION=en_US.UTF-8
USER=motaz
CONDA_SHLVL=1
DISPLAY=:0
QT_DBL_CLICK_DIST=15
SHLVL=1
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
XDG_VTNR=1
XDG_SESSION_ID=2
CONDA_PYTHON_EXE=/home/motaz/anaconda3/bin/python
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_RUNTIME_DIR=/run/user/1000
CONDA_DEFAULT_ENV=base
LC_TIME=en_US.UTF-8
PATH=/home/motaz/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
GDMSESSION=deepin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/motaz
GIO_LAUNCHED_DESKTOP_FILE_PID=20281
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/deepin-terminal.desktop
LC_NUMERIC=en_US.UTF-8
_=/usr/bin/printenv

@motazalfarraj
Copy link
Author

Sorry I keep closing the issue by mistake.

This is the system info:
System: Host: motaz-pc Kernel: 4.19.23-1-MANJARO x86_64 bits: 64 Desktop: Deepin 15.9 Distro: Manjaro Linux

Also, I simply do pip install pyrevolve

@motazalfarraj
Copy link
Author

when I tried:
git clone https://github.com/opesci/pyrevolve.git
cd pyrevolve
python setup.py build_ext --inplace

I get this error

python setup.py build_ext --inplace
running build_ext
building 'pyrevolve.crevolve' extension
gcc -pthread -B /home/motaz/anaconda3/envs/devito/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I/home/motaz/anaconda3/envs/devito/include/python3.6m -c pyrevolve/crevolve.cpp -o build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from pyrevolve/../include/revolve_c.h:6,
from pyrevolve/crevolve.cpp:628:
pyrevolve/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
pyrevolve/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
~Revolve() { delete f, delete checkpoint; }
^
gcc -pthread -B /home/motaz/anaconda3/envs/devito/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I/home/motaz/anaconda3/envs/devito/include/python3.6m -c src/revolve_c.cpp -o build/temp.linux-x86_64-3.6/src/revolve_c.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/../include/revolve_c.h:6,
from src/revolve_c.cpp:1:
src/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
src/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
~Revolve() { delete f, delete checkpoint; }
^
gcc -pthread -B /home/motaz/anaconda3/envs/devito/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./pyrevolve -I. -Ipyrevolve -I/home/motaz/anaconda3/envs/devito/include/python3.6m -c src/revolve.cpp -o build/temp.linux-x86_64-3.6/src/revolve.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/revolve.cpp:23:
src/../include/revolve.h: In destructor ‘Revolve::~Revolve()’:
src/../include/revolve.h:441:22: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
~Revolve() { delete f, delete checkpoint; }
^
src/revolve.cpp: In member function ‘ACTION::action Revolve::revolve(int*, int*, int*, int, int*)’:
src/revolve.cpp:1247:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete f;
^
src/revolve.cpp:1254:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete f;
^
src/revolve.cpp: In member function ‘ACTION::action Revolve::revolve()’:
src/revolve.cpp:1273:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete f;
^
src/revolve.cpp:1280:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete f;
^
src/revolve.cpp: In member function ‘void Revolve::turn(int)’:
src/revolve.cpp:1304:12: warning: deleting object of polymorphic class type ‘Schedule’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete f;
^
src/revolve.cpp:1306:12: warning: deleting object of polymorphic class type ‘Online’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete g;
^
src/revolve.cpp: In member function ‘int Revolve::get_r(int, int)’:
src/revolve.cpp:1400:20: warning: unused variable ‘num’ [-Wunused-variable]
int reps, range, num;
^~~
src/revolve.cpp: In member function ‘int Revolve::get_r()’:
src/revolve.cpp:1431:20: warning: unused variable ‘num’ [-Wunused-variable]
int reps, range, num;
^~~
g++ -pthread -shared -B /home/motaz/anaconda3/envs/devito/compiler_compat -L/home/motaz/anaconda3/envs/devito/lib -Wl,-rpath=/home/motaz/anaconda3/envs/devito/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o build/temp.linux-x86_64-3.6/src/revolve_c.o build/temp.linux-x86_64-3.6/src/revolve.o -o build/lib.linux-x86_64-3.6/pyrevolve/crevolve.cpython-36m-x86_64-linux-gnu.so
/home/motaz/anaconda3/envs/devito/compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
/home/motaz/anaconda3/envs/devito/compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
/home/motaz/anaconda3/envs/devito/compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
/home/motaz/anaconda3/envs/devito/compiler_compat/ld: build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: unable to initialize decompress status for section .debug_info
build/temp.linux-x86_64-3.6/pyrevolve/crevolve.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

@motazalfarraj
Copy link
Author

I eventually solved the issue by doing the following

1- Create a conda env with python 3.6
2- pip install pyrevolve
3- Follow instructions on how to install devito from their github.

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