corels / pycorels

Public home of pycorels, the python binding to CORELS
GNU General Public License v3.0
74 stars 14 forks source link

Installation on Linux systems other than Ubuntu #3

Closed snowlover173 closed 4 years ago

snowlover173 commented 4 years ago

Hi How can I install it on Linux systems other than Ubuntu? It doesn't work.

ameliabennett commented 4 years ago

I have it working on RHEL... What does your bug look like?

saligrama commented 4 years ago

@snowlover173 does pip install corels not work?

snowlover173 commented 4 years ago

It fails with cannot build the wheel with a lot of errors such as: corels/src/corels/rule.h:28:17: fatal error: gmp.h: No such file or directory.

corels/src/corels/cache.hh:53:136: required from here /usr/include/c++/4.8.5/bits/stl_map.h:143:58: error: no type named ‘pointer’ in ‘std::map<short unsigned int, Node, std::less, track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0> >::_Pair_alloc_type {aka struct track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0>}’ typedef typename _Pair_alloc_type::pointer pointer; ^ /usr/include/c++/4.8.5/bits/stl_map.h:144:58: error: no type named ‘const_pointer’ in ‘std::map<short unsigned int, Node, std::less, track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0> >::_Pair_alloc_type {aka struct track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0>}’ typedef typename _Pair_alloc_type::const_pointer const_pointer; ^ /usr/include/c++/4.8.5/bits/stl_map.h:145:58: error: no type named ‘reference’ in ‘std::map<short unsigned int, Node, std::less, track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0> >::_Pair_alloc_type {aka struct track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0>}’ typedef typename _Pair_alloc_type::reference reference; ^ /usr/include/c++/4.8.5/bits/stl_map.h:146:58: error: no type named ‘const_reference’ in ‘std::map<short unsigned int, Node, std::less, track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0> >::_Pair_alloc_type {aka struct track_alloc<std::pair<const short unsigned int, Node>, (DataStruct)0>}’ typedef typename _Pair_alloc_type::const_reference const_reference; ^ I

saligrama commented 4 years ago

@snowlover173 seems that your problem is not having GMP installed. Install GMP through your linux distro's package manager and try installing pycorels again.

snowlover173 commented 4 years ago

it has gmp. I think the issue is gcc. I will try working on that to see what happens.

fingoldin commented 4 years ago

@snowlover173 I think you're using an older version of g++, which isn't supporting c++11. Try upgrading both gcc and g++ to the newest version (version 9, or 8 should work fine as well).

snowlover173 commented 4 years ago

For the record I ran: yum install gcc72-c++

And ran: pip install corels and it worked.

fingoldin commented 4 years ago

Awesome! Glad it worked :D

eddelbuettel commented 4 years ago

Can I suggest one modification and/or alternate? I actually like to rely on my system Python libraries and my box already had setuptools, numpy and pytest. But when I attempt to use pip or pip3 it ends up re-downloading wheels for packages I already have.

Solution: python3 setup.py install

Maybe you could mention along with the line for pip (which these on newer Ubuntu is probably meant to be pip3).

Anyway, thanks for setting this up. It installs fine, and the examples run fine too. Ubuntu 19.10.

PS It may also help to mention git clone --recurse-submodules git@github.com:fingoldin/pycorels.git right at the top or else the corels/src/corels/ directory may end up empty.