SheffieldML / GPy

Gaussian processes framework in python
BSD 3-Clause "New" or "Revised" License
2.01k stars 558 forks source link

Error when installing GPy with python 3.6.5 and gcc 4.8.5 on a Red Hat Enterprise Linux Server 7.5 #682

Open yuna-anuy opened 5 years ago

yuna-anuy commented 5 years ago

Hi guys,

last week there was some patching on a Cluster I have to use (and as always - I don't know what was patched..) and now I cannot install GPy anymore. I get the following error:

    Installing collected packages: scipy, six, decorator, paramz, GPy, GPyOpt
    Running setup.py install for paramz ... done
    Running setup.py install for GPy ... error
    Complete output from command /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/bin/python -u -c "import setuptools, tokenize;__file__='/scratch/pip-install-rs_36mtj/GPy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /scratch/pip-record-97kwroi8/install-record.txt --single-version-externally-managed --compile --install-headers /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/include/site/python3.6/GPy:
    running install
    ...
    copying GPy/util/linalg_cython.pyx -> build/lib.linux-x86_64-3.6/GPy/util
    running build_ext
    building 'GPy.kern.src.stationary_cython' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/GPy
    creating build/temp.linux-x86_64-3.6/GPy/kern
    creating build/temp.linux-x86_64-3.6/GPy/kern/src
    /opt/intel/compilers_and_libraries_2017/linux/bin/intel64/icc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O2 -ipo -xHost -fPIC -I/pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include -I. -I/pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/include -I/opt/intel/intelpython3/include/python3.6m -c GPy/kern/src/stationary_cython.c -o build/temp.linux-x86_64-3.6/GPy/kern/src/stationary_cython.o -fopenmp -O3
    In file included from /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h(1821),
                     from /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h(18),
                     from /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h(4),
                     from GPy/kern/src/stationary_cython.c(242):
    /pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h(15): warning #1224: #warning directive: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
      #warning "Using deprecated NumPy API, disable it by " \
       ^

    /opt/intel/compilers_and_libraries_2017/linux/bin/intel64/icc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O2 -ipo -xHost -fPIC -I/pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/lib/python3.6/site-packages/numpy/core/include -I. -I/pfs/work6/workspace/scratch/ov0392-benedikt-test-0/env/include -I/opt/intel/intelpython3/include/python3.6m -c GPy/kern/src/stationary_utils.c -o build/temp.linux-x86_64-3.6/GPy/kern/src/stationary_utils.o -fopenmp -O3
    gcc -pthread -shared -L/opt/intel/intelpython3/lib -Wl,-rpath=/opt/intel/intelpython3/lib,--no-as-needed -z noexecstack -z relro -z now -fstack-protector -O2 -ipo -xHost build/temp.linux-x86_64-3.6/GPy/kern/src/stationary_cython.o build/temp.linux-x86_64-3.6/GPy/kern/src/stationary_utils.o -L/opt/intel/intelpython3/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/GPy/kern/src/stationary_cython.cpython-36m-x86_64-linux-gnu.so -lgomp
    gcc: error: unrecognized command line option ‘-ipo’
    error: command 'gcc' failed with exit status 1

I've tried using Python 3.6.5 and 3.5.3. Os is a Red Hat Enterprise Linux Server with Version 7.5 (Maipo) and the corresponding gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28).

This error seems to be similar to Error when installing GPy on a new machine with Amazon Linux. Error in compilation #632. I also tried to google the failed command line option -ipo but I wasn't abled to find anything.

Does anyone know how to fix this?

Thanks!

jdaaph commented 5 years ago

I have the exact same issue with python 3.5

lionfish0 commented 5 years ago

I'm not sure which of these are necessary, sorry, but some combination of the below will probably fix this (on AWS Ubuntu 18.04 anyway)

sudo apt-get install python3-dev
sudo apt-get update
sudo apt-get install build-essential

or maybe: conda update anaconda

(please let us know if that solves your problems)