Opened 12 years ago

Closed 5 years ago

#1684 closed defect (fixed)

configure GRASS 6 with X11 support

Reported by: martinl Owned by: grass-dev@…
Priority: major Milestone: 6.4.6
Component: Compiling Version: svn-releasebranch64
Keywords: configure, X11, debian Cc:
CPU: x86-64 Platform: Linux

Description

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?

Change History (14)

comment:1 by hamish, 12 years ago

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

comment:2 by hamish, 12 years ago

simpler, you might also try

apt-get build-dep grass

comment:3 by wenzeslaus, 12 years ago

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)

in reply to:  3 comment:4 by martinl, 12 years ago

Replying to 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

in reply to:  1 comment:5 by martinl, 12 years ago

Replying to hamish:

what version of Debian?

Debian sid (unstable)

just in releasebranch_6_4 or in all branches?

All branches

comment:6 by hamish, 12 years ago

Replying to 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 martinl:

Debian sid (unstable)

did you try running

apt-get build-dep grass

?

were there any clues in config.log?

Hamish

in reply to:  6 comment:7 by martinl, 12 years ago

Replying to hamish:

Replying to 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.

comment:8 by hamish, 11 years ago

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

comment:9 by hamish, 11 years ago

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

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

comment:10 by hamish, 10 years ago

Keywords: debian added
Milestone: 6.4.36.4.4
Priority: normalmajor

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

in reply to:  10 comment:11 by glynn, 10 years ago

Replying to 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.

comment:12 by neteler, 9 years ago

Configuring GRASS 64 on Debian Jessie with

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

# do not use CFLAGS -Werror-implicit-function-declaration!

it works:

X11 support:                yes

comment:13 by neteler, 8 years ago

Milestone: 6.4.46.4.6

comment:14 by martinl, 5 years ago

Resolution: fixed
Status: newclosed

Seems to be solved.

Note: See TracTickets for help on using tickets.