[GRASS-dev] [GRASS GIS] #1684: configure GRASS 6 with X11 support

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------
Compiling GRASS 6 with

{{{
--with-x --x-libraries=/usr/lib/x86_64-linux-gnu
}}}

(using Debian GNU/Linux, packages `libxt-dev` and `libx11-dev` installed)

result is no X11 support detected

{{{
...
checking for X... no
...
X11 support: no
}}}

Any idea what could be wrong?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1684&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by hamish):

Hi,

what version of Debian? just in releasebranch_6_4 or in all branches?

any clues about a missing header file near the end of config.log?

the following works for me on Squeeze, adjust as needed:
{{{
renice +17 -p $$

CFLAGS="-ggdb -march=native -Wall -Werror-implicit-function-declaration" \
   ./configure \
     --with-tcltk-includes=/usr/include/tcl8.5 --with-cairo \
     --with-motif --with-python=/usr/bin/python2.6-config \
     --with-readline --with-cxx --with-odbc --with-sqlite \
     --with-freetype --with-freetype-includes=/usr/include/freetype2 \
     --with-proj-share=/usr/share/proj \
     --enable-64bit --with-pthread -with-openmp \
     --with-wxwidgets=/usr/lib/wx/config/gtk2-unicode-release-2.8 \
     --with-postgres-includes=/usr/include/postgresql \
     --with-geos \
     2>&1 | tee config_log.txt

time make -j 8
}}}

the following package requirements are for Debian's Sid, but with minor
tweaks will work with other versions:
{{{
Build-depends:
   autoconf2.13, autotools-dev,
   debhelper (>= 8),
   doxygen,
   fakeroot,
   flex, bison,
   graphviz,
   lesstif2-dev,
   libcairo2-dev,
   libfftw3-dev,
   libfreetype6-dev,
   libgdal-dev | libgdal1-dev (>= 1.5.0),
   libglu1-mesa-dev | libglu1-xorg-dev,
   libjpeg-dev,
   libpng-dev | libpng12-dev,
   libtiff5-dev | libtiff4-dev,
   libmysqlclient-dev | libmysqlclient15-dev,
   libncurses5-dev,
   libpq-dev,
# proj-bin needed for nad2bin during config
   libproj-dev, proj-bin,
   libreadline-dev | libreadline6-dev,
   libsqlite3-dev,
   libxmu-dev,
#install optipng if compressing the PNG images in the programmers' manual
# optipng,
   python (>= 2.6.6-3~),
   python-wxgtk2.8, libwxgtk2.8-dev,
   python-dev,
   tcl-dev (>= 8.5), tk-dev (>= 8.5),
   unixodbc-dev
}}}

If config.log does show a missing header file, you can use 'apt-file' to
search for which package provides it.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by hamish):

