arkhipov / temporal_tables

Temporal Tables PostgreSQL Extension
BSD 2-Clause "Simplified" License
927 stars 46 forks source link

Create Extension gives "undefined symbol: oid_hash" #21

Closed jhaeusle closed 7 years ago

jhaeusle commented 8 years ago

I have compiled the extension successfully on a centos7 with postgres-95.

When I try to create the extension, I get the following error:

postgres=# create extension temporal_tables; FEHLER: konnte Bibliothek „/usr/pgsql-9.5/lib/temporal_tables.so“ nicht laden: /usr/pgsql-9.5/lib/temporal_tables.so: undefined symbol: oid_hash

OS: Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

postgres: PostgreSQL 9.5.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit

Best Regards,

jan

arkhipov commented 8 years ago

This is strange, because the last Travis build on 9.5.3 succeeded. Could you please paste the whole make output of a clean build and the compiled so?

jhaeusle commented 8 years ago
[root@localhost temporal_tables]# make
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2   -c -o temporal_tables.o temporal_tables.c
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2   -c -o versioning.o versioning.c
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -shared -o temporal_tables.so temporal_tables.o versioning.o -L/usr/lib64 -Wl,-z,relro   -Wl,--as-needed  
[root@localhost temporal_tables]# make install
/usr/bin/mkdir -p '/usr/lib64/pgsql'
/usr/bin/mkdir -p '/usr/share/pgsql/extension'
/usr/bin/mkdir -p '/usr/share/pgsql/extension'
/usr/bin/mkdir -p '/usr/share/doc/pgsql/extension'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 755  temporal_tables.so '/usr/lib64/pgsql/temporal_tables.so'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./temporal_tables.control '/usr/share/pgsql/extension/'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./temporal_tables--1.1.0.sql ./temporal_tables--1.0.0--1.0.1.sql ./temporal_tables--1.0.1--1.0.2.sql ./temporal_tables--1.0.2--1.1.0.sql  '/usr/share/pgsql/extension/'
/bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/install-sh -c -m 644 ./README.md '/usr/share/doc/pgsql/extension/'

temporal_tables.so.zip

arkhipov commented 8 years ago

Are you sure that /usr/include/pgsql contains valid PostgreSQL headers? Just to check it is not a problem, could you replace oid_hash with uint32_hash in versioning.c and recompile the whole thing (make clean && make)?

jhaeusle commented 8 years ago

[root@localhost temporal_tables]# grep uint32_hash versioning.c ctl.hash = uint32_hash; [root@localhost temporal_tables]# make clean && make rm -f temporal_tables.so libtemporal_tables.a rm -f temporal_tables.o versioning.o rm -rf results/ regression.diffs regression.out tmp_check/ log/ gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o temporal_tables.o temporal_tables.c gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o versioning.o versioning.c versioning.c: In Funktion »init_versioning_hash_table«: versioning.c:1040:13: Fehler: »uint32_hash« nicht deklariert (erste Benutzung in dieser Funktion) ctl.hash = uint32_hash; ^ versioning.c:1040:13: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet make: *\ [versioning.o] Fehler 1

Printout of tree:

