Ticket #65 (closed defect: fixed)

Opened 13 years ago

Last modified 11 years ago

--with-js needs symbolic link

Reported by: rldhont Owned by: david
Priority: critical Milestone:
Component: zoo-kernel Version:
Keywords: kernel, javascript Cc:

Description

Compilation under : Ubuntu

The ./configure --with-js get the libmozjs.so from xulrunner-2.0 but zoo_loader.cgi searching the libmozjs.so in the /usr/lib instead of /usr/lib/xulrunner-2.0 like in the compilation.

Change History

  Changed 13 years ago by djay

  • owner set to david

The --with-js option should first try to use the libmozjs185-dev Debian package.

David, can you take a quick look at it ? It seems something gone wrong. I didn't get any issue when trying using a debian machine with libmozjs185-dev installed.

follow-up: ↓ 3   Changed 13 years ago by lucadelu

I confirm this defect on Ubuntu 10.04 and xulrunner-devel

./configure --with-js=/usr/lib/xulrunner-devel-1.9.2.22/ --with-python
[CUT]
checking for Python.h... yes
checking for PyObject_CallObject in -lpython2.6... yes
checking for JS_CallFunctionName in -lmozjs... yes
configure: creating ./config.status
config.status: creating Makefile

make zoo_loader.cgi
[CUT]
g++  -I/usr/lib/xulrunner-devel-1.9.2.22//include/ -I/usr/local/include -I/usr/include/libxml2   
 -I/usr/include/python2.6 -I/usr/include/python2.6 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 
-Wall -Wstrict-prototypes  -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE  zoo_loader.o zoo_service_loader.o 
service_internal.o service_internal_python.o       ulinet.o lex.cr.o lex.sr.o service_conf.tab.o 
main_conf_read.tab.o -o zoo_loader.cgi -lcurl -L../thirds/cgic206 -lcgic -lcurl -L/usr/local/lib -lgdal -lxml2 
-L/usr/lib/python2.6/config -lpthread -ldl -lutil -lm -lpython2.6     -L/usr/lib/xulrunner-devel-1.9.2.22//lib 
-lmozjs -lm -lfcgi -lcrypto 
zoo_service_loader.o: In function `loadServiceAndRun(maps**, service*, map*, maps**, maps**, int*)':
/home/pgis/compilati/zoo-project/zoo-kernel/zoo_service_loader.c:336: undefined reference to `zoo_js_support'
service_internal.o: In function `JSUpdateStatus':
service_internal.c:(.text+0x1fc8): undefined reference to `mapsFromJSObject'
collect2: ld returned 1 exit status
make: *** [zoo_loader.cgi] Error 1

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 13 years ago by djay

Replying to lucadelu: I noticed in the provided logs that specific part which doesn't mention service_internal.o but which would:

make zoo_loader.cgi
[CUT]
g++  -I/usr/lib/xulrunner-devel-1.9.2.22//include/ -I/usr/local/include -I/usr/include/libxml2   
 -I/usr/include/python2.6 -I/usr/include/python2.6 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 
-Wall -Wstrict-prototypes  -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE  zoo_loader.o zoo_service_loader.o 
service_internal.o service_internal_python.o       ulinet.o lex.cr.o lex.sr.o service_conf.tab.o 
main_conf_read.tab.o -o zoo_loader.cgi -lcurl -L../thirds/cgic206 -lcgic -lcurl -L/usr/local/lib -lgdal -lxml2 
-L/usr/lib/python2.6/config -lpthread -ldl -lutil -lm -lpython2.6     -L/usr/lib/xulrunner-devel-1.9.2.22//lib 
-lmozjs -lm -lfcgi -lcrypto 

Reading the Makefile.in file confirms that the JS_FILE variable should take the service_internal_js.o value. So I wonder what happened here. Can you provide the Makefile lines containing JS_* from your local setup ?

in reply to: ↑ 3   Changed 13 years ago by lucadelu

Replying to djay:

Reading the Makefile.in file confirms that the JS_FILE variable should take the service_internal_js.o value. So I wonder what happened here. Can you provide the Makefile lines containing JS_* from your local setup ?

JSCFLAGS=
JSLDFLAGS=
JS_ENABLED=
JS_FILE=
        gcc ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c ulinet.c
        gcc ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c
        gcc ${XML2CFLAGS} ${JSCFLAGS} ${CFLAGS} ${JS_ENABLED} -c service_internal_js.c
        g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} 
