kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.38k stars 997 forks source link

Building Cython-based G-Code parser requires python-dev package. #763

Closed ghpenguin closed 7 years ago

ghpenguin commented 8 years ago

Hi,

When I ran the following command, it complained pyconfig.h is missing in raspbian jessie Linux. Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux

$ python setup.py build_ext --inplace
WARNING:root:Memory-efficient GCoder implementation unavailable: No module named gcoder_line
running build_ext
building 'printrun.gcoder_line' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c printrun/gcoder_line.c -o build/temp.linux-armv7l-2.7/printrun/gcoder_line.o
printrun/gcoder_line.c:8:22: fatal error: pyconfig.h: No such file or directory
 #include "pyconfig.h"

pyconfig.h exist according to the search result.

$ find / -name pyconfig.h 2>/dev/null
/usr/include/python3.4m/pyconfig.h
/usr/include/x86_64-linux-gnu/python3.4m/pyconfig.h
/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h
/usr/include/python2.7/pyconfig.h

After installation python-dev package

aptitude install python-dev
The following NEW packages will be installed:
  libexpat1-dev{a} libpython-dev{a} libpython2.7-dev{a} python-dev
  python2.7-dev{a}
The following packages will be upgraded:
  libexpat1

It successfully built the gcoder_line module.

python setup.py build_ext --inplace
WARNING:root:Memory-efficient GCoder implementation unavailable: No module named gcoder_line
running build_ext
building 'printrun.gcoder_line' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c printrun/gcoder_line.c -o build/temp.linux-armv7l-2.7/printrun/gcoder_line.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/printrun/gcoder_line.o -o /home/pi/3D-Printer/Printrun/printrun/gcoder_line.so

In my Devuan Linux system, it built the module successfully as I expected. Linux dv1-station1 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux

python setup.py build_ext --inplace Compiling printrun/gcoder_line.pyx because it changed. Cythonizing printrun/gcoder_line.pyx WARNING:root:Memory-efficient GCoder implementation unavailable: No module named gcoder_line running build_ext building 'printrun.gcoder_line' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/printrun x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c printrun/gcoder_line.c -o build/temp.linux-x86_64-2.7/printrun/gcoder_line.o x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/printrun/gcoder_line.o -o /home/penguin/old_penguin/Workshop/3D_Printer/Kossel_Mini/Pronterface/printrun/gcoder_line.so

rockstorm101 commented 7 years ago

I can confirm this issue, libpython-dev is needed to build the optimized gcode parser in Debian/Ubuntu systems.