Penlect / rectangle-packer

Rectangle packing program
MIT License
62 stars 16 forks source link

build failure on linux x86-64 / python 3.5 and python 3.6 #8

Closed boothby closed 4 years ago

boothby commented 4 years ago

I attempted to install rectangle-packer on an x86-64 linux system. There don't appear to be any wheels for linux or osx, so pip falls back to building it. Apparently, the gcc on this system is quite pedantic and needs a -std=c99 flag because of a single line. This issue can be resolved by adding that compiler flag on linux builds, or by mending that one line to conform to ANSI-C.

    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/rpack
    copying rpack/__init__.py -> build/lib.linux-x86_64-3.5/rpack
    running egg_info
    writing rectangle_packer.egg-info/PKG-INFO
    writing top-level names to rectangle_packer.egg-info/top_level.txt
    writing dependency_links to rectangle_packer.egg-info/dependency_links.txt
    reading manifest file 'rectangle_packer.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'rectangle_packer.egg-info/SOURCES.txt'
    running build_ext
    building 'rpack._rpack' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/usr/local/include/python3.5m -c src/rpack.c -o build/temp.linux-x86_64-3.5/src/rpack.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/usr/local/include/python3.5m -c src/areapack.c -o build/temp.linux-x86_64-3.5/src/areapack.o
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/usr/local/include/python3.5m -c src/taskpack.c -o build/temp.linux-x86_64-3.5/src/taskpack.o
    src/taskpack.c: In function ‘check’:
    src/taskpack.c:50:9: warning: variable ‘fail’ set but not used [-Wunused-but-set-variable]
         int fail = 1;
             ^
    src/taskpack.c: In function ‘stack_sum’:
    src/taskpack.c:91:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
         for (size_t i = 0; i < stack->nr_groups; i++){
         ^
    src/taskpack.c:91:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
    src/taskpack.c: At top level:
    src/taskpack.c:45:13: warning: ‘check’ defined but not used [-Wunused-function]
     static void check(StackState *stack, Task *tasks, size_t nr_tasks){
                 ^
    src/taskpack.c:89:15: warning: ‘stack_sum’ defined but not used [-Wunused-function]
     static double stack_sum(StackState *stack){
                   ^
    src/taskpack.c:143:15: warning: ‘get_group_size’ defined but not used [-Wunused-function]
     static size_t get_group_size(Task* tasks, size_t nr_tasks, size_t group){
                   ^
    error: command 'gcc' failed with exit status 1
boothby commented 4 years ago

I see that the offending code is no longer in the repo, and was actually stale and unused when included in the tar on pypi. This is probably not a real issue.