${PERLCFLAGS} ${PHPCFLAGS} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} 
${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
zoo_loader.cgi: zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o 
service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${PYTHON_FILE}   ${PHP_FILE} 
${JAVA_FILE} ${JS_FILE} ${PERL_FILE}
        g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS}   ${JAVACFLAGS} ${XML2CFLAGS} 
${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
        g++  ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} 
${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${PYTHON_FILE}  
${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o 
main_conf_read.tab.o -o zoo_loader.cgi -lcurl -L../thirds/cgic206 -lcgic -lcurl ${GDAL_LIBS} ${XML2LDFLAGS} 
${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MACOS_LD_FLAGS}

Maybe the solution is set before configure

JS_CPPFLAGS="-I$JSHOME/include/js" --> JS_CPPFLAGS="-I$JSHOME/include"

JS_LDFLAGS="-L$JSHOME/lib -ljs -lm" --> JS_LDFLAGS="-L$JSHOME/lib -lmozjs -lm"

JS_LIB="js" --> JS_LIB="mozjs"

but so the ticket #42 it is to reopen and also the ticket #55 it is not possible to close

follow-ups: ↓ 6 ↓ 20   Changed 13 years ago by david

For ubuntu 10.04

zoo-kernel isn't compatible with xulrunner-1.9, so you need to compile with http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz .

wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar xzf js185-1.0.0.tar.gz cd js-1.8.5/js/src ./configure --prefix=/usr/local make sudo make install sudo ldconfig

cd <zoo-kernel sources> ./configure --with-python --with-js=/usr/local make clean make

in reply to: ↑ 5 ; follow-up: ↓ 7   Changed 13 years ago by david

  • status changed from new to assigned

Replying to david:

For ubuntu 10.04

zoo-kernel isn't compatible with xulrunner-1.9, so you need to compile with http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz .

wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar xzf js185-1.0.0.tar.gz cd js-1.8.5/js/src ./configure --prefix=/usr/local make sudo make install sudo ldconfig

cd <zoo-kernel sources> ./configure --with-python --with-js=/usr/local make clean make

in reply to: ↑ 6   Changed 13 years ago by lucadelu

Replying to david:

Replying to david:

For ubuntu 10.04

zoo-kernel isn't compatible with xulrunner-1.9, so you need to compile with http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz .

wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar xzf js185-1.0.0.tar.gz cd js-1.8.5/js/src ./configure --prefix=/usr/local make sudo make install sudo ldconfig

cd <zoo-kernel sources> ./configure --with-python --with-js=/usr/local make clean make

the right configure is

./configure --with-python --with-js

cheers Luca

  Changed 13 years ago by lucadelu

  • keywords kernel javascript added
  • priority changed from major to critical

The kernel compiled with js crash; the error in the log of apache is

/usr/lib/cgi-bin/zoo_loader_js.cgi: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory

The compilation finish without any error

follow-up: ↓ 10   Changed 13 years ago by david

you must add libmoz185 path in ld.conf :

echo "/usr/local/lib" > /etc/ld.so.conf.d/libmoz185.conf

ldconfig

in reply to: ↑ 9   Changed 13 years ago by lucadelu

Replying to david:

you must add libmoz185 path in ld.conf :

echo "/usr/local/lib" > /etc/ld.so.conf.d/libmoz185.conf

ldconfig

It doesn't resolve the problem. In /usr/local/lib/ I had only libmozjs185.so, libmozjs185.so.1.0, libmozjs185.so.1.0.0*. I tried to create a new symbolic link for libmozjs.so but It doesn't work yet. Now I have

-rwxr-xr-x 1 root root  5.3M 2011-10-06 13:38 libmozjs185-1.0.a*
lrwxrwxrwx 1 root root    33 2011-10-06 13:40 libmozjs185.so -> /usr/local/lib/libmozjs185.so.1.0*
lrwxrwxrwx 1 root root    35 2011-10-06 13:40 libmozjs185.so.1.0 -> /usr/local/lib/libmozjs185.so.1.0.0*
-rwxr-xr-x 1 root root  3.5M 2011-10-06 13:38 libmozjs185.so.1.0.0*
lrwxrwxrwx 1 root root    29 2011-10-10 09:24 libmozjs.so -> /usr/local/lib/libmozjs185.so*

I run ldconfig again

follow-up: ↓ 12   Changed 13 years ago by djay

Can you please provide the result of the following command ?

ldd zoo_loader.cgi

This way can see the library your ZOO-Kernel was linked against.

in reply to: ↑ 11   Changed 13 years ago by lucadelu

Replying to djay:

Can you please provide the result of the following command ?

ldd zoo_loader.cgi

This way can see the library your ZOO-Kernel was linked against.

libmozjs.so It's not found

pgis@OGCserverFEM:/usr/lib/cgi-bin$ ldd zoo_loader_js.cgi 
        linux-vdso.so.1 =>  (0x00007fffaf7ff000)
        libcurl-gnutls.so.4 => /usr/lib/libcurl-gnutls.so.4 (0x00007fc05884f000)
        libgdal.so.1 => /usr/local/lib/libgdal.so.1 (0x00007fc057dc2000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fc057a71000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fc057854000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007fc057650000)
        libutil.so.1 => /lib/libutil.so.1 (0x00007fc05744c000)
        libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0x00007fc056f9b000)
        libmozjs.so => not found
        libm.so.6 => /lib/libm.so.6 (0x00007fc056d17000)
        libfcgi.so.0 => /usr/local/lib/libfcgi.so.0 (0x00007fc056b0c000)
        libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007fc05677c000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fc056467000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fc056250000)
        libc.so.6 => /lib/libc.so.6 (0x00007fc055ecd000)
        libidn.so.11 => /usr/lib/libidn.so.11 (0x00007fc055c99000)
        liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0x00007fc055a8b000)
        libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0x00007fc05583f000)
        librt.so.1 => /lib/librt.so.1 (0x00007fc055636000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007fc055402000)
        libz.so.1 => /lib/libz.so.1 (0x00007fc0551eb000)
        libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0x00007fc054f48000)
        libgcrypt.so.11 => /lib/libgcrypt.so.11 (0x00007fc054cd0000)
        libodbc.so.1 => /usr/lib/libodbc.so.1 (0x00007fc054a6e000)
        libodbcinst.so.1 => /usr/lib/libodbcinst.so.1 (0x00007fc054861000)
        libexpat.so.1 => /lib/libexpat.so.1 (0x00007fc054638000)
        libxerces-c.so.28 => /usr/lib/libxerces-c.so.28 (0x00007fc054064000)
        libNCSEcw.so.0 => /usr/local/lib/libNCSEcw.so.0 (0x00007fc053d26000)
        libNCSCnet.so.0 => /usr/local/lib/libNCSCnet.so.0 (0x00007fc053b10000)
        libNCSUtil.so.0 => /usr/local/lib/libNCSUtil.so.0 (0x00007fc0538e9000)
        libjasper.so.1 => /usr/lib/libjasper.so.1 (0x00007fc053692000)
        libhdf5.so.6 => /usr/lib/libhdf5.so.6 (0x00007fc0530e4000)
        libmfhdf.so.0 => /usr/lib/libmfhdf.so.0 (0x00007fc052eb7000)
        libdf.so.0 => /usr/lib/libdf.so.0 (0x00007fc052c00000)
        libgif.so.4 => /usr/lib/libgif.so.4 (0x00007fc0529f7000)
        libgeotiff.so.1.2 => /usr/lib/libgeotiff.so.1.2 (0x00007fc0527c6000)
        libtiff.so.4 => /usr/lib/libtiff.so.4 (0x00007fc052564000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007fc052340000)
        libpng12.so.0 => /lib/libpng12.so.0 (0x00007fc052118000)
        libnetcdf.so.4 => /usr/lib/libnetcdf.so.4 (0x00007fc051e48000)
        libpq.so.5 => /usr/lib/libpq.so.5 (0x00007fc051c20000)
        libspatialite.so.2 => /usr/local/lib/libspatialite.so.2 (0x00007fc051740000)
        libgeos_c.so.1 => /usr/lib/libgeos_c.so.1 (0x00007fc05152a000)
        libgeos-3.1.0.so => /usr/lib/libgeos-3.1.0.so (0x00007fc0511e5000)
        libproj.so.0 => /usr/lib/libproj.so.0 (0x00007fc050fa2000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007fc050d15000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc058aa4000)
        libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007fc050ac2000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00007fc0508a8000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00007fc05068e000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00007fc050474000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007fc0501b0000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007fc04ff89000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x00007fc04fd85000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007fc04fb7d000)
        libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00007fc04f979000)
        libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0x00007fc04f768000)
        libgpg-error.so.0 => /lib/libgpg-error.so.0 (0x00007fc04f564000)
        libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007fc04f359000)
        libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0x00007fc04effe000)
        libicudata.so.42 => /usr/lib/libicudata.so.42 (0x00007fc04deb9000)
        libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007fc04dbcb000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007fc04d992000)