simpler, you might also try
{{{
apt-get build-dep grass
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by wenzeslaus):

Same or similar problem on Ubuntu 12.04 32bit on 64bit machine for GRASS
7.

Even after setting the proper path to X11:
   --x-includes=/usr/include/ --x-libraries=/usr/lib/
and succesfull configure with ''X11... yes'', compilation itself fails
(e.g for nviz lib). The problem was missing header file `StdCmap.h` (or
files) from package libxmu-dev.

For me the solution was to install package libxmu-dev.

This header file(s) should be explicitly checked by the configure script
to avoid these confusions.

BTW: There are several other issues with configure: it does not check
wxPython version (instead, some error dialog is shown on start up) and it
does not check presence of numpy (temporal and gui dependency, Ubuntu
package python-numpy).

(Related wiki page for Ubuntu:
http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by martinl):

Replying to [comment:3 wenzeslaus]:
> Same or similar problem on Ubuntu 12.04 32bit on 64bit machine for GRASS
7.
>
> Even after setting the proper path to X11:
> --x-includes=/usr/include/ --x-libraries=/usr/lib/

strangely adding `--x-includes` (even it points to standard include dir)
solves problem
{{{
X11 support: yes
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by martinl):

Replying to [comment:1 hamish]:
> what version of Debian?

Debian sid (unstable)

> just in releasebranch_6_4 or in all branches?

All branches

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by hamish):

Replying to [comment:3 wenzeslaus]:
> BTW: There are several other issues with configure: it does not
> check wxPython version (instead, some error dialog is shown on
> start up)

The Debian build rules file uses this:
{{{
./configure \
...
    --with-wxwidgets=/usr/bin/wx-config \
...
}}}

which results in:

{{{
checking whether to use wxWidgets... yes
checking for wx-config... /usr/bin/wx-config
checking wxWidgets version... 2.8.12
checking for wx/wxprec.h... yes
}}}

Replying to [comment:5 martinl]:
> Debian sid (unstable)

did you try running
  apt-get build-dep grass
?

were there any clues in config.log?

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by martinl):

Replying to [comment:6 hamish]:
> Replying to [comment:3 wenzeslaus]:
> > BTW: There are several other issues with configure: it does not
> > check wxPython version (instead, some error dialog is shown on
> > start up)
>
> The Debian build rules file uses this:
{{{
> ./configure \
> ...
> --with-wxwidgets=/usr/bin/wx-config \
> ...
}}}

Vaclav has pointing to wxPython not wxWidgets. wxWidgets is optional
requirement for compilation (eg. `wximgview` and other few modules).
wxPython is not used during compilation, it's just requirement when
running wxGUI by the user. This is reason why it's not included in
configuration script.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by hamish):

I see the same on debian/wheezy and ubuntu 12.04, no Xmons built.

worked around with:
  LDFLAGS="-L/usr/lib/i386-linux-gnu"

or
  --x-includes=/usr/include/X11 --x-libraries=/usr/lib/i386-linux-gnu

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
----------------------------+-----------------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11 | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------

Comment(by hamish):

--x-includes=/foobar --x-libraries=/usr/lib/i386-linux-gnu

also works, but leaving off --x-includes= entirely does not.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
------------------------------------+---------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.4
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11, debian | Platform: Linux
      Cpu: x86-64 |
------------------------------------+---------------------------------------
Changes (by hamish):

  * keywords: configure, X11 => configure, X11, debian
  * priority: normal => major
  * milestone: 6.4.3 => 6.4.4

Comment:

Hi,

I found a cause and solution to this on Debian/Wheezy. Using
   CFLAGS="... -Werror-implicit-function-declaration"
on the ./configure like triggers an error in the test compile for X:

(config.log)
{{{
...
configure:4791: checking for W11
configure:4819: checking for X
configure:4884: gcc -E conftest.c >/dev/null 2>conftest.out
configure:4960: gcc -o conftest -ggdb -march=amdfam10 -Wall -Werror-
implicit-function-declaration -fno-common -Wextra -Wunused -Wl
,--export-dynamic conftest.c -lXt 1>&5
configure: In function 'main':
configure:4956:1: error: implicit declaration of function 'XtMalloc'
[-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
configure: failed program was:
#line 4953 "configure"
#include "confdefs.h"

int main() {
XtMalloc()
; return 0; }
configure:5627: checking whether to use Curses
configure:5646: checking for curses.h
...
}}}

who's forgetting to do the #include? a bug in autoconf or one of ours?

./configure'ing without -Werror-implicit-function-declaration leads to X
being detected and built.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#1684: configure GRASS 6 with X11 support
------------------------------------+---------------------------------------
Reporter: martinl | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.4
Component: Compiling | Version: svn-releasebranch64
Keywords: configure, X11, debian | Platform: Linux
      Cpu: x86-64 |
------------------------------------+---------------------------------------

Comment(by glynn):

Replying to [comment:10 hamish]:

> who's forgetting to do the #include? a bug in autoconf or one of ours?

Linking tests normally provide their own dummy prototype rather than
including headers, but the test for the X libraries does neither.

I suppose that makes it a bug in autoconf. It's not one which we can
readily work around, other than by explicitly removing that particular
switch from CFLAGS for the duration of the AC_PATH_XTRA macro.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1684#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>