Redisgraph: Compilation Error in CentOS6 and CentOS7

Created on 7 Nov 2019  Â·  26Comments  Â·  Source: RedisGraph/RedisGraph

Most helpful comment

@iarriagada, @WXY3 please see Dockerfile.centos
as a reference to building RedisGraph on CentOS

All 26 comments

Hi @WXY3,
Would you mind trying compiling GraphBLAS (one of our dependencies) individually?
From /deps/GraphBLAS run make distclean and then make

Let's make sure we're able to compile GraphBLAS first, I'll try to build RedisGraph on a CentOS7 using docker.

HI:@swilly22
When I trying compiling GraphBLAS in CentOS7 and CentOS6 is not ok !

image

HI:@swilly22
I want to know if RedisGraph can be used in CentOS6 or CentOS7?

Hi @WXY3,
Would you mind trying compiling GraphBLAS (one of our dependencies) individually?
From /deps/GraphBLAS run make distclean and then make

Let's make sure we're able to compile GraphBLAS first, I'll try to build RedisGraph on a CentOS7 using docker.

@swilly22 I want to know if RedisGraph can be used in CentOS6 or CentOS7?

I want to know if RedisGraph can be used in CentOS6 or CentOS7?

Hi @WXY3,
Would you mind trying compiling GraphBLAS (one of our dependencies) individually?
From /deps/GraphBLAS run make distclean and then make
Let's make sure we're able to compile GraphBLAS first, I'll try to build RedisGraph on a CentOS7 using docker.

I want to know if RedisGraph can be used in CentOS6 or CentOS7?

gcc version must be at least 4.9 but our version is 4.8.5,Upgrade cost is too high

image

Hi @WXY3,
Would you mind trying compiling GraphBLAS (one of our dependencies) individually?
From /deps/GraphBLAS run make distclean and then make

Let's make sure we're able to compile GraphBLAS first, I'll try to build RedisGraph on a CentOS7 using docker.

I hope to solve the CentOS installation problem because we need to use it for production.

@WXY3,
I was able to build RedisGraph on CentOS7, I had to

  1. Upgrade GCC, as RedisGraph require a compiler compatible with c11. I've built GCC latest version from source.
  2. install peg/leg

We might be able to provide you with binaries if that's a valid option for you.

@WXY3,
I was able to build RedisGraph on CentOS7, I had to

  1. Upgrade GCC, as RedisGraph require a compiler compatible with c11. I've built GCC latest version from source.
  2. install peg/leg

We might be able to provide you with binaries if that's a valid option for you.

@swilly22 sorry I trying but it‘s not ok

image

@WXY3,
I was able to build RedisGraph on CentOS7, I had to

  1. Upgrade GCC, as RedisGraph require a compiler compatible with c11. I've built GCC latest version from source.
  2. install peg/leg

We might be able to provide you with binaries if that's a valid option for you.

@swilly22 sorry I trying but it‘s not ok

image

@WXY3,
I was able to build RedisGraph on CentOS7, I had to

  1. Upgrade GCC, as RedisGraph require a compiler compatible with c11. I've built GCC latest version from source.
  2. install peg/leg

We might be able to provide you with binaries if that's a valid option for you.

@swilly22
I tried to compile a lot but it didn't work.
Ok, most of our business runs on CentOS6.

@WXY3 make sure to update your cc symlink
Try running cc --version which might show you that cc points to the old gcc.

@WXY3 make sure to update your cc symlink
Try running cc --version which might show you that cc links to the old gcc.

@swilly22

Thank you very much, after upgrading gcc and installing peg, I have successfully compiled RedisGraph1.2.2 on CentOS7. Thank you again.

@WXY3 may I ask what is your use-case for RedisGraph? also how many nodes and edges are stored in it?

RedisGraph

@swilly22
We are the dba team, I have compiled and installed successfully using RedisGraph1.0.7 according to your method, but RedisGraph1.2.2 is compiled successfully but the installation fails.

image

This message is GOMP is referring to OpenMP please make sure OpenMP is installed on your system,
On Sunday I'll try to re-run the process of compiling and running on CentOS7.

This message is GOMP is referring to OpenMP please make sure OpenMP is installed on your system,
On Sunday I'll try to re-run the process of compiling and running on CentOS7.

@swilly22

I compiled successfully in the RedisGraph-master version of epsS/GraphBLAS, but failed to compile in the root directory.

image

What do these two parameters mean, I understand that min_redis_version does not understand min_redis_pack_version

image

ramp files are intended to be used with Redis enterprise and are not relevant for Redis open source,
but, min_redis_version specifies the minimum required Redis version,
min_redis_pack_version specifies the minimum required Redis enterprise version.

Let me make sure I understand you're able to compile GraphBLAS from the /deps/GraphBLAS directory but failed to compile from the directory?

ramp files are intended to be used with Redis enterprise and are not relevant for Redis open source,
but, min_redis_version specifies the minimum required Redis version,
min_redis_pack_version specifies the minimum required Redis enterprise version.