I try again from the beginning and I found some problem in the compilation. If I try to configure with

./configure --with-python --with-js=/usr/local

During make It return this error

pgis@OGCserverFEM:~/compilati/zoo-project/zoo-kernel$ make zoo_loader.cgi
g++ -g -O2 -I/usr/include/libxml2  -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE  -I/usr/include/python2.6 -I/usr/include/python2.6 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes  -I/usr/local/include/   -DUSE_PYTHON -DUSE_JS    -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from zoo_service_loader.c:39:
ulinet.h:38:19: error: jsapi.h: No such file or directory
In file included from /usr/include/python2.6/Python.h:8,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from /usr/include/libxml2/libxml/tree.h:15,
                 from zoo_service_loader.c:31:
/usr/include/features.h:158:1: warning: this is the location of the previous definition
In file included from /usr/include/python2.6/Python.h:8,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from /usr/include/libxml2/libxml/tree.h:15,
                 from zoo_service_loader.c:31:
/usr/include/features.h:160:1: warning: this is the location of the previous definition
In file included from zoo_service_loader.c:39:
ulinet.h:140: error: ‘JSBool’ does not name a type
In file included from zoo_service_loader.c:45:
service.h: In function ‘char* getMapsAsKVP(maps*, int, int)’:
service.h:241: warning: unused variable ‘tmp’
service.h:249: warning: unused variable ‘j’
In file included from service_internal.h:65,
                 from zoo_service_loader.c:47:
