/usr/lib and /usr/lib4

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
Papasot
Donor
Posts: 250
Joined: 3. May 2015, 18:37
Location: Patras, Greece

/usr/lib and /usr/lib4

Post by Papasot »

When I started using Salix (64-bit), I realized the default library directory is /usr/lib64 instead of /usr/lib, so I had to change the installation scripts for my own libraries accordingly. However, the /usr/lib directory does exists, and even some SBo packages assume the dependencies they need installed should be there. For example, the maxima SBo installation script looks for sbcl in /usr/lib and since it doesn't find it there, installation fails. A simple symbolic link of /usr/lib64/sbcl to /usr/lib/sbcl solves the problem in this particular case. This is clearly a SBo issue, and has nothing to do with Salix itself. However, it made me finally ask about, just to clarify things:.

(1) I assume /usr/lib is for 32-bit libraries. Using file on the libraries installed in /usr/lib verifies that, for example:

Code: Select all

pap[~]$ file /usr/lib/dri/fglrx_dri.so  
/usr/lib/dri/fglrx_dri.so: ELF 32-bit LSB  shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
Am I correct? And, if /usr/lib is for 32-bit libraries, and since both maxima and its dependency sbcl are both installed in /usr/lib64, why the maxima installation script assumes sbcl is in /usr/lib? Just a badly-maintained SBo package, or I am missing something here?

(2) Is it safe to symlink /usr/lib64/foo to /usr/lib/foo as a workaround, to make a given SBo package "foo" being installed and working? I am asking because blindly messing up with library directories is not the safest thing in the world (I had issues with that in the past on Debian, albeit rather minor issues).
A pleasant detail in this forum: several people pick a picture of their pet as their avatar. Who am I to do otherwise? ;-)
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: /usr/lib and /usr/lib4

Post by gapan »

Papasot wrote:or I am missing something here?
Do you have multilib installed? If you do, then you should know that you should be expecting such problems. Multilib is not supported by SBo, or Salix in any way. If you have a pure 64bit installation, there should never be any executables or libraries in /usr/lib.
Papasot wrote:(2) Is it safe to symlink /usr/lib64/foo to /usr/lib/foo as a workaround, to make a given SBo package "foo" being installed and working?
Definitely no.
Image
Image
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: /usr/lib and /usr/lib4

Post by laprjns »

Papasot wrote:For example, the maxima SBo installation script looks for sbcl in /usr/lib and since it doesn't find it there, installation fails
Are you sure about this. I just built maxima on a clean install of Salix64 and the only dependency that it needed was clisp. It built and worked (as far as i can tell) without scbl installed. Also the maxima slackbuild script has all the logic to put the libraries in the appropriate directory based on the architecture of the build machine.
BTW, I know jack about maxima, lisp and scbl so my comments are based on my observation of building maxima,

ps to gapan, need to add clisp to the maxima required in SBoAdd. Also sbcl needs clisp and tetex, but i still couldn]t build it, failing on:
Some of the contrib modules did not build successfully or pass their self-tests. Failed contribs: sb-concurrency
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
User avatar
Papasot
Donor
Posts: 250
Joined: 3. May 2015, 18:37
Location: Patras, Greece

Re: /usr/lib and /usr/lib4

Post by Papasot »

