RedisLabs/memtier_benchmark

Error reported when executing command 'make'

Penguin-zlh opened this issue · 8 comments

I want to install memtier_benchmark. Command like that:

yum install -y autoconf automake make gcc-c++ git
yum install -y pcre-devel zlib-devel libmemcached-devel openssl-devel libevent-devel
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
git clone https://github.com/RedisLabs/memtier_benchmark.git
cd memtier_benchmark/
autoreconf -ivf
./configure
make
make install

But, when i execute command 'make', i get the error:

[root@controller-node-1 memtier_benchmark]# make
make  all-am
make[1]: Entering directory `/root/memtier_benchmark'
  CXX      memtier_benchmark-memtier_benchmark.o
memtier_benchmark.cpp:887:21: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
                     while (tls_token != nullptr) {
                     ^
memtier_benchmark.cpp: In function ‘int config_parse_args(int, char**, benchmark_config*)’:
memtier_benchmark.cpp:887:41: error: ‘nullptr’ was not declared in this scope
                     while (tls_token != nullptr) {
                                         ^
In file included from memtier_benchmark.cpp:39:0:
memtier_benchmark.cpp: In function ‘int main(int, char**)’:
memtier_benchmark.cpp:1367:50: error: ‘SSL_OP_NO_TLSv1_3’ was not declared in this scope
             SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_3);
                                                  ^
make[1]: *** [memtier_benchmark-memtier_benchmark.o] Error 1
make[1]: Leaving directory `/root/memtier_benchmark'
make: *** [all] Error 2

Hi @Penguin-zlh , Which version are you trying to build?

Hi @Penguin-zlh , Which version are you trying to build?
I think it is the latest vesion.

I used the command git clone https://github.com/RedisLabs/memtier_benchmark.git to pull the latest code first, and then executed the command make. You can take a look at the execution steps in my issue description.

Whether it is caused by this PR? #234

@Penguin-zlh can you check if #236 will fix your issue?

@filipecosta90 After modifying the code and excuting the command make, only the following error exists:

[root@controller-node-1 memtier_benchmark]# make
make  all-am
make[1]: Entering directory `/root/memtier_benchmark'
  CXX      memtier_benchmark-memtier_benchmark.o
In file included from memtier_benchmark.cpp:39:0:
memtier_benchmark.cpp: In function ‘int main(int, char**)’:
memtier_benchmark.cpp:1367:50: error: ‘SSL_OP_NO_TLSv1_3’ was not declared in this scope
             SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_3);
                                                  ^
make[1]: *** [memtier_benchmark-memtier_benchmark.o] Error 1
make[1]: Leaving directory `/root/memtier_benchmark'
make: *** [all] Error 2

I'm reopening given PR #236 only fixed one of the errors.
I'll add a PR to address:

In file included from memtier_benchmark.cpp:39:0:
memtier_benchmark.cpp: In function ‘int main(int, char**)’:
memtier_benchmark.cpp:1367:50: error: ‘SSL_OP_NO_TLSv1_3’ was not declared in this scope
             SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_3);
                                                  ^