service_internal_js.h: At global scope:
service_internal_js.h:44: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:44: error: expected primary-expression before ‘,’ token
service_internal_js.h:44: error: ‘jsval’ was not declared in this scope
service_internal_js.h:44: error: expected primary-expression before ‘)’ token
service_internal_js.h:44: error: initializer expression list treated as compound expression
service_internal_js.h:45: error: expected constructor, destructor, or type conversion before ‘*’ token
service_internal_js.h:46: error: expected constructor, destructor, or type conversion before ‘*’ token
service_internal_js.h:47: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:47: error: expected primary-expression before ‘,’ token
service_internal_js.h:47: error: ‘jsval’ was not declared in this scope
service_internal_js.h:47: error: initializer expression list treated as compound expression
service_internal_js.h:48: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:48: error: expected primary-expression before ‘,’ token
service_internal_js.h:48: error: ‘jsval’ was not declared in this scope
service_internal_js.h:48: error: initializer expression list treated as compound expression
service_internal_js.h:50: error: variable or field ‘reportError’ declared void
service_internal_js.h:50: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:50: error: ‘cx’ was not declared in this scope
service_internal_js.h:50: error: expected primary-expression before ‘const’
service_internal_js.h:50: error: ‘JSErrorReport’ was not declared in this scope
service_internal_js.h:50: error: ‘report’ was not declared in this scope
service_internal_js.h:54: error: expected constructor, destructor, or type conversion before ‘*’ token
In file included from zoo_service_loader.c:47:
service_internal.h:82: error: redefinition of ‘char* JSValToChar’
service_internal_js.h:44: error: ‘char* JSValToChar’ previously defined here
service_internal.h:82: error: ‘JSContext’ was not declared in this scope
service_internal.h:82: error: expected primary-expression before ‘,’ token
service_internal.h:82: error: ‘jsval’ was not declared in this scope
service_internal.h:82: error: expected primary-expression before ‘)’ token
service_internal.h:83: error: ‘JSBool’ does not name a type
In file included from /usr/include/python2.6/Python.h:94,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/stringobject.h:65: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/stringobject.h:67: warning: ‘FCGI_printf’ is an unrecognized format function type
In file included from /usr/include/python2.6/Python.h:120,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyerrors.h:195: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/pyerrors.h:322: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/pyerrors.h:324: warning: ‘FCGI_printf’ is an unrecognized format function type
In file included from /usr/include/python2.6/Python.h:128,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/sysmodule.h:17: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/sysmodule.h:19: warning: ‘FCGI_printf’ is an unrecognized format function type
zoo_service_loader.c: In function ‘void loadServiceAndRun(maps**, service*, map*, maps**, maps**, int*)’:
zoo_service_loader.c:155: warning: unused variable ‘pntmp’
zoo_service_loader.c: In function ‘int runRequest(map*)’:
zoo_service_loader.c:1065: warning: comparison between signed and unsigned integer expressions
zoo_service_loader.c:1067: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
zoo_service_loader.c:1470: warning: comparison between signed and unsigned integer expressions
zoo_service_loader.c:450: warning: unused variable ‘pntmp’
service.h: At global scope:
service.h:140: warning: ‘void dumpMapsToFile(maps*, FCGI_FILE*)’ defined but not used
service.h:156: warning: ‘int count(map*)’ defined but not used
service.h:221: warning: ‘char* getMapsAsKVP(maps*, int, int)’ defined but not used
service.h:354: warning: ‘int hasElement(elements*, const char*)’ defined but not used
service.h:364: warning: ‘elements* getElements(elements*, char*)’ defined but not used
service.h:509: warning: ‘iotype* getIoTypeFromElement(elements*, char*, map*)’ defined but not used
service.h:682: warning: ‘void dumpService(service*)’ defined but not used
service_internal.h:73: warning: ‘usedNs’ defined but not used
service_internal.h:74: warning: ‘nsName’ defined but not used
service_internal.h:75: warning: ‘nbNs’ defined but not used
make: *** [zoo_service_loader.o] Error 1

