Menu

#1800 configure : lua detection is strange when liblua is present but cannot be detected

None
closed-not-a-bug
nobody
None
2020-11-07
2016-05-25
No

I am managing gnuplot building in mxe-octave (gnuplot-5.0.3).
In mxe-octave, gnuplot is built without external libraries except for libiconv.
Thus gd, cairo, qt, wxt, ... related stuff omitted by ./configure.
However, behavior for lua is strange.

part of configure 1

checking for LUA... no
checking for LUA... no
configure: WARNING: Could not find support for lua using pkg-config.
checking for library containing luaL_openlibs... -llua5.1
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
configure: WARNING: please add path to lua.h to CPPFLAGS in Makefile

part of configure 2

 lua/TikZ terminal: yes 

Make failure because lua is missing

   -g -O2 -MT term.o -MD -MP -MF $depbase.Tpo -c -o term.o term.c &&\
    mv -f $depbase.Tpo $depbase.Po
In file included from term.h:414:0,
                 from term.c:1194:
../term/lua.trm:113:17: fatal error: lua.h: No such file or directory
 #include <lua.h>
                 ^

Workaround is to add --without-lua to the configure option.
But
lua/TikZ terminal: no
is correct response in this case, I think.

The same error happened in gnuplot-4.6.7 but it is obsolated so that I did not make e ticket at that moment.

