1

I am interested in building vim from source. The configure script is not detecting that I have gtk3 (dev) installed, and the only gui vim it builds is Athena. The non-gui portion of vim builds OK.

I believe I have the correct gtk 3.0 dev libraries and headers, but I don't understand why the configure script won't recognize that fact.

My environment is Linux Mint 20. Here is what I have installed pertaining to gtk

% dpkg -l |grep -i libgtk-3-dev
ii  libgtk-3-dev:amd64        3.24.20-0ubuntu1    amd64      development files for the GTK library
% dpkg -l |grep -i libgtk
ii  libgtk-3-0:amd64                              3.24.20-0ubuntu1                      amd64        GTK graphical user interface library
ii  libgtk-3-bin                                  3.24.20-0ubuntu1                      amd64        programs for the GTK graphical user interface library
ii  libgtk-3-common                               3.24.20-0ubuntu1                      all          common files for the GTK graphical user interface library
ii  libgtk-3-dev:amd64                            3.24.20-0ubuntu1                      amd64        development files for the GTK library
ii  libgtk-layer-shell0                           0.1.0-3                               amd64        Wayland Layer Shell protocol desktop component library
ii  libgtk2-perl                                  2:1.24993-1ubuntu2                    amd64        Perl interface to the 2.x series of the Gimp Toolkit library
ii  libgtk2.0-0:amd64                             2.24.32-4ubuntu4                      amd64        GTK graphical user interface library - old version
ii  libgtk2.0-bin                                 2.24.32-4ubuntu4                      amd64        programs for the GTK graphical user interface library
ii  libgtk2.0-common                              2.24.32-4ubuntu4                      all          common files for the GTK graphical user interface library
ii  libgtk3-perl                                  0.037-1                               all          Perl bindings for the GTK+ graphical user interface library
ii  libgtkmm-2.4-1v5:amd64                        1:2.24.5-4ubuntu2                     amd64        C++ wrappers for GTK+ 2 (shared libraries)
ii  libgtkmm-3.0-1v5:amd64                        3.24.2-1build1                        amd64        C++ wrappers for GTK+ (shared libraries)
ii  libgtksourceview-3.0-1:amd64                  3.24.11-2                             amd64        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-3.0-common                   3.24.11-2                             all          common files for the GTK+ syntax highlighting widget
ii  libgtksourceview-4-0:amd64                    4.6.0-1                               amd64        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-4-common                     4.6.0-1                               all          common files for the GTK+ syntax highlighting widget
% dpkg -l |grep -i "^....gtk"
ii  gtk-update-icon-cache                         3.24.20-0ubuntu1                      amd64        icon theme caching utility
ii  gtk2-engines:amd64                            1:2.20.2-5                            amd64        theme engines for GTK+ 2.x
ii  gtk2-engines-murrine:amd64                    0.98.2-3                              amd64        cairo-based gtk+-2.0 theme engine
ii  gtk2-engines-pixbuf:amd64                     2.24.32-4ubuntu4                      amd64        pixbuf-based theme for GTK 2

I also tried apt-get build-dep vim-gtk, but configure still refuses to believe I have gtk on my system.

# apt-get build-dep vim-gtk
Reading package lists... Done
Picking 'vim' as source package instead of 'vim-gtk'
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# make distclean

