Tencent / TBase

TBase is an enterprise-level distributed HTAP database. Through a single database cluster to provide users with highly consistent distributed database services and high-performance data warehouse services, a set of integrated enterprise-level solutions is formed.
Other
1.38k stars 261 forks source link

some solutions to share #134

Closed DWmelon closed 2 years ago

DWmelon commented 2 years ago

share some solutions to these problems

problem 1:

cat: ../../src/interfaces/libpq/objfiles.txt: No such file or directory
/usr/bin/ld: access/transam/xact.o: in function `AbortCurrentTransaction':
/home/melon/TBase/src/backend/access/transam/xact.c:4741: undefined reference to `is_ddl_leader_cn'
/usr/bin/ld: tcop/utility.o: in function `ProcessUtilityPre':
/home/melon/TBase/src/backend/tcop/utility.c:905: undefined reference to `is_ddl_leader_cn'
/usr/bin/ld: tcop/utility.o: in function `standard_ProcessUtility':
/home/melon/TBase/src/backend/tcop/utility.c:2294: undefined reference to `is_ddl_leader_cn'
/usr/bin/ld: /home/melon/TBase/src/backend/tcop/utility.c:2487: undefined reference to `is_ddl_leader_cn'
/usr/bin/ld: /home/melon/TBase/src/backend/tcop/utility.c:2499: undefined reference to `is_ddl_leader_cn'
/usr/bin/ld: tcop/utility.o:/home/melon/TBase/src/backend/tcop/utility.c:2853: more undefined references to `is_ddl_leader_cn' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:82: postgres] Error 1
make[1]: *** [Makefile:38: all-backend-recurse] Error 2
make: *** [GNUmakefile:11: all-src-recurse] Error 2

sloved by: src/include/pgxc/pgxcnode.h

inline bool  is_ddl_leader_cn(char *leader_cn);

change to

bool  is_ddl_leader_cn(char *leader_cn);

Problem 2:

/usr/bin/ld: gtm_proxy_opt.o:/home/melon/TBase/src/gtm/proxy/gtm_proxy_opt.c:78: multiple definition of `GTMConfigFileName'; proxy_main.o:/home/melon/TBase/src/gtm/proxy/proxy_main.c:134: first defined here

Sloved by: src/gtm/Makefile

15 | WANTED_DIRS=common path libpq client recovery main proxy gtm_ctl
43 | $(INSTALL_PROGRAM) proxy/gtm_proxy$(X) '$(DESTDIR)$(bindir)/gtm_proxy$(X)'
45 | $(INSTALL_DATA) $(srcdir)/proxy/gtm_proxy.conf.sample '$(DESTDIR)$(datadir)/gtm_proxy.conf.sample'

change to

WANTED_DIRS=common path libpq client recovery main  gtm_ctl
# $(INSTALL_PROGRAM) proxy/gtm_proxy$(X) '$(DESTDIR)$(bindir)/gtm_proxy$(X)'
# $(INSTALL_DATA) $(srcdir)/proxy/gtm_proxy.conf.sample '$(DESTDIR)$(datadir)/gtm_proxy.conf.sample'

problem 3:

/usr/bin/ld: pgxc_ctl.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: variables.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: pgxc_ctl_log.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: do_command.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: utils.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: do_shell.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: gtm_cmd.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: coord_cmd.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: datanode_cmd.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: gtm_util.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here
/usr/bin/ld: monitor.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: multiple definition of `var_hash'; config.o:/home/melon/TBase/contrib/pgxc_ctl/variables.h:47: first defined here

Sloved by: /contrib/pgxc_ctl/variables.h pgxc_var_hash var_hash[NUM_HASH_BUCKET]; change to extern pgxc_var_hash var_hash[NUM_HASH_BUCKET];

DWmelon commented 2 years ago

useful for https://github.com/Tencent/TBase/issues/110

yazun commented 2 years ago

Would be good to see your OS/GCC stack to comment..

zouyonghao commented 1 year ago

This should be merged into the source code.