Re: Problem compiling glib



Sergei Steshenko <sergstesh yahoo com>:

> --- On Fri, 4/5/13, Chris Fisichella <chris communityrenewables com> wrote:
>
> From: Chris Fisichella <chris communityrenewables com>
> Subject: Re: Problem compiling glib
> To: "Patrick Welche" <prlw1 cam ac uk>
> Cc: "Sergei Steshenko" <sergstesh yahoo com>, gtk-list gnome org
> Date: Friday, April 5, 2013, 4:49 AM
>
> Patrick Welche <prlw1 cam ac uk>:
>
>> On Thu, Apr 04, 2013 at 11:04:02AM -0700, Sergei Steshenko wrote:
>>> Interestingly enough my self-built 'xmllint' which is a part of
>>> libxml2-2.9.0 doesn't at all show dependency on 'readline':
>>
>> Indeed - my xmllint also doesn't depend on readline. I looked on an ubuntu
>> system and found that there it did, so the original bug report made
>> more sense...
>>
>> Cheers,
>>
>> Patrick
>>
>
> Thanks for the debugging help. I noticed how Sergei has libraries in
> other places besides /usr/local.
>
> I am not familiar -rpath you mentioned earlier. Where can I find
> information about that?
>
> I am going to try to recompile the dependencies a little more
> methodically. I'll include a build of libxml2. When I install either
> dbus or readline I find gdm breaks. I'll keep an eye out for locating
> libraries in other places and see how I can use that.
>
> Thanks,
> Chris
>
>
> On 'rpath' - you need to carefully read 'man ld', possibly online:
> http://man7.org/linux/man-pages/man8/ld.so.8.html .
>
>
> I do not use 'rpath' explicitly, i.e. I leave it to 'configure' to decide.
>
> Do not install anything into system locations. I am building a lot of
> stuff as non-root user using my own AppsFromScratch.
>
> FWIW, see attached autogenerated by AppsFromScratch
> 'config_wrapper.sh' used by my tool to run 'configure' of
> libxml2-2.9.0. You can figure out dependencies and other stuff (e.g.
> PKG_CONFIG_PATH settings) needed to build libxml2-2.9.0.
>
> ...
>
> Also attached 'config_wrapper.sh' for glib-2.34.3 - it's trivial to
> understand which file is related to which library from the contents.
>
> Regards,
>   Sergei.

Good Morning Patrick and Sergei,

I used both of your ideas to get things going. That ldconfig -v is a very useful command. Also, removing the reference in /etc/ld.so.conf.d/libc.conf /usr/local allowed me to  install libraries and not cripple my system.

Sergei, I looked at AppsFromScratch and it was a little too much for me to take in, but I did adopt your very good idea to make a config_wrapper.sh file. I am now using that to build and things are going much smoother.

So, I should mention, I got glib to compile. I then moved on. For those who come across this list, I have the following suggestions:
1. check out /etc/ld.so.conf.d  If any of the files reference /usr/local, comment that line out.
2. When you need to use something you built, try the config_wrapper approach. Here is a typical file. It resides in the build directory you download from the internet:
#!/bin/sh

cd /home/sensing/gaf-gEDA/libXi-1.7

PATH=/usr/local/bin:/usr/bin:/bin
export PATH

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
export PKG_CONFIG_PATH

LDFLAGS=''
export LDFLAGS

XDG_DATA_DIRS=''
export XDG_DATA_DIRS

CPPFLAGS=''
export CPPFLAGS


echo ""
echo "*** sorted env BEGIN ***"
env | sort
echo "*** sorted env END   ***"
echo ""


./configure  --prefix=/usr/local/ 2>&1 1> ~/130407_057a_libXi-1.7_configure.log

#This is what the make file looks like:
#LD_LIBRARY_PATH=/usr/local/lib make 2>&1 | tee ~/130407_057b_libXi-1.7_make.log
#for make install:
#sudo LD_LIBRARY_PATH=/usr/local/lib make install 2>&1 | tee ~/130407_057c_libXi-1.7_sudo_make_install.log

Make sure you do a
chmod u+x config_wrapper.sh
to make it an executable script.

Here, I am trying to build libXi. The line after the /bin/sh is just the directory you downloaded. The next lines don't change. From download to download, I update the count numbers (057 in this example) and the library names for the log files. It's handy to go back and check things.

When the file is ready, execute ./config_wrapper.sh on the command line and it will run the configure command. You won't see text, except for errors and warnings because I have redirected output to a log file. After you satisfy all the warnings by installing other packages in the same manner, you copy and paste the make and make install commands to the command line.

The commented line that starts with LD_LIBRARY path is the make command. Now that we have removed /usr/local from ld.so.conf.d,  you have sort of a sandbox. When you want to reference your compiled work, you need to prepend the command with:
LD_LIBRARY_PATH=/usr/local/lib

When this line runs, looks for compile time errors and fix them if you can.

The line that starts with sudo LD_LIBRARY_PATH= is the make install command. Just copy it to the command line to install the software.

Now on the build for glib, I had to temporarily reinstate the /etc/ld.so.conf.d  reference to /usr/local/ I think it had something to do with python2.7 not being able to find it's libraries. After the build, I just commented it back out. But, that might have also been before I realized I need to have LD_LIBRARY_PATH before both make and make install.

Thank you both for the help. I do appreciate it!
Best Regards,
Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]