[root@localhost temporal_tables]# tree /usr/include/pgsql /usr/include/pgsql ├── informix │   └── esql │   ├── datetime.h │   ├── decimal.h │   └── sqltypes.h ├── internal │   ├── c.h │   ├── libpq │   │   └── pqcomm.h │   ├── libpq-int.h │   ├── port.h │   ├── postgres_fe.h │   └── pqexpbuffer.h └── server ├── access │   ├── attnum.h │   ├── clog.h │   ├── genam.h │   ├── gin.h │   ├── gin_private.h │   ├── gist.h │   ├── gist_private.h │   ├── gistscan.h │   ├── hash.h │   ├── heapam.h │   ├── hio.h │   ├── htup.h │   ├── itup.h │   ├── multixact.h │   ├── nbtree.h │   ├── printtup.h │   ├── reloptions.h │   ├── relscan.h │   ├── rewriteheap.h │   ├── rmgr.h │   ├── sdir.h │   ├── skey.h │   ├── slru.h │   ├── spgist.h │   ├── spgist_private.h │   ├── subtrans.h │   ├── sysattr.h │   ├── transam.h │   ├── tupconvert.h │   ├── tupdesc.h │   ├── tupmacs.h │   ├── tuptoaster.h │   ├── twophase.h │   ├── twophase_rmgr.h │   ├── valid.h │   ├── visibilitymap.h │   ├── xact.h │   ├── xlogdefs.h │   ├── xlog.h │   ├── xlog_internal.h │   └── xlogutils.h ├── bootstrap │   └── bootstrap.h ├── catalog │   ├── catalog.h │   ├── catversion.h │   ├── dependency.h │   ├── genbki.h │   ├── heap.h │   ├── index.h │   ├── indexing.h │   ├── namespace.h │   ├── objectaccess.h │   ├── objectaddress.h │   ├── pg_aggregate.h │   ├── pg_am.h │   ├── pg_amop.h │   ├── pg_amproc.h │   ├── pg_attrdef.h │   ├── pg_attribute.h │   ├── pg_authid.h │   ├── pg_auth_members.h │   ├── pg_cast.h │   ├── pg_class.h │   ├── pg_collation_fn.h │   ├── pg_collation.h │   ├── pg_constraint.h │   ├── pg_control.h │   ├── pg_conversion_fn.h │   ├── pg_conversion.h │   ├── pg_database.h │   ├── pg_db_role_setting.h │   ├── pg_default_acl.h │   ├── pg_depend.h │   ├── pg_description.h │   ├── pg_enum.h │   ├── pg_extension.h │   ├── pg_foreign_data_wrapper.h │   ├── pg_foreign_server.h │   ├── pg_foreign_table.h │   ├── pg_index.h │   ├── pg_inherits_fn.h │   ├── pg_inherits.h │   ├── pg_language.h │   ├── pg_largeobject.h │   ├── pg_largeobject_metadata.h │   ├── pg_namespace.h │   ├── pg_opclass.h │   ├── pg_operator.h │   ├── pg_opfamily.h │   ├── pg_pltemplate.h │   ├── pg_proc_fn.h │   ├── pg_proc.h │   ├── pg_range.h │   ├── pg_rewrite.h │   ├── pg_seclabel.h │   ├── pg_shdepend.h │   ├── pg_shdescription.h │   ├── pg_shseclabel.h │   ├── pg_statistic.h │   ├── pg_tablespace.h │   ├── pg_trigger.h │   ├── pg_ts_config.h │   ├── pg_ts_config_map.h │   ├── pg_ts_dict.h │   ├── pg_ts_parser.h │   ├── pg_ts_template.h │   ├── pg_type_fn.h │   ├── pg_type.h │   ├── pg_user_mapping.h │   ├── schemapg.h │   ├── storage.h │   └── toasting.h ├── c.h ├── commands │   ├── alter.h │   ├── async.h │   ├── cluster.h │   ├── collationcmds.h │   ├── comment.h │   ├── conversioncmds.h │   ├── copy.h │   ├── createas.h │   ├── dbcommands.h │   ├── defrem.h │   ├── discard.h │   ├── explain.h │   ├── extension.h │   ├── lockcmds.h │   ├── portalcmds.h │   ├── prepare.h │   ├── proclang.h │   ├── schemacmds.h │   ├── seclabel.h │   ├── sequence.h │   ├── tablecmds.h │   ├── tablespace.h │   ├── trigger.h │   ├── typecmds.h │   ├── user.h │   ├── vacuum.h │   ├── variable.h │   └── view.h ├── datatype │   └── timestamp.h ├── dynloader.h ├── executor │   ├── execdebug.h │   ├── execdesc.h │   ├── executor.h │   ├── functions.h │   ├── hashjoin.h │   ├── instrument.h │   ├── nodeAgg.h │   ├── nodeAppend.h │   ├── nodeBitmapAnd.h │   ├── nodeBitmapHeapscan.h │   ├── nodeBitmapIndexscan.h │   ├── nodeBitmapOr.h │   ├── nodeCtescan.h │   ├── nodeForeignscan.h │   ├── nodeFunctionscan.h │   ├── nodeGroup.h │   ├── nodeHash.h │   ├── nodeHashjoin.h │   ├── nodeIndexonlyscan.h │   ├── nodeIndexscan.h │   ├── nodeLimit.h │   ├── nodeLockRows.h │   ├── nodeMaterial.h │   ├── nodeMergeAppend.h │   ├── nodeMergejoin.h │   ├── nodeModifyTable.h │   ├── nodeNestloop.h │   ├── nodeRecursiveunion.h │   ├── nodeResult.h │   ├── nodeSeqscan.h │   ├── nodeSetOp.h │   ├── nodeSort.h │   ├── nodeSubplan.h │   ├── nodeSubqueryscan.h │   ├── nodeTidscan.h │   ├── nodeUnique.h │   ├── nodeValuesscan.h │   ├── nodeWindowAgg.h │   ├── nodeWorktablescan.h │   ├── spi.h │   ├── spi_priv.h │   ├── tstoreReceiver.h │   └── tuptable.h ├── fmgr.h ├── foreign │   ├── fdwapi.h │   └── foreign.h ├── funcapi.h ├── getaddrinfo.h ├── getopt_long.h ├── lib │   ├── dllist.h │   └── stringinfo.h ├── libpq │   ├── auth.h │   ├── be-fsstubs.h │   ├── crypt.h │   ├── hba.h │   ├── ip.h │   ├── libpq-be.h │   ├── libpq-fs.h │   ├── libpq.h │   ├── md5.h │   ├── pqcomm.h │   ├── pqformat.h │   └── pqsignal.h ├── mb │   └── pg_wchar.h ├── miscadmin.h ├── nodes │   ├── bitmapset.h │   ├── execnodes.h │   ├── makefuncs.h │   ├── memnodes.h │   ├── nodeFuncs.h │   ├── nodes.h │   ├── params.h │   ├── parsenodes.h │   ├── pg_list.h │   ├── plannodes.h │   ├── primnodes.h │   ├── print.h │   ├── readfuncs.h │   ├── relation.h │   ├── replnodes.h │   ├── tidbitmap.h │   └── value.h ├── optimizer │   ├── clauses.h │   ├── cost.h │   ├── geqo_copy.h │   ├── geqo_gene.h │   ├── geqo.h │   ├── geqo_misc.h │   ├── geqo_mutation.h │   ├── geqo_pool.h │   ├── geqo_random.h │   ├── geqo_recombination.h │   ├── geqo_selection.h │   ├── joininfo.h │   ├── pathnode.h │   ├── paths.h │   ├── placeholder.h │   ├── plancat.h │   ├── planmain.h │   ├── planner.h │   ├── predtest.h │   ├── prep.h │   ├── restrictinfo.h │   ├── subselect.h │   ├── tlist.h │   └── var.h ├── parser │   ├── analyze.h │   ├── gram.h │   ├── gramparse.h │   ├── keywords.h │   ├── kwlist.h │   ├── parse_agg.h │   ├── parse_clause.h │   ├── parse_coerce.h │   ├── parse_collate.h │   ├── parse_cte.h │   ├── parse_expr.h │   ├── parse_func.h │   ├── parse_node.h │   ├── parse_oper.h │   ├── parse_param.h │   ├── parse_relation.h │   ├── parser.h │   ├── parse_target.h │   ├── parsetree.h │   ├── parse_type.h │   ├── parse_utilcmd.h │   ├── scanner.h │   └── scansup.h ├── pg_config.h ├── pg_config_manual.h ├── pg_config_os.h ├── pg_config_x86_64.h ├── pgstat.h ├── pgtar.h ├── pgtime.h ├── pg_trace.h ├── plpgsql.h ├── port │   ├── aix.h │   ├── cygwin.h │   ├── darwin.h │   ├── freebsd.h │   ├── hpux.h │   ├── irix.h │   ├── linux.h │   ├── netbsd.h │   ├── openbsd.h │   ├── osf.h │   ├── sco.h │   ├── solaris.h │   ├── unixware.h │   ├── win32 │   │   ├── arpa │   │   │   └── inet.h │   │   ├── dlfcn.h │   │   ├── grp.h │   │   ├── netdb.h │   │   ├── netinet │   │   │   └── in.h │   │   ├── pwd.h │   │   └── sys │   │   ├── socket.h │   │   └── wait.h │   ├── win32.h │   └── win32_msvc │   ├── dirent.h │   ├── sys │   │   ├── file.h │   │   ├── param.h │   │   └── time.h │   ├── unistd.h │   └── utime.h ├── portability │   └── instr_time.h ├── port.h ├── postgres_ext.h ├── postgres_fe.h ├── postgres.h ├── postmaster │   ├── autovacuum.h │   ├── bgwriter.h │   ├── fork_process.h │   ├── pgarch.h │   ├── postmaster.h │   ├── startup.h │   ├── syslogger.h │   └── walwriter.h ├── regex │   ├── regcustom.h │   ├── regerrs.h │   ├── regex.h │   └── regguts.h ├── replication │   ├── basebackup.h │   ├── syncrep.h │   ├── walprotocol.h │   ├── walreceiver.h │   ├── walsender.h │   └── walsender_private.h ├── rewrite │   ├── prs2lock.h │   ├── rewriteDefine.h │   ├── rewriteHandler.h │   ├── rewriteManip.h │   ├── rewriteRemove.h │   └── rewriteSupport.h ├── rusagestub.h ├── snowball │   ├── header.h │   └── libstemmer │   ├── api.h │   ├── header.h │   ├── stem_ISO_8859_1_danish.h │   ├── stem_ISO_8859_1_dutch.h │   ├── stem_ISO_8859_1_english.h │   ├── stem_ISO_8859_1_finnish.h │   ├── stem_ISO_8859_1_french.h │   ├── stem_ISO_8859_1_german.h │   ├── stem_ISO_8859_1_hungarian.h │   ├── stem_ISO_8859_1_italian.h │   ├── stem_ISO_8859_1_norwegian.h │   ├── stem_ISO_8859_1_porter.h │   ├── stem_ISO_8859_1_portuguese.h │   ├── stem_ISO_8859_1_spanish.h │   ├── stem_ISO_8859_1_swedish.h │   ├── stem_ISO_8859_2_romanian.h │   ├── stem_KOI8_R_russian.h │   ├── stem_UTF_8_danish.h │   ├── stem_UTF_8_dutch.h │   ├── stem_UTF_8_english.h │   ├── stem_UTF_8_finnish.h │   ├── stem_UTF_8_french.h │   ├── stem_UTF_8_german.h │   ├── stem_UTF_8_hungarian.h │   ├── stem_UTF_8_italian.h │   ├── stem_UTF_8_norwegian.h │   ├── stem_UTF_8_porter.h │   ├── stem_UTF_8_portuguese.h │   ├── stem_UTF_8_romanian.h │   ├── stem_UTF_8_russian.h │   ├── stem_UTF_8_spanish.h │   ├── stem_UTF_8_swedish.h │   └── stem_UTF_8_turkish.h ├── storage │   ├── backendid.h │   ├── barrier.h │   ├── block.h │   ├── buffile.h │   ├── buf.h │   ├── buf_internals.h │   ├── bufmgr.h │   ├── bufpage.h │   ├── copydir.h │   ├── fd.h │   ├── freespace.h │   ├── fsm_internals.h │   ├── indexfsm.h │   ├── ipc.h │   ├── item.h │   ├── itemid.h │   ├── itemptr.h │   ├── large_object.h │   ├── latch.h │   ├── lmgr.h │   ├── lock.h │   ├── lwlock.h │   ├── off.h │   ├── pg_sema.h │   ├── pg_shmem.h │   ├── pmsignal.h │   ├── pos.h │   ├── predicate.h │   ├── predicate_internals.h │   ├── procarray.h │   ├── proc.h │   ├── procsignal.h │   ├── reinit.h │   ├── relfilenode.h │   ├── shmem.h │   ├── sinvaladt.h │   ├── sinval.h │   ├── s_lock.h │   ├── smgr.h │   ├── spin.h │   └── standby.h ├── tcop │   ├── dest.h │   ├── fastpath.h │   ├── pquery.h │   ├── tcopdebug.h │   ├── tcopprot.h │   └── utility.h ├── tsearch │   ├── dicts │   │   ├── regis.h │   │   └── spell.h │   ├── ts_cache.h │   ├── ts_locale.h │   ├── ts_public.h │   ├── ts_type.h │   └── ts_utils.h ├── utils │   ├── acl.h │   ├── array.h │   ├── ascii.h │   ├── attoptcache.h │   ├── builtins.h │   ├── bytea.h │   ├── cash.h │   ├── catcache.h │   ├── combocid.h │   ├── date.h │   ├── datetime.h │   ├── datum.h │   ├── dynahash.h │   ├── dynamic_loader.h │   ├── elog.h │   ├── errcodes.h │   ├── fmgroids.h │   ├── fmgrtab.h │   ├── formatting.h │   ├── geo_decls.h │   ├── guc.h │   ├── guc_tables.h │   ├── help_config.h │   ├── hsearch.h │   ├── inet.h │   ├── int8.h │   ├── inval.h │   ├── json.h │   ├── logtape.h │   ├── lsyscache.h │   ├── memutils.h │   ├── nabstime.h │   ├── numeric.h │   ├── palloc.h │   ├── pg_crc.h │   ├── pg_crc_tables.h │   ├── pg_locale.h │   ├── pg_lzcompress.h │   ├── pg_rusage.h │   ├── plancache.h │   ├── portal.h │   ├── probes.h │   ├── ps_status.h │   ├── rangetypes.h │   ├── rbtree.h │   ├── relcache.h │   ├── rel.h │   ├── relmapper.h │   ├── reltrigger.h │   ├── resowner.h │   ├── selfuncs.h │   ├── snapmgr.h │   ├── snapshot.h │   ├── sortsupport.h │   ├── spccache.h │   ├── syscache.h │   ├── timestamp.h │   ├── tqual.h │   ├── tuplesort.h │   ├── tuplestore.h │   ├── typcache.h │   ├── tzparser.h │   ├── uuid.h │   ├── varbit.h │   └── xml.h └── windowapi.h