gapan wrote:
Papasot wrote:or I am missing something here?
Do you have multilib installed? If you do, then you should know that you should be expecting such problems. Multilib is not supported by SBo, or Salix in any way. If you have a pure 64bit installation, there should never be any executables or libraries in /usr/lib.
Definitely no.
Yes, I am aware of the multilib issues, and I never asked for multilib in all my Salix installations. The following directories are however present in /usr/lib: ConsoleKit, siconv, udisks2 (on one of my computers additional directories are there, but that's because of the Radeon proprietary graphics driver installed, which also installs 32-bit compatibility libraries without asking me). Now, ConsoleKit contains shell scripts, and udisks2 contains an executable (presumably a daemon script?), which seems to be 64-bit:

Code: Select all

pap[udisks2]$ file udisksd 
udisksd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
but it's still in /usr/lib, not /usr/lib64.
laprjns wrote:I just built maxima on a clean install of Salix64 and the only dependency that it needed was clisp. It built and worked (as far as i can tell) without scbl installed.
Yes, maxima builds perfectly with clisp, but I tried to use sbcl instead, because clisp uses object code while sbcl has a more aggressive compiler, thus it should be faster - which is crucial for Computer Algebra Systems like maxima. I am supposed to have that choice, and even maxima developers recommend sbcl instead of clisp. Indeed, it works fine with sbcl, except that the SBo installation script assumes sbcl is in /usr/lib instaed of /usr/lib64.
laprjns wrote:Also the maxima slackbuild script has all the logic to put the libraries in the appropriate directory based on the architecture of the build machine.
That explains the fact the SBo looks for sbcl in /usr/lib. I guess the SBo was built on a 32-bit system, so in that particular case it is safe to use a symlink of sbcl on /usr/lib as a workaround. Alternatively, I could modify the SBo.

ps to laprjns: By adding clisp as a dependency, you are forcing users to use clisp while sbcl is also a choice and, at least from what I know by discussing the issue in the maxima mailing lists, most maxima devs use sbcl and openly recommend it. For TeX/LaTeX, use Texlive netinstall; tetex is very old and no longer maintained. SBo's Texlive never worked for me too, better use the netinstall instead, which works perfectly. See that gapan's post and discussion there for more details.
A pleasant detail in this forum: several people pick a picture of their pet as their avatar. Who am I to do otherwise? ;-)
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: /usr/lib and /usr/lib4

Post by gapan »

Papasot wrote:Now, ConsoleKit contains shell scripts, and udisks2 contains an executable (presumably a daemon script?), which seems to be 64-bit but it's still in /usr/lib, not /usr/lib64.
Yes, there is a very limited number of packages that still puts stuff in there. And in the case of udisks2 it is actually an executable. That's really only the exception to the rule though. Maybe the location for that executable is hardcoded in the udisks source somehow and Pat didn't bother to fix it.
Papasot wrote:Indeed, it works fine with sbcl, except that the SBo installation script assumes sbcl is in /usr/lib instaed of /usr/lib64.
I haven't tried it but I don't think so. If it does, it should be a bug with the slackbuild. But looking in the sbcl.SlackBuild, I see this:

Code: Select all

# Fixup /usr/lib -> /usr/lib64 if on x86_64:
if [ "$ARCH" = "x86_64" ]; then
  mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX}
fi
which means it always goes to /usr/lib64 on a 64bit system.
Papasot wrote:By adding clisp as a dependency, you are forcing users to use clisp while sbcl is also a choice and, at least from what I know by discussing the issue in the maxima mailing lists, most maxima devs use sbcl and openly recommend it.
Again, I haven't really checked, but it seems to be a bootstrapping problem. sbcl seems to need another lisp to be installed so it can be built and I don't think that is mentioned anywhere in the README.
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: /usr/lib and /usr/lib4

Post by mimosa »

As I understand it, the issue is a double one: maxima requires a Lisp (the maxima SlackBuild stipulates clisp, a reasonable choice in that it is available as a binary package in the Slackware repositories, but as Papasot says, perhaps not as efficient as sbcl would be). This is a runtime dependency for maxima.

sbcl, on the other hand, requires an installed Lisp to build ("bootstrapping"; similar to the situation with Haskell / ghc). It also requires TeX, for its documentation (the SlackBuild is not the best option here, and there is a forum post explaining the alternative). However, even when these build dependencies are present, the SlackBuild still doesn't complete properly. As result, not only is sbcl not available as a binary package, it can't currently be built using the SlackBuild. I believe this is a long-standing issue, because I tried unsuccessfully to package it for Salix 14.1.
djemos
Salix Warrior
Posts: 1464
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: /usr/lib and /usr/lib4

Post by djemos »

scbl 1.3.1 SLKBUILD Before build install tetex clisp and linuxdoc-tools

Code: Select all

sudo slapt-get -i tetex clisp linuxdoc-tools 
and

Code: Select all

fakeroot slkbuild -X
The x86_64 package is build on slackware current and it is for 14.2 slackware
After build and install the package type

Code: Select all

source /etc/profile.d/sbcl.sh
to not have to reboot or log out
then run sbcl
djemos
Salix Warrior
Posts: 1464
Joined: 29. Dec 2009, 13:45
Location: Greece

Re: /usr/lib and /usr/lib4

Post by djemos »

maxima package 32 and 64 bit for salix 14.1
Post Reply