# ./configure \
>  --enable-multibyte \
>  --enable-perlinterp=dynamic \
>  --enable-rubyinterp=dynamic \
>  --with-ruby-command=/usr/bin/ruby \
>  --enable-pythoninterp=dynamic \
>  --enable-python3interp \
>  --with-python3-config-dir=/usr/lib/python3.8/config-3.8m-x86_64-linux-gnu \
>  --enable-cscope \
>  --enable-gui=auto \
>  --disable-athena-check \
>  --with-features=huge \
>  --with-x \
>  --enable-fontset \
>  --enable-largefile \
>  --disable-netbeans \
>  --with-compiledby="[email protected]" \
>  --enable-fail-if-missing
...snip...
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for Motif... yes
checking whether or not to look for Athena... no
checking whether or not to look for neXtaw... yes
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled no
checking for location of Motif GUI includes... <not found>
checking if neXtaw header files can be found... no
checking X11/SM/SMlib.h usability... yes
checking X11/SM/SMlib.h presence... yes
checking for X11/SM/SMlib.h... yes
checking X11/xpm.h usability... yes
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking X11/Sunkeysym.h usability... yes
checking X11/Sunkeysym.h presence... yes
checking for X11/Sunkeysym.h... yes
checking for XIMText in X11/Xlib.h... yes
no GUI selected; fontset has been disabled

# make
...

# make install
...

# vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct  2 2020 00:05:34)
Included patches: 1-1775
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
...

Per comments, I have used enable-gui=gtk3. This resolved my problem. I tried this previously but without success. However I believe that was due to not having the dev version of gtk3 installed at the time.

For completeness, here is the output of configure, make, and vim per the suggestions from @christian-brabandt ...

 ./configure --enable-gui=gtk3 --enable-fail-if-missing
configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... 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 for gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
_...snip..._
checking --enable-fontset argument... no
checking for xmkmf... no
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking if X11 header files can be found... yes
checking for _XdmcpAuthDoIt in -lXdmcp... yes
checking for IceOpenConnection in -lICE... yes
checking for XpmCreatePixmapFromData in -lXpm... yes
checking if X11 header files implicitly declare return values... no
checking size of wchar_t is 2 bytes... no
**checking --enable-gui argument... GTK+ 3.x GUI support**
checking for pkg-config... /usr/bin/pkg-config
checking --disable-gtktest argument... gtk test enabled
**checking for GTK - version >= 3.0.0... yes; found version 3.24.20**
checking version of Gdk-Pixbuf... OK.
checking for glib-compile-resources... /usr/bin/glib-compile-resources
checking glib-compile-resources... usable.
checking --disable-icon-cache-update argument... not set
checking for gtk-update-icon-cache... /usr/bin/gtk-update-icon-cache
checking --disable-desktop-database-update argument... not set
checking for update-desktop-database... /usr/bin/update-desktop-database
checking X11/SM/SMlib.h usability... yes
checking X11/SM/SMlib.h presence... yes
checking for X11/SM/SMlib.h... yes
checking X11/xpm.h usability... yes
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking X11/Sunkeysym.h usability... yes
checking X11/Sunkeysym.h presence... yes
checking for X11/Sunkeysym.h... yes
checking for XIMText in X11/Xlib.h... yes
X GUI selected; xim has been enabled
...



# make
...



# ./src/vim -es -Nu NONE +'pu=execute(\"version\") | %p | qa!' | grep version
Huge version with GTK3 GUI.  Features included (+) or not (-):


4
  • 4
    Does it work after apt-get build-dep vim-gtk? Oct 1, 2020 at 18:50
  • @christian-brabandt No still same behavior. Updating my question with these results. Oct 2, 2020 at 3:51
  • 1
    What's the output of ./configure if you run it like this: ./configure --enable-gui=gtk3 --enable-fail-if-missing? On ubuntu 16.04, it's enough to get gtk3. You can check that by running make, then after the compilation, ./src/vim -es -Nu NONE +'pu=execute(\"version\") | %p | qa!' | grep version.
    – user938271
    Oct 2, 2020 at 10:06
  • @christion-brabandt Using enable-gui=gtk3 worked. Thank you. I tried it previously, without success. But as I think back, it is quite possible I didn't have the dev version of gtk3 at that time. Nevertheless, isn't it reasonable to expect enable-gui=auto to detect that gtk3dev is installed? GTK+ 3.x has been around for many years (tho I've no idea when vim first supported 3.x) Oct 2, 2020 at 11:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.