wingunder / redis-plus-plus-modules

This library aims to supply a C++ interface to all major/popular Redis modules.
Other
15 stars 3 forks source link

Can't build it. #2

Closed charlesone closed 2 years ago

charlesone commented 3 years ago

I have a work email I can share privately, if you wish to ask questions ...

Doing a make, got missing CMakeLists.txt. The contained directory redis-plus-plus directory has a CMakeLists.txt, the contained directories hiredis and redis-plus-plus-modules do not have a CMakeLists.txt file. The contained directory (being complained about in the error text) build-redis-plus-plus is empty !

Redis, HiRedis and redis-plus-plus recently installed and all tests available ran successfully. Centos-7 on a an HPE dl380.

[charlie@hpdl380 redis-plus-plus-modules]$ cmake --version cmake version 3.9.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

[charlie@hpdl380 redis-plus-plus-modules]$ ./bootstrap.sh configure.ac:6: installing './ar-lib' configure.ac:3: installing './compile' configure.ac:2: installing './install-sh' configure.ac:2: installing './missing' test/Makefile.am: installing './depcomp' Submodule 'hiredis' (https://github.com/redis/hiredis.git) registered for path 'hiredis' Submodule 'redis-plus-plus' (https://github.com/sewenew/redis-plus-plus.git) registered for path 'redis-plus-plus' Cloning into '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/hiredis'... Cloning into '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/redis-plus-plus'... Submodule path 'hiredis': checked out 'dfa33e60b07c13328133a16065d88d171a2a61d4' Submodule path 'redis-plus-plus': checked out 'b4356ff1011d71ad315290bc8ea928ed8452eaac' [charlie@hpdl380 redis-plus-plus-modules]$ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for ranlib... ranlib checking for ar... ar checking the archiver (ar) interface... ar checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating test/Makefile config.status: creating config.h config.status: executing depfiles commands [charlie@hpdl380 redis-plus-plus-modules]$ make -j8 (CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /GlobalHome/charlie/Projects/redis-plus-plus-modules/missing autoheader) mkdir -p build-redis-plus-plus PREFIX=.. make -C hiredis install make[1]: Entering directory /mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/hiredis' cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb alloc.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb net.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb hiredis.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb sds.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb async.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb read.c cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb sockcompat.c Generating hiredis.pc for pkgconfig... rm -f stamp-h1 touch config.h.in cd . && /bin/sh ./config.status config.h config.status: creating config.h config.status: config.h is unchanged cc -shared -Wl,-soname,libhiredis.so.1.0.1-dev -o libhiredis.so alloc.o net.o hiredis.o sds.o async.o read.o sockcompat.o ar rcs libhiredis.a alloc.o net.o hiredis.o sds.o async.o read.o sockcompat.o mkdir -p ../include/hiredis ../include/hiredis/adapters ../lib cp -pPR hiredis.h async.h read.h sds.h alloc.h ../include/hiredis cp -pPR adapters/*.h ../include/hiredis/adapters cp -pPR libhiredis.so ../lib/libhiredis.so.1.0.1-dev cd ../lib && ln -sf libhiredis.so.1.0.1-dev libhiredis.so cp -pPR libhiredis.a ../lib mkdir -p ../lib/pkgconfig cp -pPR hiredis.pc ../lib/pkgconfig make[1]: Leaving directory/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/hiredis' touch lib/libhiredis.so cmake -DCMAKE_SYSTEM_PREFIX_PATH=. -DCMAKE_INSTALL_PREFIX=. -DHIREDIS_HEADER=include -DHIREDIS_LIB=lib/libhiredis.so -S redis-plus-plus -B build-redis-plus-plus CMake Error: The source directory "/GlobalHome/charlie/Projects/redis-plus-plus-modules/build-redis-plus-plus" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. make: *** [build-redis-plus-plus/Makefile] Error 1

wingunder commented 3 years ago

Hi @charlesone

Sorry for the late reply. I see that your cmake version is a bit old (3.9.4). I got hold of an old system with cmake, with version 3.5.1, and got the same problem. Two other systems with cmake version 3.16.3 and 3.18.4 however work without problems. Could you please update your cmake to at least 3.16.3 and try again?

This cmake dependency is actually an upstream problem. The redis-plus-plus library, which redis-plus-plus-modules relies on, gets built with cmake, and it obviously needs a not-too-ancient version of cmake. I can't fix this, as it needs to be fixed in redis-plus-plus, but I think the chances of that happening, is small. The best would be to simply get a newer version of cmake.

Regards

charlesone commented 3 years ago

Yeah, having trouble with that. Buildling CMake after 3.9.4 on a mounted NFS (/mnt/.../ == /GlobalHome/) is not possible, gives an incredibly undiagnosable error:

CMake Error at CMakeLists.txt:107 (message):
  The C++ compiler does not support C++11 (e.g.  std::unique_ptr).

So, can't build it in /opt, not enough memory, have to build in a /home directory on the local file system. The nice thing about NFS if you have dozens of nodes available from kickstart or some provisioning, you can make once and sudo make install dozens of times. Uggh. CMake is crap! This problem has been around for the best part of a decade, all the large institutions work with mounted NFS, not on single node development. Anyway, that will do it. Back to gnu automake, that is actually supported in all the development environments!

charlesone commented 3 years ago

Got the correct version (3.16.6) of CMake to build and test at /home/charlie then got redis-plus-plus-modules to build and tried to run tests, got this from the end of build:

Install the project...
-- Install configuration: "Release"
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/libredis++.a
-- Installing: /GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/libredis++.so.1.2.3
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/libredis++.so.1
-- Set runtime path of "/GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/libredis++.so.1.2.3" to ""
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/libredis++.so
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/share/cmake/redis++/redis++-targets.cmake
-- Installing: /GlobalHome/charlie/Projects/redis-plus-plus-modules/share/cmake/redis++/redis++-targets-release.cmake
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/command.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/command_args.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/command_options.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/connection.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/connection_pool.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/errors.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/tls.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/pipeline.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/queued_redis.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/queued_redis.hpp
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/redis++.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/redis.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/redis.hpp
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/redis_cluster.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/redis_cluster.hpp
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/reply.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/sentinel.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/shards.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/shards_pool.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/subscriber.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/transaction.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/include/sw/redis++/utils.h
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/share/cmake/redis++/redis++-config.cmake
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/share/cmake/redis++/redis++-config-version.cmake
-- Up-to-date: /GlobalHome/charlie/Projects/redis-plus-plus-modules/lib/pkgconfig/redis++.pc
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/build-redis-plus-plus'
touch lib/libredis++.so
make  all-recursive
make[1]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
Making all in test
make[2]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
g++ -DHAVE_CONFIG_H -I. -I..    -I../include -g -O2 -MT test_redismodules-test_main.o -MD -MP -MF .deps/test_redismodules-test_main.Tpo -c -o test_redismodules-test_main.o `test -f 'test_main.cpp' || echo './'`test_main.cpp
mv -f .deps/test_redismodules-test_main.Tpo .deps/test_redismodules-test_main.Po
g++ -I../include -g -O2   -o test_redismodules test_redismodules-test_main.o -L../lib -lredis++ -lhiredis -lpthread 
make[2]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[2]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
make[2]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
[charlie@hpdl380 redis-plus-plus-modules]$ ll
total 808
-rw-r--r--. 1 charlie users  43911 Oct 21 17:29 aclocal.m4
-rwxr-xr-x. 1 charlie users   5826 Oct 21 17:29 ar-lib
-rw-r--r--. 1 charlie users     13 Oct 21 17:27 AUTHORS
drwxr-xr-x. 2 charlie users   4096 Oct 26 14:21 autom4te.cache
-rwxr-xr-x. 1 charlie users     72 Oct 21 17:27 bootstrap.sh
drwxr-xr-x. 5 charlie users   4096 Oct 26 14:23 build-redis-plus-plus
-rw-r--r--. 1 charlie users     13 Oct 21 17:27 ChangeLog
-rw-r--r--. 1 charlie users   5493 Oct 21 17:27 CODE_OF_CONDUCT.md
-rwxr-xr-x. 1 charlie users   7333 Oct 21 17:29 compile
-rw-r--r--. 1 charlie users    854 Oct 21 17:29 config.h
-rw-r--r--. 1 charlie users    625 Oct 21 17:30 config.h.in
-rw-r--r--. 1 charlie users  12631 Oct 26 14:21 config.log
-rwxr-xr-x. 1 charlie users  33143 Oct 26 14:21 config.status
-rwxr-xr-x. 1 charlie users 166335 Oct 26 14:21 configure
-rw-r--r--. 1 charlie users    269 Oct 21 17:27 configure.ac
lrwxrwxrwx. 1 charlie users     15 Oct 21 17:27 COPYING -> LICENSE-2.0.txt
-rwxr-xr-x. 1 charlie users  23566 Oct 21 17:29 depcomp
-rw-r--r--. 1 charlie users    786 Oct 21 17:27 docker-compose.yml
-rw-r--r--. 1 charlie users    285 Oct 21 17:27 Dockerfile
drwxr-xr-x. 2 charlie users   4096 Oct 21 17:27 docs
-rw-r--r--. 1 charlie users 116391 Oct 21 17:27 Doxyfile
drwxr-xr-x. 4 charlie users   4096 Oct 21 17:27 examples
drwxr-xr-x. 5 charlie users   4096 Oct 21 17:30 hiredis
drwxr-xr-x. 2 charlie users   4096 Oct 21 17:27 images
drwxr-xr-x. 5 charlie users   4096 Oct 26 14:22 include
-rw-r--r--. 1 charlie users  15756 Oct 21 17:27 INSTALL
-rwxr-xr-x. 1 charlie users  13997 Oct 21 17:29 install-sh
drwxr-xr-x. 3 charlie users   4096 Oct 26 14:23 lib
lrwxrwxrwx. 1 charlie users     15 Oct 21 17:27 LICENSE -> LICENSE-2.0.txt
-rw-r--r--. 1 charlie users  11358 Oct 21 17:27 LICENSE-2.0.txt
-rw-r--r--. 1 charlie users  25415 Oct 26 14:21 Makefile
-rw-r--r--. 1 charlie users    839 Oct 21 17:27 Makefile.am
-rw-r--r--. 1 charlie users  24936 Oct 26 14:21 Makefile.in
-rw-r--r--. 1 charlie users   1837 Oct 21 17:27 marketplace.json
-rwxr-xr-x. 1 charlie users   6873 Oct 21 17:29 missing
-rw-r--r--. 1 charlie users      0 Oct 21 17:27 NEWS
lrwxrwxrwx. 1 charlie users      9 Oct 21 17:27 README -> README.md
-rw-r--r--. 1 charlie users  11560 Oct 21 17:27 README.md
drwxr-xr-x. 5 charlie users   4096 Oct 21 17:29 redis-plus-plus
drwxr-xr-x. 3 charlie users   4096 Oct 26 14:22 share
-rw-r--r--. 1 charlie users     23 Oct 26 14:21 stamp-h1
drwxr-xr-x. 3 charlie users   4096 Oct 26 14:23 test
[charlie@hpdl380 redis-plus-plus-modules]$ make test
make -C test test_redismodules
make[1]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[1]: 'test_redismodules' is up to date.
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
LD_LIBRARY_PATH=./lib ./test/test_redismodules
Testing Redis...
Skipped RedisBloom tests, as 'bf' module was not loaded.
Skipped RedisJSON tests, as 'ReJSON' module was not loaded.
Passed RedisJSON tests
Skipped RedisGraph tests, as 'graph' module was not loaded.
Passed RedisGraph tests
Passed all tests
[charlie@hpdl380 redis-plus-plus-modules]$ sudo make install
Making install in test
make[1]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[2]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
 /usr/bin/mkdir -p '/usr/local/bin'
  /usr/bin/install -c test_redismodules '/usr/local/bin'
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[1]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
make[2]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules'
[charlie@hpdl380 redis-plus-plus-modules]$ make test
make -C test test_redismodules
make[1]: Entering directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
make[1]: 'test_redismodules' is up to date.
make[1]: Leaving directory '/mnt/GlobalHome/charlie/Projects/redis-plus-plus-modules/test'
LD_LIBRARY_PATH=./lib ./test/test_redismodules
Testing Redis...
Skipped RedisBloom tests, as 'bf' module was not loaded.
Skipped RedisJSON tests, as 'ReJSON' module was not loaded.
Passed RedisJSON tests
Skipped RedisGraph tests, as 'graph' module was not loaded.
Passed RedisGraph tests
Passed all tests
[charlie@hpdl380 redis-plus-plus-modules]$ 

So, doing make test, didn't do anything, either before or after a sudo make install.

wingunder commented 3 years ago

Hi @charlesone

Uggh. CMake is crap! This problem has been around for the best part of a decade, all the large institutions work with mounted NFS, not on single node development. Anyway, that will do it. Back to gnu automake, that is actually supported in all the development environments!

redis-plus-plus-modules uses automake, so no problem. It's redis-plus-plus that requires cmake. redis-plus-plus-modules, however requires redis-plus-plus. It is unfortunate that redis-plus-plus doesn't have the option to build it with automake, but that's the way it is at the moment. Feel free to contact redis-plus-plus and/or make a patch for redis-plus-plus, in order to add this.

So, doing make test, didn't do anything, either before or after a sudo make install.

Note: make install only installs the redis-plus-plus-modules test program! This is not required and deliberately not mentioned in the documentation. The redis-plus-plus-modules lib is a C++ header-only library, so no installation is required. You simply need to include the correct header file, as described in the quickstart. Also look at the stuff in the examples (also described in the quickstart section.)

Testing Redis... Skipped RedisBloom tests, as 'bf' module was not loaded. Skipped RedisJSON tests, as 'ReJSON' module was not loaded. Passed RedisJSON tests Skipped RedisGraph tests, as 'graph' module was not loaded. Passed RedisGraph tests Passed all tests

The 'Skipped' messages state that which redis module was not loaded in your redis server. In order for the tests to be done, you'll have to load those missing redis modules into your redis server. I'm not covering how to load modules into a redis server in this project. There are many examples of how to do this on the Internet. A good starting point would be: https://redis.io/topics/modules-intro

Alternatively you could try using Docker, as I described in the quickstart section. The Docker image contains a redis server with all the required modules, already loaded. You can use this until you've figured out how to load the modules into your own redis server.

I hope this helped. Regards

wingunder commented 2 years ago

Due to the long inactivity and lack of response on this issue, I'm closing it.