Czaki / imagecodecs

This repository is for build wheel for imagecodecs and contains copy of official release
https://pypi.org/project/imagecodecs/
2 stars 1 forks source link

Build fails on CentOS 7 #8

Open rsolano1-uw opened 4 years ago

rsolano1-uw commented 4 years ago

Description of problem: When running python setup.py install --prefix='../install' on a CentOS 7 system, the build fails and prints error messages.

Steps to replicate:

  1. Be on CentOS 7
  2. Add ../install to your pythonpath
  3. Have numpy and cython in your pythonpath
  4. Run python setup.py install --prefix='../install'

Expected results: Software compiles

Actual results:

building 'imagecodecs._bitshuffle' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/python3.6 -I/net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/ -fPIC -Iimagecodecs -Ibitshuffle-0.3.5 -I/net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/python3.6m -I/net/gs/vol3/software/modules-sw-python/3.6.5/numpy/1.18.4/Linux/CentOS7/x86_64/lib/python3.6/site-packages/numpy/core/include -c imagecodecs/_bitshuffle.c -o build/temp.linux-x86_64-3.6/imagecodecs/_bitshuffle.o
In file included from /net/gs/vol3/software/modules-sw-python/3.6.5/numpy/1.18.4/Linux/CentOS7/x86_64/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832:0,
                 from /net/gs/vol3/software/modules-sw-python/3.6.5/numpy/1.18.4/Linux/CentOS7/x86_64/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /net/gs/vol3/software/modules-sw-python/3.6.5/numpy/1.18.4/Linux/CentOS7/x86_64/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from imagecodecs/_bitshuffle.c:598:
/net/gs/vol3/software/modules-sw-python/3.6.5/numpy/1.18.4/Linux/CentOS7/x86_64/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
In file included from bitshuffle-0.3.5/bitshuffle.h:32:0,
                 from imagecodecs/_bitshuffle.c:602:
bitshuffle-0.3.5/bitshuffle_core.h:40:31: error: conflicting types for ‘uint64_t’
   typedef unsigned long long  uint64_t;
                               ^
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdint.h:9:0,
                 from /usr/include/inttypes.h:27,
                 from /net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/python3.6m/pyport.h:6,
                 from /net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/python3.6m/Python.h:53,
                 from imagecodecs/_bitshuffle.c:4:
/usr/include/stdint.h:55:27: note: previous declaration of ‘uint64_t’ was here
 typedef unsigned long int uint64_t;
                           ^
In file included from bitshuffle-0.3.5/bitshuffle.h:32:0,
                 from imagecodecs/_bitshuffle.c:602:
bitshuffle-0.3.5/bitshuffle_core.h:41:31: error: conflicting types for ‘int64_t’
   typedef long long           int64_t;
                               ^
In file included from /usr/include/stdlib.h:314:0,
                 from /net/gs/vol3/software/modules-sw/python/3.6.5/Linux/CentOS7/x86_64/include/python3.6m/Python.h:34,
                 from imagecodecs/_bitshuffle.c:4:
/usr/include/sys/types.h:197:1: note: previous declaration of ‘int64_t’ was here
 __intN_t (64, __DI__);
 ^
error: command 'gcc' failed with exit status 1
Czaki commented 4 years ago

This repo is only for build wheel for imagecodecs. most probably You have to low version of pip to install wheel. Upgrade it using [pip install -U pip

If you want to install from source see https://github.com/Czaki/imagecodecs/blob/master/build_utils/download_libraries.sh and https://github.com/Czaki/imagecodecs/blob/master/build_utils/build_libraries.sh scripts. Ten You need to set proper environment variable (like LD_LIBRARY_PATH)

https://github.com/Czaki/imagecodecs/issues/6#issuecomment-600145696

rsolano1-uw commented 4 years ago

Hey Czaki,

I have pip 18.0 from python 3.6.5, so I think that I should be able to do wheel. For the source install, I had to append .git to the gitlab URLs in download_libraries.sh, and for build_libraries.sh, they were all able to build except for snappy and bzip2. This is using gcc 8.2.0 and cmake 3.14.5.

snappy errors out with the messages:

undefined reference to `testing::Test::~Test()'
undefined reference to `testing::Test::SetUp()'
undefined reference to `testing::Test::TearDown()'

a million times, followed by:

collect2: error: ld returned 1 exit status
make[2]: *** [snappy_unittest] Error 1
make[1]: *** [CMakeFiles/snappy_unittest.dir/all] Error 2
make: *** [all] Error 2

bzip2 errors out with:

Build bzip2
/usr/libexec/git-core/git-stash: line 232: /net/gs/vol3/software/modules-sw-python/3.6.5/imagecodecs/2020.2.18/Linux/CentOS7/x86_64/compileinhere/imagecodecs/build_utils/libs_src/bzip2/.git/logs/refs/stash: No such file or directory

I'm just trying to get imagecodecs installed into my PYTHONPATH so that I can install datashader, since imagecodecs from pip fails to install.

Czaki commented 4 years ago

from the documentation of pip miniamal version for manylinux2010 is 19.0 https://pip.pypa.io/en/stable/news/#id242. Because of compiler feature there is no option to build manylinux1 wheel (or I do not found way to do it) so I think that best way for you is upgrade pip.

bzip2 error looks like your git problem. This stash is to remove previous changes before apply stash. If you execute script once it can be omitted.