How to Enable Multilib on a Stock Slackware 13.37 x86_64 Bit Linux System


How to Enable Multilib on a Stock Slackware 13.37 x86_64 Bit Linux System


* Enable Multilib to be able to run both 32 and 64 bit programs on the same Slackware 13.37 x86_64 Linux system.


Instructions:

First download all the packages from alien’s repository. Issue the command below:

$ wget -r -l1 --no-parent http://connie.slackware.com/~alien/multilib/13.37/ && cd connie.slackware.com/~alien/multilib/13.37/

then upgrade the packages

$ su -c'upgradepkg --reinstall --install-new *.t?z'

input your root password, and let it do its job.

This sets up your system as “multilib enabled.” Next you need to download, and install the compat32 packages that allow 32 bit applications to run on your system. The second part is longer but the procedure is basically the same, issue the command.

$ wget -r --no-parent http://connie.slackware.com/~alien/multilib/13.37/slackware64-compat32/ && cd connie.slackware.com/~alien/multilib/13.37/slackware64-compat32/

From the slackware64-compat32/, Go into each subdirectory with cd command (example: $ cd a-compat32, to go into the a-compat32/ subdirectory), input cd .. to go back to the previous directory and then change into the next subdirectory, and then issue the command below within each subdirectory:

$ su -c'upgradepkg --reinstall --install-new *.t?z'

input your root password, and let it do its job.

After doing all of each subdirectory, your system will be Multilib.

The Subdirectory list:
a-compat32/
ap-compat32/
d-compat32/
l-compat32/
n-compat32/
x-compat32/
xap-compat32/

BUT, if you’re building a SlackBuild though please read the following below:

* Compiling 32-bit programs
In case you need to compile a 32-bit program (wine and grub are two examples of open source programs that are 32-bit only) you first configure your shell environment by running the command:

$ ./etc/profile.d/32dev.sh

Note the 'dot' in front of the filename - that is actually part of the commandline! Running this command changes or creates several environment variables. The effect of this is, that 32-bit versions of binaries are preferred over 64bit binaries when you compile source code - you will be running a 32bit compilation. The effect will last until you logout from your shell.

In this changed environment, you will be able to use standard SlackBuilds to build 32-bit packages for Slackware64. There are two things to keep in mind:
  1. You will have to define the ARCH variable as 'x86_64' even though you are compiling a 32-bit program!
    This is related to the triplet of “$ARCH-slackware-linux” which is normally used in the “configure” command. Also, try setting the ARCH to for instance “i486” and you will see that the CFLAGS definition for that architecture will result in gcc errors like ”compiler can not create executables”. This is related to the design of a SlackBuild script. Rather than editing the script and change/remove CFLAGS definitions, you can set the ARCH to “x86_64” and save yourself some time. The real work is being done by the 32dev.sh script.
  2. You will have to edit the SlackBuild if it wants to use 'lib64/' directories for “$ARCH = x86_64”. You have to force it to use 'lib/' directories instead. Usually, this is accomplished by finding a definition like:


          LIBDIRSUFFIX="64"




    and changing this line to


          LIBDIRSUFFIX=""


Reference Links -
http://www.hydronitrogen.com/374/slackware-13-0-and-13-1-multilib-quick-and-easy-script/   (last i checked it was defunct/down)
http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib#compiling_32-bit_programs
http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib

*Note1: When installing proprietary NVIDIA drivers the stock 64 bit drivers will haveboth 32 and 64 bit drivers unless otherwise mentioned, by making the system multilib enabled ahead,you can install both versions drivers and it will work, if nvidia drivers were installed first with only 64 bit before enabling multilib, you must rebuild/reinstall the proprietary nvidia drivers to do so.

*Note2: Of course needless to say, but for brevity, Root priviledges are needed for these instructions to work.

0 comments:

Post a Comment