follow-up: ↓ 14   Changed 13 years ago by djay

Looking at the ldd results you provided, it seems that you linked your ZOO-Kernel against libmozjs.so when it should be libmoz185.so as we are now supporting the 185 version only.

After running your configure script, it is better to run make clean then run make again this way you'll be sure that ereach file will be recompiled using the parameters you set when running configure script.

Hope this help.

in reply to: ↑ 13 ; follow-up: ↓ 15   Changed 13 years ago by rldhont

Replying to djay:

Looking at the ldd results you provided, it seems that you linked your ZOO-Kernel against libmozjs.so when it should be libmoz185.so as we are now supporting the 185 version only.

Why did you say the 185 version only ? I have no problem with xulrunner 2 and libmoz 2

I have no problem with compilation under xulrunner 2, and --with-js

The problem is that

ldd zoo_loader.cgi

returns

libmozjs.so => not found

because zoo-loader.cgi only search link in /usr/lib and not in/usr/lib/xulrunner2 and to solve it I do

sudo ln -s xulrunner2/libmozjs.so libmozjs.so

in reply to: ↑ 14   Changed 13 years ago by djay

Replying to rldhont:

Why did you say the 185 version only ? I have no problem with xulrunner 2 and libmoz 2

I have no problem with compilation under xulrunner 2, and --with-js

If you take deeper look into the configure.ac file provided in the ZOO-Project source tree you should notice that from line 366 to 381 we are first searching for a libmozjs185-dev package installed then if a xulrunner was installed.

