LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting Ubuntu include library path (https://www.linuxquestions.org/questions/linux-newbie-8/setting-ubuntu-include-library-path-592047/)

cbabbage 10-15-2007 04:27 PM

Setting Ubuntu include library path
 
What's the best way to add to the include library path in Ubuntu? I have tried to install a number of different packages and am constantly coming up with problems because packages such as Tk and gtk which are already installed are not being picked up by the library path.

weibullguy 10-15-2007 04:53 PM

Without seeing the actual errors you're receiving and where in the process you receive them (configure, build, or install) one can only guess what env var needs to be set. You are on *buntu, so the most likely cause of your problems is missing development packages for Gtk and Tk on your system. Install the Gtk and Tk development packages.

Gtk2 use a metadata file to assist the configuration of other programs, Gtk1 uses a config script. Don't know which one you're using because you don't provide sufficient information to troubleshoot your problem. The env var that needs to be set to pick up these respective files is different. If things aren't installed in non-standard locations, you shouldn't need to muck with env vars anyway.

cbabbage 10-15-2007 06:46 PM

The development packages for Tk and Gtk are installed. The errors are happening at the compile stage. For example, I'm trying to install Grass
GIS. Tk8.4 is already installed and the header library is in /usr/include. But the configure script keeps stopping with a message along the lines of 'unable to find tk.h'
Any ideas?

weibullguy 10-15-2007 09:13 PM

OK, is it failing the build (compile stage) or the configure (configure script)? Generally one would post the last 20-30 lines of the failed build (if it really is the build that is failing), not just a paraphrase of the error message. The error message is important, but it's also important to know what the package was trying to do.

cbabbage 10-16-2007 04:29 PM

Here are the last twenty or so lines I get when I run the configure script. As mentioned before, tk.h and other tk files are installed and sitting in /usr/include. Nothing I do has worked to get the script to recognize the tk files, including to editing ld.so.conf.

checking whether to use JPEG... yes
checking for location of JPEG includes...
checking for jpeglib.h... yes
checking for location of JPEG library...
checking for jpeg_start_compress in -ljpeg... yes
checking whether to use GDAL... yes
checking for gdal-config... /usr/local/bin/gdal-config
checking for GDALOpen... yes
checking whether to use TIFF... yes
checking for location of TIFF includes...
checking for tiffio.h... yes
checking for location of TIFF library...
checking for TIFFOpen in -ltiff... yes
checking whether to use PNG... yes
checking for location of PNG includes...
checking for png.h... yes
checking for location of PNG library...
checking for png_read_image in -lpng... yes
checking whether to use Tcl/Tk... yes
checking for location of Tcl/Tk includes...
checking for tcl.h... yes
checking for tk.h... no
configure: error: *** Unable to locate Tk includes.

I had similar problems trying to compile wxWidgets. I was getting a similar message regarding Gtk+, which is installed under /usr/include. In that case I successfully got around it by compiling wxWidgets with
the x11 option.

Any ideas?

weibullguy 10-16-2007 06:07 PM

Tk creates a shell script containing installation information that is used by other packages. The script is called tkConfig.sh. Mine are installed in /usr/lib and /usr/lib64. Sometimes a package needs to be told where to look for this script. Generally packages that do or may use Tcl or Tk have a configure option to point to the configure script. For example, the configure script for R needs to be passed --with-tk-config=/usr/lib/tkConfig.sh or it won't find the tk stuff. Take a look at the output of ./configure --help to see if there is a similar option for the package(s) you're trying to install.

cbabbage 10-17-2007 04:18 PM

The procedure above didn't fix the problem, however using the --help option on configure, which I hadn't been aware of before, has opened up several lines of enquiry. I think the problem is with the way Tcl Tk has been installed. The configure script is looking for a single TclTk directory whereas I have Tcl and Tk in two different directories because that's how they installed from the Ubuntu disk.
My plan at this stage is to uninstall Tcl Tk, get hold of the source code and work on the problem from that angle.

weibullguy 10-17-2007 04:49 PM

What, exactly, are you trying to install?

cbabbage 10-17-2007 05:51 PM

I'm trying to install GRASS GIS.

weibullguy 10-17-2007 06:39 PM

Too many dependencies that I don't want to install. But while I was poking around the GRASS GIS website, I saw that they have an Ubuntu package. Why not just install that?

cbabbage 10-17-2007 08:18 PM

Two reasons - my home computer isn't attached to the internet, and I'm trying to install software from source in order to learn about Linux. Getting the actual package up and running is less important than expanding my knowledge base.

cbabbage 10-21-2007 06:42 PM

Success! Reinstalling TclTk using the source package did the trick, though I'm not absolutely sure way. I now have GRASS GIS up and running.


All times are GMT -5. The time now is 11:27 AM.