Discussion

  • Tatsuro MATSUOKA

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -28,7 +28,8 @@
                      from term.c:1194:
     ../term/lua.trm:113:17: fatal error: lua.h: No such file or directory
      #include <lua.h>
    -^~~~
    +                 ^
    +~~~
    
     Workaround is to add --without-lua to the configure option.
     But
    
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2016-05-29

    This does not look like a bug to me.

    The configure script is telling you that the lua library is present,
    but it can not find the matching lua.h file.
    There are 2 possible reasons.

    1) It could be because you have not installed the *-devel version of the library
    to match the library itself

    On my machine that is liblua5.2-5.2.3 and lib64lua-devel-5.2.3
    but you may have a different version. (The config output you show
    mentions lua5.1).

    2) Alternatively, you may correctly have the lua.h file installed but it is in
    a directory not on the default search path.
    That is why the script output suggests
    configure: WARNING: please add path to lua.h to CPPFLAGS in Makefile

    Of course as you say it is also possible to configure --without-lua
    but then you will not be able to use the tikz terminal.
    It would be better to install or identify the lua.h file.

     
  • Tatsuro MATSUOKA

    Sorry for my explanation is not enogh.
    As I wrote, it was the case in build of gnuplot on the mxe-octave but not usual build.
    For usual build, I prepare lua and its dev from ubuntu repo and use it.
    In this case, the lua is linked without problem.

    The mxe-octave system is based on mxe project [1] and it is basically intened to build windows binary of octave and related libraries from source on unix enviroments. It also can be used for native build of octave for special mode and specially build libraries e.g. with large array index.
    The mxe-octave is closed system. Libraires are used that are build in the project and external libraires are not used. In mxe-octave gnuplot is build with only two dependence libraries (libiconv and qt) and other libraries are ignored (gd based, cairo based, caca and lua). The gd and cairo based terminals and related libraies and libcaca are ignored at configure even if I installed libraries and header files from the Ubunu repo. But the only lua is not ignored even if it is failed at searching a header file. Of course, printing warning might be intended behavior. But I think that it is natual disabling lua because the failure of lua detection happens at early stage of configure and final out put of configure says " lua/TikZ terminal: no ". But If developers will not chage the behavior, octave team will continue to use confirure script --wihtout-lua.

    [1] http://mxe.cc

     

    Last edit: Tatsuro MATSUOKA 2016-05-30
  • Ethan Merritt

    Ethan Merritt - 2016-05-31

    I do not understand from your explanation whether the mxe-octave build environment does or does not contain the lua library. The list of packages at http://mxe.cc does contain lua, but does not mention the lua library separately so I cannot tell from the list is the library is included.

    If the environment does contain a lua library, then the autoconfigure script is acting as intended. It tells you that it will include the library but you need to provide a header file.

    If the environment does not contain a lua library, then yes there is a bug if the autoconfigure script thinks that it found one.

     
  • Tatsuro MATSUOKA

    Sorry for my inadiquate explanation again. The mxe-octave uses MXE system but does not inculde all libraries listed on the MXE project page. The mxe-octave does not choose the lua for octave builld. Then lua is not build in mxe-octave.

    For the location of libraries and header file for lua and caca.

    liblua

    /usr/lib/x86_64-linux-gnu/liblua5.1-c++.a
    /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so
    /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0
    /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0.0.0
    /usr/lib/x86_64-linux-gnu/liblua5.1.a
    /usr/lib/x86_64-linux-gnu/liblua5.1.so
    /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
    /usr/lib/x86_64-linux-gnu/liblua5.1.so.0.0.0
    /usr/lib/x86_64-linux-gnu/liblua5.2.a
    /usr/lib/x86_64-linux-gnu/liblua5.2.so
    /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
    /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0
    

    lua.h

    /usr/include/lua5.1/lua.h
    /usr/include/lua5.1/lua.hpp
    /usr/include/lua5.2/lua.h
    /usr/include/lua5.2/lua.hpp
    

    For the caca case, which is disabled by configure.
    libcaca

    /usr/lib/x86_64-linux-gnu/libcaca++.a
    /usr/lib/x86_64-linux-gnu/libcaca++.so
    /usr/lib/x86_64-linux-gnu/libcaca++.so.0
    /usr/lib/x86_64-linux-gnu/libcaca++.so.0.99.18
    /usr/lib/x86_64-linux-gnu/libcaca.a
    /usr/lib/x86_64-linux-gnu/libcaca.so
    /usr/lib/x86_64-linux-gnu/libcaca.so.0
    /usr/lib/x86_64-linux-gnu/libcaca.so.0.99.18
    

    caca.h

    /usr/include/caca.h
    

    I cannot understand why situation is different between lua and caca.

     
  • Ethan Merritt

    Ethan Merritt - 2016-05-31

    OK. So you do have a lua library.
    Autoconfigure finds it, as it should
    You do not have (or configure could not find) a pkg-config file for lua, soIt tells you that you need to add -I/usr/include/lua5.1 to CFLAGS in order to build.

    Does this not work?

     
  • Tatsuro MATSUOKA

    I managed the gnuplot.mk (mxe-octave setting file for package) and add CFLAGS=-I/usr/include/lua5.1 to the coufigure part.

    logfile tells

    checking for LUA... no
    checking for LUA... no
    configure: WARNING: Could not find support for lua using pkg-config.
    checking for library containing luaL_openlibs... -llua5.1
    checking lua.h usability... yes
    checking lua.h presence... no
    configure: WARNING: lua.h: accepted by the compiler, rejected by the preprocessor!
    configure: WARNING: lua.h: proceeding with the compiler's result
    checking for lua.h... yes
    
    ** Configuration summary for gnuplot 5.0.3:
    
    gnuplot will be compiled with the following terminals:
    
      Standalone terminals: yes (always builtin)
        canvas, cgm, context, corel, dumb, dxf, eepic, emf, emtex,
        epslatex, fig, hpgl,latex, metafont, metapost, mif, pcl5,
        postscript, pslatex, pstex, pstricks, qms, svg,
        tek40xx, tek410x, texdraw, tgif, tkcanvas, tpic, vttek
    
      dot-matrix terminals: no (use --with-bitmap-terminals to enable)
        epson, nec, okidata, tandy, and seiko dp414 printers
        hp500c, hpdj, hpljii, hppj, pbm, sixel, starc
    
      X Window System terminal: yes
        (with multi-byte fonts)
        (enable plotting to windows opened by external apps) 
        (with application defaults, in /etc/X11/app-defaults/)
      PDFlib pdf terminal: no (use --with-pdf to enable)
      linux terminal (vga console): no (use --with-linux-vga to enable)
      vgagl terminal ((s)vga console): no (use --with-linux-vga to enable)
      ggi terminal: no (use --with-ggi to enable, requires libggi)
      gpic terminal: no   (use --with-gpic to enable)
      mif terminal: no   (use --with-mif to enable)
      caca terminal: no (requires libcaca >= 0.99.beta15)
      aqua terminal (OSX): no
      libgd-based png, jpeg, and gif terminals: no (see config.log) 
      cairo-based terminals: no (requires cairo>1.2, pango>1.10)
      lua/TikZ terminal: yes 
      wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.10)
      Qt terminal: yes (qt4)
    
      Additional platform-specific or older terminals omitted by default:
       gpic, mif (FrameMaker 3), hp2623a, hp2648, imagen, kyocera 
       pm (makefile.os2), be (BeOS), svga (MSDOS/djgpp)
       sun, windows (several options)
    
    gnuplot will be compiled with the following configurable features:
    
      Mouse support in interactive terminals: yes
      Typing <space> in plot window raises console
      Maximum number of parallel axes: 5 
      Placement of rectangles and other objects: yes 
      Readline library: GNU readline library with  -lncurses
      Command-line history file: yes
      Check current directory for .gnuplot file: no (use --with-cwdrc to enable)
      Sort help/subtopic tables by column: no (use --without-row-help to enable)
      cerf() and other special functions from libcerf: yes
      plugin support for loading external functions: yes 
      Use TeX kpsexpand to search for fonts: no (use --with-kpsexpand to enable)
      Hidden3d optimization (gridbox/quadtree/none): quadtree
      Allow deprecated syntax: no (use --enable-backwards-compatibility)
      Statistical summary of data ("stats" command): yes
    
    gnuplot will install the following additional materials:
    
      LaTeX tutorial: no
      cfg file for epslatex terminal: yes
      TeX *.sty for lua/tikz terminal: yes
      TeX files will be installed in /home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/texmf/tex/latex/gnuplot
                                   (use --with-texdir=DIR to change)
      Help file: yes (always), in ${datarootdir}/gnuplot/5.0/gnuplot.gih
      PostScript prologue files: yes (always)
    
    gcc -DHAVE_CONFIG_H -I. -I..  -I../term -I../term -DBINDIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/bin\" -DX11_DRIVER_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/libexec/gnuplot/5.0\" -DQT_DRIVER_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/libexec/gnuplot/5.0\" -DGNUPLOT_SHARE_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0\" -DGNUPLOT_PS_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0/PostScript\" -DGNUPLOT_JS_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0/js\" -DGNUPLOT_LUA_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0/lua\" -DCONTACT=\"gnuplot-bugs@lists.sourceforge.net\" -DHELPFILE=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0/gnuplot.gih\" -DGNUPLOT_X11=\"`echo gnuplot_x11 | sed 's,x,x,'`\" -DXAPPLRESDIR=\"/etc/X11/app-defaults/\" -DGNUPLOT_QT=\"`echo gnuplot_qt | sed 's,x,x,'`\" -DQTGNUPLOT_DATA_DIR=\"/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/share/gnuplot/5.0/qt\" -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include  -DQT_SHARED -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include/QtNetwork -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include/QtSvg -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include/QtGui -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include -I/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/include/QtCore   -I/usr/include/lua5.1 -MT term.o -MD -MP -MF $depbase.Tpo -c -o term.o term.c &&\
        mv -f $depbase.Tpo $depbase.Po
    
    c++  -g -O2   -L/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/lib -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o eval.o external.o fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o    qtterminal/qt_term.o -lreadline  -lncurses  -lz   -L/home/tatsuro/work/octave/mxe-octave/mxe-octave-lunix-e64/usr/lib -lQtNetwork -lQtSvg -lQtGui -lQtCore  -llua5.1 -ldl -lm -lcerf -liconv
    

    lua is included as you told.
    OK I admit that it is not a bug.

    But why other terminals are rejected by configure but not lua.
    Similar waring are represented for gd, cairo, pango ..etcs but behavior for lua is different from them.

     
    • Ethan Merritt

      Ethan Merritt - 2016-05-31

      Different libraries and packages provide different configuration tools. Some use pkg-config.
      libgd uses "gdlib-config". wx uses "wx-config". caca uses "caca-config". In the case of lua, there is no separate tool "lua-config" and the pkg-config script lua lua does not have a standard name so gnuplot cannot guarantee finding it even if there is one. Because we know that this is a common problem and is easy to fix, the configure script prints a warning and suggests how to fix it.

       
  • Tatsuro MATSUOKA

    OK. I understand the situation. For mxe-octave, we keep --without-lua at the moment in configure part. I am now prosing on octave ML to build the lua and the cairo based stuffs on mxe-octave because octave supports those terminals in gnuplot graphics toolkit.

    Thank for your taking time.

     

    Last edit: Tatsuro MATSUOKA 2016-06-01
  • Ethan Merritt

    Ethan Merritt - 2016-06-01
    • status: open --> closed-wont-fix
     
  • Ethan Merritt

    Ethan Merritt - 2016-06-01
    • status: closed-wont-fix --> open-not-a-bug
     
  • Ethan Merritt

    Ethan Merritt - 2017-02-02
    • status: open-not-a-bug --> closed-not-a-bug
     
  • Ethan Merritt

    Ethan Merritt - 2020-11-07

    See also Bug #2350

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.