In both case, there should be no problem until you use --with-js=yes option (as you can see in line 360). I wonder if {{{--with-js}} will handle things in the same way...

Hope this helps.

follow-up: ↓ 17   Changed 13 years ago by rldhont

Understood!

The problem is the links between zoo_loader.cgi and libmozjs.so not found in /usr/lib because it is in /usr/lib/xulrunner2 where the compilation found it for the linkage!

in reply to: ↑ 16   Changed 13 years ago by djay

Replying to rldhont:

Understood!

The problem is the links between zoo_loader.cgi and libmozjs.so not found in /usr/lib because it is in /usr/lib/xulrunner2 where the compilation found it for the linkage!

We should use the correct directory for JS_LDFLAGS, take a look on line 376.

Hope this helps.

follow-up: ↓ 19   Changed 13 years ago by lucadelu

I start again from the beginning. The first test with Mozilla js compiled failed:

./configure --with-python --with-js
configure: error: You must install libmozjs-dev or xulrunner-dev 
./configure --with-python --with-js=yes
configure: error: You must install libmozjs-dev or xulrunner-dev 
./configure --with-python --with-js=/usr/local/
checking for JS_CallFunctionName in -lmozjs... yes

make
g++ -g -O2 -I/usr/include/libxml2  -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE  -I/usr/include/python2.6 -I/usr/include/python2.6 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes  -I/usr/local//include/   -DUSE_PYTHON -DUSE_JS    -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from zoo_service_loader.c:39:
ulinet.h:38:19: error: jsapi.h: No such file or directory
In file included from /usr/include/python2.6/Python.h:8,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from /usr/include/libxml2/libxml/tree.h:15,
                 from zoo_service_loader.c:31:
/usr/include/features.h:158:1: warning: this is the location of the previous definition
In file included from /usr/include/python2.6/Python.h:8,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from /usr/include/libxml2/libxml/tree.h:15,
                 from zoo_service_loader.c:31:
/usr/include/features.h:160:1: warning: this is the location of the previous definition
In file included from zoo_service_loader.c:39:
ulinet.h:140: error: ‘JSBool’ does not name a type
In file included from zoo_service_loader.c:45:
service.h: In function ‘char* getMapsAsKVP(maps*, int, int)’:
service.h:241: warning: unused variable ‘tmp’
service.h:249: warning: unused variable ‘j’
In file included from service_internal.h:65,
                 from zoo_service_loader.c:47:
service_internal_js.h: At global scope:
service_internal_js.h:44: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:44: error: expected primary-expression before ‘,’ token
service_internal_js.h:44: error: ‘jsval’ was not declared in this scope
service_internal_js.h:44: error: expected primary-expression before ‘)’ token
service_internal_js.h:44: error: initializer expression list treated as compound expression
service_internal_js.h:45: error: expected constructor, destructor, or type conversion before ‘*’ token
service_internal_js.h:46: error: expected constructor, destructor, or type conversion before ‘*’ token
service_internal_js.h:47: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:47: error: expected primary-expression before ‘,’ token
service_internal_js.h:47: error: ‘jsval’ was not declared in this scope
service_internal_js.h:47: error: initializer expression list treated as compound expression
service_internal_js.h:48: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:48: error: expected primary-expression before ‘,’ token
service_internal_js.h:48: error: ‘jsval’ was not declared in this scope
service_internal_js.h:48: error: initializer expression list treated as compound expression
service_internal_js.h:50: error: variable or field ‘reportError’ declared void
service_internal_js.h:50: error: ‘JSContext’ was not declared in this scope
service_internal_js.h:50: error: ‘cx’ was not declared in this scope
service_internal_js.h:50: error: expected primary-expression before ‘const’
service_internal_js.h:50: error: ‘JSErrorReport’ was not declared in this scope
service_internal_js.h:50: error: ‘report’ was not declared in this scope
service_internal_js.h:54: error: expected constructor, destructor, or type conversion before ‘*’ token
In file included from zoo_service_loader.c:47:
service_internal.h:82: error: redefinition of ‘char* JSValToChar’
service_internal_js.h:44: error: ‘char* JSValToChar’ previously defined here
service_internal.h:82: error: ‘JSContext’ was not declared in this scope
service_internal.h:82: error: expected primary-expression before ‘,’ token
service_internal.h:82: error: ‘jsval’ was not declared in this scope
service_internal.h:82: error: expected primary-expression before ‘)’ token
service_internal.h:83: error: ‘JSBool’ does not name a type
In file included from /usr/include/python2.6/Python.h:94,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/stringobject.h:65: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/stringobject.h:67: warning: ‘FCGI_printf’ is an unrecognized format function type
In file included from /usr/include/python2.6/Python.h:120,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/pyerrors.h:195: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/pyerrors.h:322: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/pyerrors.h:324: warning: ‘FCGI_printf’ is an unrecognized format function type
In file included from /usr/include/python2.6/Python.h:128,
                 from service_internal_python.h:32,
                 from zoo_service_loader.c:50:
