Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: json_integer #3

Open
shahin opened this issue Jun 9, 2016 · 1 comment
Open

undefined symbol: json_integer #3

shahin opened this issue Jun 9, 2016 · 1 comment

Comments

@shahin
Copy link

shahin commented Jun 9, 2016

On a single-node system on Ubuntu, the json_formatter builds:

gpadmin@b1aca52479a3:~/greenplum-json-formatter$ make
cc -fpic -Wall -I/usr/local/gpdb/include -I/usr/local/gpdb/include/postgresql/internal -I/usr/local/gpdb/include/postgresql/server -I/usr/local/gpdb/include/jansson   -c src/json_formatter.c -o lib/json_formatter.o
src/json_formatter.c: In function 'json_formatter_write':
src/json_formatter.c:409:38: warning: variable 'tofree' set but not used [-Wunused-but-set-variable]
             char        *dbcolname, *tofree;
                                      ^
cc -L/usr/local/gpdb/lib -L/usr/local/gpdb/lib/postgresql -ljansson  -Wall -shared -Wextra -g  -o lib/json_formatter.so lib/json_formatter.o
gpadmin@b1aca52479a3:~/greenplum-json-formatter$

But Greenplum complains that it can't find json_integer on loading the shared library:

gpadmin@b1aca52479a3:~/greenplum-json-formatter$ make install
test -f lib/json_formatter.so
cp lib/json_formatter.so /usr/local/gpdb/lib/postgresql
psql -f sql/install.sql
psql:sql/install.sql:1: NOTICE:  function json_formatter_read() does not exist, skipping
DROP FUNCTION
psql:sql/install.sql:4: ERROR:  could not load library "/usr/local/gpdb/lib/postgresql/json_formatter.so": /usr/local/gpdb/lib/postgresql/json_formatter.so: undefined symbol: json_integer (dfmgr.c:245)
psql:sql/install.sql:6: NOTICE:  function json_formatter_write(record) does not exist, skipping
DROP FUNCTION
psql:sql/install.sql:9: ERROR:  could not load library "/usr/local/gpdb/lib/postgresql/json_formatter.so": /usr/local/gpdb/lib/postgresql/json_formatter.so: undefined symbol: json_integer (dfmgr.c:245)

I thought I'd already made sure that libjansson is available to Greenplum:

gpadmin@b1aca52479a3:~/greenplum-json-formatter$ echo $LD_LIBRARY_PATH
/usr/local/gpdb/lib:/lib::/usr/local/lib
gpadmin@b1aca52479a3:~/greenplum-json-formatter$ ls -la /usr/local/lib | grep jansson
-rw-r--r--  1 root root  378216 Jun  9 20:57 libjansson.a
-rwxr-xr-x  1 root root     963 Jun  9 20:57 libjansson.la
lrwxrwxrwx  1 root root      19 Jun  9 20:57 libjansson.so -> libjansson.so.4.7.0
lrwxrwxrwx  1 root root      19 Jun  9 20:57 libjansson.so.4 -> libjansson.so.4.7.0
-rwxr-xr-x  1 root root  218528 Jun  9 20:57 libjansson.so.4.7.0

Just to be sure, I've followed your instructions in #1 and copied everything over to Greenplum's lib:

gpadmin@b1aca52479a3:~/greenplum-json-formatter$ ls -la /usr/local/gpdb/lib/postgresql/ | grep json_formatter
-rwxrwxr-x  1 gpadmin gpadmin   27136 Jun  9 20:58 json_formatter.so
gpadmin@b1aca52479a3:~/greenplum-json-formatter$ ls -la /usr/local/gpdb/lib/postgresql/ | grep jansson       
-rw-r--r--  1 gpadmin gpadmin  378216 Jun  9 19:50 libjansson.a
-rwxr-xr-x  1 gpadmin gpadmin     963 Jun  9 19:50 libjansson.la
-rwxr-xr-x  1 gpadmin gpadmin  218528 Jun  9 19:50 libjansson.so
-rwxr-xr-x  1 gpadmin gpadmin  218528 Jun  9 19:50 libjansson.so.4
-rwxr-xr-x  1 gpadmin gpadmin  218528 Jun  9 19:50 libjansson.so.4.7.0

No dice! Any idea why json_integer can't be found?

@nurikk
Copy link
Contributor

nurikk commented Aug 3, 2016

which version of janson lib you using? with 2.6.1 everything is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants