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

Build issues under Ubuntu 14.04 #26

Open
ntwrkguru opened this issue Sep 22, 2014 · 8 comments
Open

Build issues under Ubuntu 14.04 #26

ntwrkguru opened this issue Sep 22, 2014 · 8 comments

Comments

@ntwrkguru
Copy link

Please consider adding the following requirements to the Building wiki page for Ubuntu:
Install:

  • build-essential
  • dh-autoreconf
  • libbison

Additionally, I get the following errors when running make:

scripthacker@ubuntu:~/.source/libslax/build$ make
Making all in libslax
make[1]: Entering directory `/home/scripthacker/.source/libslax/build/libslax'
make  all-am
make[2]: Entering directory `/home/scripthacker/.source/libslax/build/libslax'
  BISON  slaxparser.c
  BISON  slaxparser.h
  CC       jsonlexer.lo
  CC       jsonwriter.lo
  CC       slaxdebugger.lo
  CC       slaxdyn.lo
  CC       slaxext.lo
  CC       slaxio.lo
  CC       slaxlexer.lo
  CC       slaxloader.lo
  CC       slaxmvar.lo
  CC       slaxparser.lo
slaxparser.c: In function 'slaxParse':
slaxparser.c:2445:30: error: macro "yylex" requires 2 arguments, but only 1 given
       yychar = yylex (&yylval);
                              ^
slaxparser.c:2445:16: error: 'yylex' undeclared (first use in this function)
       yychar = yylex (&yylval);
                ^