arkhipov commented 8 years ago

Oops. I forgot to say that you should also add #include <utils/hsearch.h> in versioning.c.

jhaeusle commented 8 years ago

Hi Vlad,

I'm sorry but it still doesn't work. Maybe I screwed something different.

[root@localhost temporal_tables]# grep -ri uint32_hash versioning.c ctl.hash = uint32_hash; [root@localhost temporal_tables]# grep -ri hsearch versioning.c

include <utils/hsearch.h>

[root@localhost temporal_tables]# make clean && make rm -f temporal_tables.so libtemporal_tables.a rm -f temporal_tables.o versioning.o rm -rf results/ regression.diffs regression.out tmp_check/ log/ gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o temporal_tables.o temporal_tables.c gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o versioning.o versioning.c versioning.c: In Funktion »init_versioning_hash_table«: versioning.c:1041:13: Fehler: »uint32_hash« nicht deklariert (erste Benutzung in dieser Funktion) ctl.hash = uint32_hash; ^ versioning.c:1041:13: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet make: *\ [versioning.o] Fehler 1

versioning.zip

arkhipov commented 7 years ago

Sorry, I have not been here for some time. Have you managed to resolve the issue?

arkhipov commented 7 years ago

This should be fixed by 3aaae52b8071921e3619480011b28103af92f638

arora2atul commented 1 year ago

Its still an issue. I know its been years but any pointers.