automl / random_forest_run

Other
35 stars 24 forks source link

Installation error limits.h #49

Open janvanrijn opened 5 years ago

janvanrijn commented 5 years ago

Installed swig, cmake, gcc in conda, however we get the following error:


(gensim_env) dyn-160-39-178-198:~ prernakashyap$ pip install pyrfr

Collecting pyrfr

  Using cached https://files.pythonhosted.org/packages/ed/0f/4d7e42a9dfef3a1898e03cffa8f1cfcd1f96507d718808b2db584c6f8401/pyrfr-0.8.0.tar.gz

Building wheels for collected packages: pyrfr

  Running setup.py bdist_wheel for pyrfr ... error

  Complete output from command /Users/prernakashyap/anaconda3/envs/gensim_env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-install-9wu83pgt/pyrfr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-wheel-ee82_ljr --python-tag cp36:

  running bdist_wheel

  running build

  running build_ext

  building 'pyrfr._regression' extension

  swigging pyrfr/regression.i to pyrfr/regression_wrap.cpp

  swig -python -c++ -modern -features nondynamic -I./include -o pyrfr/regression_wrap.cpp pyrfr/regression.i

  creating build

  creating build/temp.macosx-10.7-x86_64-3.6

  creating build/temp.macosx-10.7-x86_64-3.6/pyrfr

  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/prernakashyap/anaconda3/envs/gensim_env/include -arch x86_64 -I/Users/prernakashyap/anaconda3/envs/gensim_env/include -arch x86_64 -I./include -I/Users/prernakashyap/anaconda3/envs/gensim_env/include/python3.6m -c pyrfr/regression_wrap.cpp -o build/temp.macosx-10.7-x86_64-3.6/pyrfr/regression_wrap.o -O2 -std=c++11

  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]

  In file included from /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/syslimits.h:7:0,

                   from /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:34,

                   from /Users/prernakashyap/anaconda3/envs/gensim_env/include/python3.6m/Python.h:11,

                   from pyrfr/regression_wrap.cpp:173:

  /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory

   #include_next <limits.h>  /* recurse down to the real one */

                                                               ^

  compilation terminated.

  error: command 'gcc' failed with exit status 1

  ----------------------------------------

  Failed building wheel for pyrfr

  Running setup.py clean for pyrfr

Failed to build pyrfr

Installing collected packages: pyrfr

  Running setup.py install for pyrfr ... error

    Complete output from command /Users/prernakashyap/anaconda3/envs/gensim_env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-install-9wu83pgt/pyrfr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-record-9qiyacqw/install-record.txt --single-version-externally-managed --compile:

    running install

    running build_ext

    building 'pyrfr._regression' extension

    swigging pyrfr/regression.i to pyrfr/regression_wrap.cpp

    swig -python -c++ -modern -features nondynamic -I./include -o pyrfr/regression_wrap.cpp pyrfr/regression.i

    creating build

    creating build/temp.macosx-10.7-x86_64-3.6

    creating build/temp.macosx-10.7-x86_64-3.6/pyrfr

    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/prernakashyap/anaconda3/envs/gensim_env/include -arch x86_64 -I/Users/prernakashyap/anaconda3/envs/gensim_env/include -arch x86_64 -I./include -I/Users/prernakashyap/anaconda3/envs/gensim_env/include/python3.6m -c pyrfr/regression_wrap.cpp -o build/temp.macosx-10.7-x86_64-3.6/pyrfr/regression_wrap.o -O2 -std=c++11

    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]

    In file included from /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/syslimits.h:7:0,

                     from /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:34,

                     from /Users/prernakashyap/anaconda3/envs/gensim_env/include/python3.6m/Python.h:11,

                     from pyrfr/regression_wrap.cpp:173:

    /Users/prernakashyap/anaconda3/envs/gensim_env/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory

     #include_next <limits.h>  /* recurse down to the real one */

                                                                 ^

    compilation terminated.

    error: command 'gcc' failed with exit status 1

    ----------------------------------------

Command "/Users/prernakashyap/anaconda3/envs/gensim_env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-install-9wu83pgt/pyrfr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-record-9qiyacqw/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ty/2lwym9l571l4xvwp44x5c43c0000gn/T/pip-install-9wu83pgt/pyrfr/

Did someone encounter this problem before? Conda version is 4.5.X

janvanrijn commented 5 years ago

cc @prerna135

AndreBiedenkapp commented 5 years ago

As I suggested in automl/fanova#74 it might be due to the wrong gcc version. Could you tell me which gcc version you are using?

prerna135 commented 5 years ago

I managed to install pyrfr on a mac by setting export CFLAGS="-Wno-deprecated-declarations -std=c++11 -stdlib=libc++" and running pip install pyrfr. I also installed ConfigSpace before doing this. @janvanrijn

janvanrijn commented 5 years ago

cc @abhinavs95

janvanrijn commented 5 years ago

I also had problems installing on my Mac, but the comment by @prerna135 solved the problem also for me. This should be in the user manual (I am happy to provide a PR)

abhinavs95 commented 5 years ago

Worked for me too, used solution by @prerna135

lamuertepeluda commented 4 years ago

env CFLAGS="-Wno-deprecated-declarations -std=c++11 -stdlib=libc++" pipenv install auto-sklearn (or pip if you like) worked for me on macOS X Catalina... I agree this should be in the documentation. Thank you @prerna135 , I was misleaded by other comments telling to install gcc 9 from homebrew, but the clang will be just fine (and -stdlib=libc++ is not recognized by gcc, anyway, leading to other errors).

It installed and compiled without throwing errors. Now I hope it also works. I tried:

pipenv shell # activate virtualenv
ipython # launch ipython
In [1]: import autosklearn.classification
/Users/vito/.local/share/virtualenvs/python-Z0GfkDos/lib/python3.7/site-packages/pyparsing.py:3172: FutureWarning: Possible set intersection at position 3
  self.re = re.compile(self.reString)
/Users/vito/.local/share/virtualenvs/python-Z0GfkDos/lib/python3.7/site-packages/sklearn/ensemble/weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release.
  from numpy.core.umath_tests import inner1d

and I hope everything's fine 😅 'cause I can't understand what it means