/usr/include/python2.6/sysmodule.h:17: warning: ‘FCGI_printf’ is an unrecognized format function type
/usr/include/python2.6/sysmodule.h:19: warning: ‘FCGI_printf’ is an unrecognized format function type
zoo_service_loader.c: In function ‘void loadServiceAndRun(maps**, service*, map*, maps**, maps**, int*)’:
zoo_service_loader.c:155: warning: unused variable ‘pntmp’
zoo_service_loader.c: In function ‘int runRequest(map*)’:
zoo_service_loader.c:1065: warning: comparison between signed and unsigned integer expressions
zoo_service_loader.c:1067: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
zoo_service_loader.c:1470: warning: comparison between signed and unsigned integer expressions
zoo_service_loader.c:450: warning: unused variable ‘pntmp’
service.h: At global scope:
service.h:140: warning: ‘void dumpMapsToFile(maps*, FCGI_FILE*)’ defined but not used
service.h:156: warning: ‘int count(map*)’ defined but not used
service.h:221: warning: ‘char* getMapsAsKVP(maps*, int, int)’ defined but not used
service.h:354: warning: ‘int hasElement(elements*, const char*)’ defined but not used
service.h:364: warning: ‘elements* getElements(elements*, char*)’ defined but not used
service.h:509: warning: ‘iotype* getIoTypeFromElement(elements*, char*, map*)’ defined but not used
service.h:682: warning: ‘void dumpService(service*)’ defined but not used
service_internal.h:73: warning: ‘usedNs’ defined but not used
service_internal.h:74: warning: ‘nsName’ defined but not used
service_internal.h:75: warning: ‘nbNs’ defined but not used
make: *** [zoo_service_loader.o] Error 1

Now I remove Mozilla js and I installed xulrunner2

./configure --with-python --with-js
checking for JS_CallFunctionName in -lmozjs... yes

make 

ldd zoo_loader.cgi
libmozjs.so => not found

The final test, with the suggestion of reluc, it works!!

ln -s /usr/lib/xulrunner-1.9.2.23/libmozjs.so /usr/lib/
./configure --with-python --with-js
checking for JS_CallFunctionName in -lmozjs... yes

make 

ldd zoo_loader.cgi
libmozjs.so => /usr/lib/libmozjs.so

in reply to: ↑ 18   Changed 13 years ago by djay

Replying to lucadelu:

I start again from the beginning. The first test with Mozilla js compiled failed

That is strange. Using the http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz library, the compilation should succeed.

Now I remove Mozilla js and I installed xulrunner2

./configure --with-python --with-js
checking for JS_CallFunctionName in -lmozjs... yes

make 

ldd zoo_loader.cgi
libmozjs.so => not found

Ok, at that point I'm pretty sure that /usr/lib/xulrunner-1.9.2.23/ (so where is located your libmozjs.so) is not mentioned in /etc/ld.so.conf or in any file localted in /etc/ld.so.conf.d/ (if present on your system). (Note taht I'm a bit lost about the version number, but anyway :) )

So when you run ldconfig the resolution failed as library path doesn't contain any directory containing the libmozjs.so file.

Obviously you can use a symlink in /usr/lib as it is included in the default library path but it imply you suppose that libmozjs.so doesn't add other dependent libraries which may not be found (even if located in the same directory as libmozjs.so itself).

The final test, with the suggestion of reluc, it works!!

ln -s /usr/lib/xulrunner-1.9.2.23/libmozjs.so /usr/lib/ ./configure --with-python --with-js checking for JS_CallFunctionName in -lmozjs... yes

make

ldd zoo_loader.cgi libmozjs.so => /usr/lib/libmozjs.so

About version number, I'm wondering if you really remove previous version of xulrunner. I also wonder, when you said "it works", if you mean it compile or the JavaScript services are able to run from your local ZOO-Kernel instance. It should not run properly if you use 1.9.X version.

Hope this help.

in reply to: ↑ 5   Changed 13 years ago by lucadelu

Replying to david:

For ubuntu 10.04

zoo-kernel isn't compatible with xulrunner-1.9, so you need to compile with http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz .

wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar xzf js185-1.0.0.tar.gz cd js-1.8.5/js/src ./configure --prefix=/usr/local make sudo make install sudo ldconfig

cd <zoo-kernel sources> ./configure --with-python --with-js=/usr/local make clean make

I try again from the beginning and now It works. I think that someone can change the ticket to fix

  Changed 13 years ago by djay

  • status changed from assigned to closed
  • resolution set to fixed

Thanks a lot for your feedbacks.

If anything wrong still occur on your side, please feel free to re-open this ticket.

  Changed 11 years ago by djay

  • milestone 1.3dev deleted

Milestone 1.3dev deleted

Note: See TracTickets for help on using tickets.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png