Let me make sure I understand you're able to compile GraphBLAS from the /deps/GraphBLAS directory but failed to compile from the directory?

@swilly22 Yes you are right( I compile GraphBLAS from the /deps/GraphBLAS directory but failed to compile from the directory)。As of now, I compiled successfully in version 1.0.7, 1.2.2, 1.99.0 on CentOS7(gcc-6.4.0)

Well, you should be able to compile from RedisGraph root directory, if that's not the case we need to figure out what's wrong.
in addition there's still the issue of run-time right?

Well, you should be able to compile from RedisGraph root directory, if that's not the case we need to figure out what's wrong.
in addition there's still the issue of run-time right?

I compiled failed in version RedisGraph-1.99.2 RedisGraph-1.99.4 RedisGraph-master on CentOS7(gcc-6.4.0)

I compiled deps/GraphBLAS directory,not compiled failed in RedisGraph root directory.

image

image

MERGE has poor performance and can cause master-slave latency

image
image
image
image

Hello redisgraph team
I'm having problems compiling RedisGraph on a centos7 machine.
I've updated gcc and installed peg, but now the build is failing at this step

make[4]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib/src'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..    -pthread  -Wpedantic -Wvla -fPIC -DYY_BUFFER_SIZE=1048576 -MT libcypher_parser_la-annotation.lo -MD -MP -MF .deps/libcypher_parser_la-annotation.Tpo -c -o libcypher_parser_la-annotation.lo `test -f 'annotation.c' || echo './'`annotation.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -Wpedantic -Wvla -fPIC -DYY_BUFFER_SIZE=1048576 -MT libcypher_parser_la-annotation.lo -MD -MP -MF .deps/libcypher_parser_la-annotation.Tpo -c annotation.c -o libcypher_parser_la-annotation.o
In file included from astnode.h:23:0,
                 from annotation.c:19:
util.h: In function ‘mdup’:
util.h:147:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     void *dst = malloc(n);
     ^