make[1]: *** [memtier_benchmark-memtier_benchmark.o] Error 1
make[1]: Leaving directory `/root/memtier_benchmark'
make: *** [all] Error 2

I've confirmed we can reproduce this error as follows:

brew install rbenv/tap/openssl@1.0
autoreconf -ivf
PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.0/lib/pkgconfig" ./configure
make

error:

(base) fco@fcos-Air memtier_benchmark % make
make  all-am
make[1]: Entering directory '/Users/fco/redislabs/memtier_benchmark'
  CXX      memtier_benchmark-memtier_benchmark.o
memtier_benchmark.cpp:328:16: warning: variable 'ignore' set but not used [-Wunused-but-set-variable]
        size_t ignore = fread(&R, sizeof(R), 1, f);
               ^
memtier_benchmark.cpp:1396:50: error: use of undeclared identifier 'SSL_OP_NO_TLSv1_3'
            SSL_CTX_set_options(cfg.openssl_ctx, SSL_OP_NO_TLSv1_3);
                                                 ^
1 warning and 1 error generated.
make[1]: *** [Makefile:751: memtier_benchmark-memtier_benchmark.o] Error 1
make[1]: Leaving directory '/Users/fco/redislabs/memtier_benchmark'
make: *** [Makefile:492: all] Error 2

@Penguin-zlh please confirm that with the current master, the issue is fixed. We've added tests to cover openssl v1.0, v1.1 and v3.0

I use the latest master code, when i execute command 'make', i get the error:

config.status: creating config.h
config.status: executing depfiles commands
[root@cluster-201-master1 memtier_benchmark]# make
make  all-am
make[1]: Entering directory `/root/memtier_benchmark'
  CXX      memtier_benchmark-memtier_benchmark.o
memtier_benchmark.cpp:1265:13: warning: ‘void __openssl_locking_callback(int, int, const char*, int)’ defined but not used [-Wunused-function]
 static void __openssl_locking_callback(int mode, int type, const char *file, int line)
             ^
memtier_benchmark.cpp:1274:22: warning: ‘long unsigned int __openssl_thread_id()’ defined but not used [-Wunused-function]
 static unsigned long __openssl_thread_id(void)
                      ^
  CXX      memtier_benchmark-client.o
  CXX      memtier_benchmark-cluster_client.o
  CXX      memtier_benchmark-shard_connection.o
  CXX      memtier_benchmark-run_stats_types.o
  CXX      memtier_benchmark-run_stats.o
  CXX      memtier_benchmark-JSON_handler.o
  CXX      memtier_benchmark-protocol.o
  CXX      memtier_benchmark-obj_gen.o
  CXX      memtier_benchmark-item.o
  CXX      memtier_benchmark-file_io.o
  CXX      memtier_benchmark-config_types.o
  CC       deps/hdr_histogram/memtier_benchmark-hdr_histogram_log.o
  CC       deps/hdr_histogram/memtier_benchmark-hdr_histogram.o
  CC       deps/hdr_histogram/memtier_benchmark-hdr_time.o
  CC       deps/hdr_histogram/memtier_benchmark-hdr_encoding.o
  CXXLD    memtier_benchmark
memtier_benchmark-memtier_benchmark.o: In function `init_openssl':
/root/memtier_benchmark/memtier_benchmark.cpp:1311: undefined reference to `OPENSSL_init_ssl'
/root/memtier_benchmark/memtier_benchmark.cpp:1312: undefined reference to `OPENSSL_init_ssl'
/root/memtier_benchmark/memtier_benchmark.cpp:1322: undefined reference to `OPENSSL_init_crypto'
memtier_benchmark-memtier_benchmark.o: In function `main':
/root/memtier_benchmark/memtier_benchmark.cpp:1386: undefined reference to `TLS_client_method'
/root/memtier_benchmark/memtier_benchmark.cpp:1387: undefined reference to `SSL_CTX_set_options'
/root/memtier_benchmark/memtier_benchmark.cpp:1398: undefined reference to `SSL_CTX_set_options'
/root/memtier_benchmark/memtier_benchmark.cpp:1394: undefined reference to `SSL_CTX_set_options'
/root/memtier_benchmark/memtier_benchmark.cpp:1392: undefined reference to `SSL_CTX_set_options'
/root/memtier_benchmark/memtier_benchmark.cpp:1390: undefined reference to `SSL_CTX_set_options'
collect2: error: ld returned 1 exit status
make[1]: *** [memtier_benchmark] Error 1
make[1]: Leaving directory `/root/memtier_benchmark'
make: *** [all] Error 2

ps:

when i execute ./configure, it says libevent_openssl >= 2.0.10. Therefore, I manually installed version 2.0.12
image