slaxparser.c:2445:16: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [slaxparser.lo] Error 1
make[2]: Leaving directory `/home/scripthacker/.source/libslax/build/libslax'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/scripthacker/.source/libslax/build/libslax'
make: *** [all-recursive] Error 1
scripthacker@ubuntu:~/.source/libslax/build$ 

Environment:
Linux ubuntu 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

@ntwrkguru
Copy link
Author

scripthacker@ubuntu:~/.source/libslax$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether ln -s works... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for basename... /usr/bin/basename
checking for bison... /usr/bin/bison
checking for cat... /bin/cat
checking for chmod... /bin/chmod
checking for cp... /bin/cp
checking for diff... /usr/bin/diff
checking for mkdir... /bin/mkdir
checking for mv... /bin/mv
checking for rm... /bin/rm
checking for sed... (cached) /bin/sed
checking for ANSI C header files... (cached) yes
checking for inline... inline
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for bzero... yes
checking for memmove... yes
checking for strchr... yes
checking for strcspn... yes
checking for strerror... yes
checking for strspn... yes
checking for sranddev... no
checking for srand... yes
checking for strlcpy... no
checking for fdopen... yes
checking for getrusage... yes
checking for gettimeofday... yes
checking for ctime... yes
checking for getpass... yes
checking for sysctlbyname... no
checking for flock... yes
checking for asprintf... yes
checking for dlfcn.h... (cached) yes
checking tzfile.h usability... no
checking tzfile.h presence... no
checking for tzfile.h... no
checking stdtime/tzfile.h usability... no
checking stdtime/tzfile.h presence... no
checking for stdtime/tzfile.h... no
checking for dlfunc... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for unistd.h... (cached) yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking for MD5_Init in -lcrypto... yes
checking for lrint in -lm... yes
checking for xmlNewParserCtxt in -lxml2... yes
checking for xsltInit in -lxslt... yes
checking whether to build with warnings... no
checking whether to build with debugging... no
checking whether to build with readline... no
checking whether to build with libedit... no
checking whether to build with printflike... no
checking for libxml libraries >= 2.7.7... 2.9.1 found
checking for libxslt libraries >= 1.1.26... 1.1.28 found
checking for libcurl libraries >= 7.21.3... libcurl 7.35.0 found
checking bison version... 3.0
checking for stat.st_mtimespec... no
Using configure dir /home/scripthacker/.source/libslax
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating slax-config
config.status: creating libslax/Makefile
config.status: creating libslax/slaxversion.h
config.status: creating extensions/Makefile
config.status: creating extensions/bit/Makefile
config.status: creating extensions/curl/Makefile
config.status: creating extensions/exslt/Makefile
config.status: creating extensions/os/Makefile
config.status: creating extensions/xutil/Makefile
config.status: creating slaxproc/Makefile
config.status: creating tests/Makefile
config.status: creating tests/art/Makefile
config.status: creating tests/core/Makefile
config.status: creating tests/bugs/Makefile
config.status: creating tests/errors/Makefile
config.status: creating tests/libxslt/Makefile
config.status: creating bin/Makefile
config.status: creating doc/Makefile
config.status: creating doc/oxtradoc/oxtradoc
config.status: creating packaging/libslax.pc
config.status: creating packaging/libslax.spec
config.status: creating packaging/libslax.space.spec
config.status: creating packaging/libslax.rb.base
config.status: creating packaging/freebsd/port-Makefile
config.status: creating libslax/slaxconfig.h
config.status: libslax/slaxconfig.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
/bin/rm: cannot remove 'libtoolT': No such file or directory
configure: summary of build options:

  libslax version:  0.18.1 
  host type:        x86_64-unknown-linux-gnu / linux-gnu
  install prefix:   /usr/local
  srcdir:           .
  libdir:           ${exec_prefix}/lib
  bindir:           /usr/local/bin
  includedir:       ${prefix}/include
  extensions dir:   ${exec_prefix}/lib/slax/extensions

  compiler:         gcc
  compiler flags:   -D_GNU_SOURCE -g -O2
  library types:    Shared=yes, Static=yes
  libxml version:   2.9.1
  libxslt cflags:    -I/usr/include/libxml2
  libxml libs:       -lxml2
  libxslt version:  1.1.28
  libxslt cflags:    -I/usr/include/libxml2
  libxslt libs:      -lxslt -lxml2
  libcurl version:  libcurl 7.35.0
  libcurl cflags:    
  libcurl libs:      -L/usr/lib/x86_64-linux-gnu -lcurl
  bison version:    3.0

  warnings:         no
  debug:            no
  readline:         no
  libedit:          no
  printf-like:      no
  libxslt tests:    no

scripthacker@ubuntu:~/.source/libslax$

@philshafer
Copy link
Contributor

On Sep 22, 2014, at 11:57 PM, ntwrkguru wrote:

bison version: 3.0

This one is strange since it is detecting that you've got bison 3.0. I just noticed that I'm shipping slaxconfig.h in the dist tarball, which is not good. I think this might be the source of the issue. Please 'rm ../libslax/slaxconfig.h' from inside your 'build' directory. Then rerun ../configure, make clean, and make. Let me know if this works.

Thanks,
Phil

@ntwrkguru
Copy link
Author

Ok, actually I was haviing some trouble doing the make clean so I blew it out and cloned the repo again. It seemed to configure and make ok, although I had to make and make install as sudo.

Now when I run slaxproc I get library errors. See below:

scripthacker@ubuntu:~/.source/libslax/build$ slaxproc
slaxproc: error while loading shared libraries: libslax.so.0: cannot open shared object file: No such file or directory

However, the libraries seem to be there.

scripthacker@ubuntu:~/.source/libslax/build$ ls -al /usr/local/lib/
total 3012
drwxr-xr-x  7 root root     4096 Sep 23 07:38 .
drwxr-xr-x 10 root root     4096 Oct 17  2012 ..
-rw-r--r--  1 root root  1935010 Sep 23 07:38 libslax.a
-rwxr-xr-x  1 root root      981 Sep 23 07:38 libslax.la
lrwxrwxrwx  1 root root       16 Sep 23 07:38 libslax.so -> libslax.so.0.0.0
lrwxrwxrwx  1 root root       16 Sep 23 07:38 libslax.so.0 -> libslax.so.0.0.0
-rwxr-xr-x  1 root root  1112200 Sep 23 07:38 libslax.so.0.0.0
drwxr-xr-x  2 root root     4096 Sep 23 07:38 pkgconfig
drwxrwsr-x  4 root staff    4096 Sep 19 19:21 python2.7
drwxrwsr-x  3 root staff    4096 Oct 17  2012 python3.2
drwxrwsr-x  3 root staff    4096 Sep 19 19:21 python3.4
drwxr-xr-x  3 root root     4096 Sep 23 07:15 slax

@philshafer
Copy link
Contributor

On Sep 23, 2014, at 11:02 AM, ntwrkguru wrote:

Ok, actually I was haviing some trouble doing the make clean so I blew it out and cloned the repo again. It seemed to configure and make ok, although I had to make and make install as sudo.

You shouldn't need to run "make" as root, but "make install" will require whatever permissions are needed to install files.

Now when I run slaxproc I get library errors. See below:
scripthacker@ubuntu:~/.source/libslax/build$ slaxproc
slaxproc: error while loading shared libraries: libslax.so.0: cannot open shared object file: No such file or directory

However, the libraries seem to be there.

scripthacker@ubuntu:~/.source/libslax/build$ ls -al /usr/local/lib/
total 3012
drwxr-xr-x 7 root root 4096 Sep 23 07:38 .
drwxr-xr-x 10 root root 4096 Oct 17 2012 ..
-rw-r--r-- 1 root root 1935010 Sep 23 07:38 libslax.a
-rwxr-xr-x 1 root root 981 Sep 23 07:38 libslax.la
lrwxrwxrwx 1 root root 16 Sep 23 07:38 libslax.so -> libslax.so.0.0.0
lrwxrwxrwx 1 root root 16 Sep 23 07:38 libslax.so.0 -> libslax.so.0.0.0
-rwxr-xr-x 1 root root 1112200 Sep 23 07:38 libslax.so.0.0.0
drwxr-xr-x 2 root root 4096 Sep 23 07:38 pkgconfig
drwxrwsr-x 4 root staff 4096 Sep 19 19:21 python2.7
drwxrwsr-x 3 root staff 4096 Oct 17 2012 python3.2
drwxrwsr-x 3 root staff 4096 Sep 19 19:21 python3.4
drwxr-xr-x 3 root root 4096 Sep 23 07:15 slax

Given that there are no other libraries in your /usr/local/lib, I'm wondering if linux knows to look there for libs.

vagrant@vagrant-ubuntu-trusty-64:~$ ldd /usr/local/bin/slaxproc
linux-vdso.so.1 => (0x00007fff45ffe000)
libslax.so.0 => /usr/local/lib/libslax.so.0 (0x00007fb891dcc000)
libxslt.so.1 => /usr/lib/x86_64-linux-gnu/libxslt.so.1 (0x00007fb891b8f000)
libexslt.so.0 => /usr/lib/x86_64-linux-gnu/libexslt.so.0 (0x00007fb891979000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fb891613000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb89124d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb891048000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb890d42000)
libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007fb890ac3000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fb8908a9000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fb890687000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb89201d000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fb890482000)

Try using LD_LIBRARY_PATH to explicitly point it there:

env LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/bin/slaxproc

I've no clue what libxml2 and friends are doing to get their libs in /usr/lib/x86_64-linux-gnu/; I've been assuming autotools will handle that, but it doesn't look like it.

You could try "../configure --libdir=/usr/lib/x86_64-linux-gnu" and see if that addresses it.

Thanks,
Phil

@ntwrkguru
Copy link
Author

Odd. That's where it was placed when I ran make install. Running env LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/bin/slaxproc as sudo didn't seem to resolve it. It's worth noting that this was a 13.10 box prior to attempting this. I may need to do a fresh install of trusty.

@philshafer
Copy link
Contributor

On Sep 23, 2014, at 3:00 PM, ntwrkguru wrote:

Running env LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/bin/slaxproc as sudo didn't seem to resolve it.

This won't resolve it, but will report where libraries are being found. If "env ... ldd ..." reports the right library locations and "ldd ..." (without the env bit) doesn't then you need to find out why ld.so isn't looking in /usr/local/lib for libraries.

Thanks,
Phil

@ntwrkguru
Copy link
Author

Well, it's dirty, but it worked. I created symlinks in /usr/lib/x86_64-linux-gnu pointing to /usr/local/lib

scripthacker@AUTOMATION:/usr/lib/x86_64-linux-gnu$ sudo ln -s /usr/local/lib/libslax.so libslax.so
scripthacker@AUTOMATION:/usr/lib/x86_64-linux-gnu$ sudo ln -s /usr/local/lib/libslax.so.0 libslax.so.0
scripthacker@AUTOMATION:/usr/lib/x86_64-linux-gnu$ cd ~
scripthacker@AUTOMATION:~$ slaxproc
slaxproc: script file cannot be stdin
scripthacker@AUTOMATION:~$ 

@ntwrkguru
Copy link
Author

Running ../configure --libdir=/usr/lib/x86_64-linux-gnu will prevent this. The strange thing is that one would assume autotools or dh-autoreconf would resolve this. I'm not sure what can be done in the source to mitigate this as it seems limited to Debian systems. I'm ok with closing this unless you think something can be done to resolve this in source.

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