Tencent / Tendis

Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
http://tendis.cn
Other
2.92k stars 319 forks source link

make编译时候报文件内部函数语法错误是什么原因,是我git文件有误吗? #267

Open melinetssamant opened 5 months ago

melinetssamant commented 5 months ago

Description

make编译时候报文件内部函数语法错误是什么原因,是我git文件有误吗? 报错具体如下: src/ctl.c:3120:32: error: expected declaration specifiers or ‘...’ before ‘tsd_t experimental_hooks_install_ctl(tsd_t tsd, const size_t mib, size_t miblen, ^~~~~ src/ctl.c:3148:31: error: expected declaration specifiers or ‘...’ before ‘tsd_t experimental_hooks_remove_ctl(tsd_t tsd, const size_t mib, size_t miblen, ^~~~~ src/ctl.c:3231:36: error: expected declaration specifiers or ‘...’ before ‘tsd_t experimental_utilization_query_ctl(tsd_t tsd, const size_t mib, ^~~~~ src/ctl.c:3356:42: error: expected declaration specifiers or ‘...’ before ‘tsd_t experimental_utilization_batch_query_ctl(tsd_t tsd, const size_t mib, ^~~~~ src/ctl.c:3384:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ befor static const ctl_named_node_t ^ src/ctl.c:3401:36: error: expected declaration specifiers or ‘...’ before ‘tsd_t experimental_arenas_i_pactivep_ctl(tsd_t tsd, const size_t mib, ^~~~~ In file included from include/jemalloc/internal/assert.h:1, from include/jemalloc/internal/bit_util.h:4, from include/jemalloc/internal/bitmap.h:5, from include/jemalloc/internal/arena_structs_a.h:4, from include/jemalloc/internal/jemalloc_internal_includes.h:53, from src/ctl.c:3: include/jemalloc/internal/malloc_io.h:54:8: error: old-style parameter declarati size_t malloc_snprintf(char str, size_t size, const char *format, ...) ^~~~~~~ src/ctl.c:3435: error: expected ‘{’ at end of input }

src/ctl.c:3435:1: warning: control reaches end of non-void function [-Wreturn-ty } ^ make[3]: [Makefile:389: src/ctl.sym.o] Error 1 make[3]: Leaving directory '/root/setup/Tendis/src/thirdparty/jemalloc' make[2]: [CMakeFiles/build_jemalloc.dir/build.make:61: ../src/thirdparty/jem make[2]: Leaving directory '/root/setup/Tendis/build' make[1]: [CMakeFiles/Makefile2:746: CMakeFiles/build_jemalloc.dir/all] Error make[1]: Waiting for unfinished jobs.... [ 18%] Linking CXX static library ../../../lib/libsession_ctx.a make[2]: Leaving directory '/root/setup/Tendis/build' [ 18%] Built target session_ctx make[1]: Leaving directory '/root/setup/Tendis/build' make: *** [Makefile:152: all] Error 2

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

raffertyyu commented 5 months ago

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

melinetssamant commented 5 months ago

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

gcc都是8.5.0,版本还低是吗??我看他们都是5.5.0的都编译了,我试试11以上的版本,一会反馈

[root@bcrj-hwkp setup]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/root/setup/gcc-8.5.0/build-gcc/libexec/gcc/aarch64-unknown-linux-gnu/8.5.0/lto-wrapper Target: aarch64-unknown-linux-gnu Configured with: /root/setup/gcc-8.5.0/configure --prefix=/root/setup/gcc-8.5.0/build-gcc -enable-checking=release -enable-languages=c,c++ -disable-multili Thread model: posix gcc version 8.5.0 (GCC) [root@bcrj-hwkp setup]# g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/root/setup/gcc-8.5.0/build-gcc/libexec/gcc/aarch64-unknown-linux-gnu/8.5.0/lto-wrapper Target: aarch64-unknown-linux-gnu Configured with: /root/setup/gcc-8.5.0/configure --prefix=/root/setup/gcc-8.5.0/build-gcc -enable-checking=release -enable-languages=c,c++ -disable-multili Thread model: posix gcc version 8.5.0 (GCC)

melinetssamant commented 5 months ago

看着像是gcc版本较低,推荐安装软件源中提供的,或者自行编译至少11以上版本的gcc编译器进行编译。

已经升级了gcc到13.2.0,cmake已经显示了gcc版本是13.2.0,cmake没有报错,但是make的时候问题依旧,一样的报错 [root@bcrj-hwkp build]# cmake ../ -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done compile optimize with lto pgo_dir: /root/setup/Tendis/pgo

pscxtc commented 4 months ago

想问下,解决了么,我在 arm64 环境下编译 2.7.0 版本,遇到的问题相同 gcc 11.3 g++ 11.3 cmake 3.20 只要编译到 jemalloc 就报错

pscxtc commented 4 months ago

搞定了,是 jemalloc 的问题, 把 源码 src/thirdparty/jemalloc 替换成 jemalloc 5.2.1 的源码,就可以编译通过了

melinetssamant commented 4 months ago

是的,编译的时候有的地方要改一下源码,我记着我也改了几个地方,后期启动也有报错,也是改了几个配置文件,具体可能你那边的环境和我的不一样,可能启动不会有错误

------------------ 原始邮件 ------------------ 发件人: "Tencent/Tendis" @.>; 发送时间: 2024年5月17日(星期五) 上午9:00 @.>; @.**@.>; 主题: Re: [Tencent/Tendis] make编译时候报文件内部函数语法错误是什么原因,是我git文件有误吗? (Issue #267)

搞定了,是 jemalloc 的问题, 把 源码 src/thirdparty/jemalloc 替换成 jemalloc 5.2.1 的源码,就可以编译通过了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>