util.h: At top level:
util.h:168:43: error: expected ‘;’, ‘,’ or ‘)’ before ‘buf’
 ssize_t snprintf_realloc(char ** restrict buf, size_t *bufcap,
                                           ^
annotation.c: In function ‘cypher_astnode_attach_annotation’:
annotation.c:81:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation_node = find_annotation(
     ^
annotation.c: In function ‘cypher_astnode_remove_annotation’:
annotation.c:119:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation = find_annotation(
     ^
annotation.c:132:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     void *data = annotation->data;
     ^
annotation.c: In function ‘cypher_astnode_get_annotation’:
annotation.c:145:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation = find_annotation(
     ^
annotation.c: In function ‘find_annotation’:
annotation.c:159:5: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
     // search using the astnode as it will typically have less items
     ^
annotation.c:159:5: warning: (this will be reported only once per input file) [enabled by default]
annotation.c: In function ‘attach_annotation_to_astnode’:
annotation.c:175:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     cypher_astnode_t *astnode = (cypher_astnode_t *)(uintptr_t)node;
     ^
annotation.c: In function ‘cp_release_annotation’:
annotation.c:249:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     cypher_ast_annotation_context_t *context = annotation->context;
     ^
make[4]: *** [libcypher_parser_la-annotation.lo] Error 1
make[4]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib/src'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser'
make[1]: *** [../deps/libcypher-parser/lib/src/.libs/libcypher-parser.a] Error 2
make[1]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/src'
make: *** [all] Error 2

Any help will be greatly appreciated

Hi @iarriagada,

Which GCC version did you update to? We require support for C11, so the warnings about ISO C90 give me pause!

I'm using gcc4.9.2. Here's the full sequence I've gone thru so far.
When I first tried to compile RedisGraph, I got the following message

$ sudo make
make[1]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/src'
make[2]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/rax'
cc -c -Wall -Wno-unused-function -Wno-unused-variable -Wno-unused-result -fPIC -D_GNU_SOURCE -DREDIS_MODULE_TARGET -DREDISMODULE_EXPERIMENTAL_API -DXXH_STATIC_LINKING_ONLY -g -ggdb -O3  -g -ggdb rax-test.c
rax-test.c: In function ‘htHash’:
rax-test.c:73:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < len; i++)
     ^
rax-test.c:73:5: note: use option -std=c99 or -std=gnu99 to compile your code

I added the suggested flag to ./src/Makefile and compiled, this is time I got the well known, gcc4.9 message

CMake Error at CMakeLists.txt:234 (message):
  gcc version must be at least 4.9


-- Configuring incomplete, errors occurred!
See also "/data/iarriagada/devel/redis/RedisGraph/deps/GraphBLAS/build/CMakeFiles/CMakeOutput.log".
See also "/data/iarriagada/devel/redis/RedisGraph/deps/GraphBLAS/build/CMakeFiles/CMakeError.log".
make[3]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/GraphBLAS/build'
make[3]: *** No rule to make target `graphblas_static'.  Stop.
make[3]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/GraphBLAS/build'
make[2]: *** [static_only] Error 2
make[2]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/GraphBLAS'
make[1]: *** [../deps/GraphBLAS/build/libgraphblas.a] Error 2
make[1]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/src'
make: *** [all] Error 2

Rm'ed the git clone, cloned again, built gcc4.9 from src, and compiled again, getting to this point

sudo make
make[1]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/src'
make[2]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/rax'
cc -c -Wall -Wno-unused-function -Wno-unused-variable -Wno-unused-result -fPIC -D_GNU_SOURCE -DREDIS_MODULE_TARGET -DREDISMODULE_EXPERIMENTAL_API -DXXH_STATIC_LINKING_ONLY -g -ggdb -O3  -g -ggdb rax-test.c
rax-test.c: In function ‘htHash’:
rax-test.c:73:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for (size_t i = 0; i < len; i++)
     ^
rax-test.c:73:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Now it tells me I have a new flags available -std=c11 or -std=gnu11. I added the latter to ./src/Makefile and compiled. This is where I'm currently sitting

make[3]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser'
Making check in lib
make[3]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib'
Making check in src
make[4]: Entering directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib/src'
/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..    -pthread  -Wpedantic -Wvla -fPIC -DYY_BUFFER_SIZE=1048576 -MT libcypher_parser_la-annotation.lo -MD -MP -MF .deps/libcypher_parser_la-annotation.Tpo -c -o libcypher_parser_la-annotation.lo `test -f 'annotation.c' || echo './'`annotation.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -pthread -Wpedantic -Wvla -fPIC -DYY_BUFFER_SIZE=1048576 -MT libcypher_parser_la-annotation.lo -MD -MP -MF .deps/libcypher_parser_la-annotation.Tpo -c annotation.c -o libcypher_parser_la-annotation.o
In file included from astnode.h:23:0,
                 from annotation.c:19:
util.h: In function ‘mdup’:
util.h:147:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     void *dst = malloc(n);
     ^
util.h: At top level:
util.h:168:43: error: expected ‘;’, ‘,’ or ‘)’ before ‘buf’
 ssize_t snprintf_realloc(char ** restrict buf, size_t *bufcap,
                                           ^
annotation.c: In function ‘cypher_astnode_attach_annotation’:
annotation.c:81:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation_node = find_annotation(
     ^
annotation.c: In function ‘cypher_astnode_remove_annotation’:
annotation.c:119:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation = find_annotation(
     ^
annotation.c:132:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     void *data = annotation->data;
     ^
annotation.c: In function ‘cypher_astnode_get_annotation’:
annotation.c:145:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     struct cypher_astnode_annotation *annotation = find_annotation(
     ^
annotation.c: In function ‘find_annotation’:
annotation.c:159:5: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
     // search using the astnode as it will typically have less items
     ^
annotation.c:159:5: warning: (this will be reported only once per input file) [enabled by default]
annotation.c: In function ‘attach_annotation_to_astnode’:
annotation.c:175:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     cypher_astnode_t *astnode = (cypher_astnode_t *)(uintptr_t)node;
     ^
annotation.c: In function ‘cp_release_annotation’:
annotation.c:249:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     cypher_ast_annotation_context_t *context = annotation->context;
     ^
make[4]: *** [libcypher_parser_la-annotation.lo] Error 1
make[4]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib/src'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser/lib'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/deps/libcypher-parser'
make[1]: *** [../deps/libcypher-parser/lib/src/.libs/libcypher-parser.a] Error 2
make[1]: Leaving directory `/data/iarriagada/devel/redis/RedisGraph/src'
make: *** [all] Error 2

Currently, at the Gemini Observatory, all our productions machines run on Centos7, so I need to compile RedisGraph in centos for a prototype application.
Thanks in advance for your help!

(The Gemini Observatory? I want to unofficially note that that's awesome.)

The two failures are in two dependent libraries (rax and libcypher-parser), which may not be inheriting the CFLAGS set at https://github.com/RedisGraph/RedisGraph/blob/master/src/Makefile#L20 .

As a debug step, you should try directly adding the flag -std=gnu11 to those compile targets:
https://github.com/RedisGraph/RedisGraph/blob/master/src/Makefile#L130
https://github.com/RedisGraph/RedisGraph/blob/master/src/Makefile#L160

I will try to escalate the priority of fixing the Makefile such that CentOS compilation is a single-step process, as this issue seems to repeat itself frequently! Thanks for helping as a test subject.

@iarriagada, @WXY3 please see Dockerfile.centos
as a reference to building RedisGraph on CentOS

Thanks @swilly22 and @jeffreylovitz, I'll try this out and get back to you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WitchsCat picture WitchsCat  Â·  10Comments

dandago picture dandago  Â·  3Comments

swilly22 picture swilly22  Â·  8Comments

dandago picture dandago  Â·  3Comments

Sceat picture Sceat  Â·  5Comments