src-d / hercules

Gaining advanced insights from Git repository history.
Other
2.59k stars 264 forks source link

Installing hercules in RHEL 7 - gcc compatibility? #360

Closed M2ohamad closed 4 years ago

M2ohamad commented 4 years ago

Which version of gcc works? I am running into errors after running "make" in Hercules and it seems to point to gcc problem.

Using: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)

image
vmarkovtsev commented 4 years ago

No idea about this, sorry. Windows?

M2ohamad commented 4 years ago

No, using Red Hat linux. Before on MacOS using "clang" instead of gcc, running 'make' was successful.

M2ohamad commented 4 years ago

I've been tackling with this issue for a long time. Do you know where we can pass "-w" to gcc in order to ignore warnings? https://www.linuxquestions.org/questions/programming-9/gcc-warnings-being-treated-as-errors-how-to-close-it-723259/

M2ohamad commented 4 years ago

Update: Got past the first error, but ran into more. By using make CGO_CFLAGS="-w", the GCC Compiler ignores warnings...but there has to be a deeper issue here. What compiler is everyone using?

image
M2ohamad commented 4 years ago

Solution: Got help from Mark Guz, an experienced developer and friend. Here's his steps:

sudo yum install go --enablerepo=epel then wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip

unzip that into somewhere that is in your PATH

sudo yum install python-virtualenv

sudo yum install python3 python3-devel

mkdir hercules-venv

virtualenv -p python3 hercules-venv

source hercules-venv/bin/activate

cd into the git clone of hercules and run

sudo yum install @development

make CGO_CFLAGS="-std=gnu99"

pip install cython

pip3 install -e ./python

you don't have to use a python-virtualenv, but i find it's easier to keep these things nice and neat run deactivate to exit the virtualenv

-- You might see a warning after make, but it still compiles.