PDA

View Full Version : Need help building optimised ATLAS



Aielyn
March 2nd, 2012, 03:01 PM
Nowadays, Ubuntu doesn't provide pre-built binaries for the ATLAS libraries. Here's what the libatlas3gf-base package has to say:

"Before version 3.8.3-25, optimized binary packages were provided.
However, due to the fact that most Atlas optimisation are done at build time,
it has been decided to remove them and give priority to locally built packages.

For more information on how to rebuild locally atlas, see the section:
"Building Optimized Atlas Packages on your ARCH" in README.Debian"

Now, I've tried following the instructions in README.Debian - after a few misfires, I got it to generate the custom deb file... but when I try to install from it (via command line, as attempts to do it via software center just don't work - it never stops loading), it says:

"../libatlas3gf-base_3.8.4-3build1+custom10_amd64.deb: line 1: syntax error near unexpected token `newline'
../libatlas3gf-base_3.8.4-3build1+custom10_amd64.deb: line 1: `!<arch>'"

Now, with this not working, I tried a different approach, and actually downloaded the most up-to-date ATLAS source code, and tried to "make" it in the regular manner - the main result is two files: libsatlas.so and libtatlas.so, put into /usr/local/atlas/lib when I run "make install" - now, I have no idea what I'm meant to do with these, or how to link them into the system properly (as it doesn't actually link anything in, as far as I can tell). Also, while the instructions seem to say that you should get lapack libraries out as well, I can find no evidence of such libraries.

(EDIT: Specifically, for this approach, I tried the instructions here (http://www.scipy.org/Installing_SciPy/Linux#head-d4f4ebb0b19b66ceccb668d84e48967a3351ca40))

Can anyone help me with this? I'd really like for my system to be capable of, for instance, actually using both cores when doing things involving ATLAS functions. I'm actually hoping that I can also install octave 3.6.1 once this is done (the BLAS that it's detecting at the moment doesn't even register as being 64 bit, even though my system is, and it's not the i386 version of libblas3gf that is installed), so if there's any advice on that front as well, I'd be grateful (but it's not essential, at this point - ATLAS is the main concern right now).


UPDATE: OK, I got it (the deb file generated by the method given in README.Debian) to at least install, now... but on trying to install octave, I still get the message that the BLAS isn't 64 bit... which confuses me. Does this mean it hasn't installed correctly, that it hasn't correctly compiled as 64 bit, or that there's more steps that I'm not aware of?

earlycj5
March 3rd, 2012, 07:08 AM
I have notes on building ATLAS for my R installation on my 64bit machines.

Here's the configuration process that I use.



../configure -b 64 -D c -DPentiumCPS=your value here --prefix=/usr --with-netlib-lapack-tarfile=directory holding lapack-3.3.1.tgz --shared
make build
make check
make time
make install


R works fine with this. Maybe that will help?

Aielyn
March 3rd, 2012, 07:47 AM
I have notes on building ATLAS for my R installation on my 64bit machines.

Here's the configuration process that I use.



../configure -b 64 -D c -DPentiumCPS=your value here --prefix=/usr --with-netlib-lapack-tarfile=directory holding lapack-3.3.1.tgz --shared
make build
make check
make time
make install


R works fine with this. Maybe that will help?

Thanks, but I think I got it working properly enough, now. It looks like Octave's "--enable-64" is actually about enabling 64 bit integer functionality, whereas ATLAS doesn't actually have that functionality implemented, hence why it says the BLAS doesn't support it. So when I dropped "enable-64" and built octave from there, it worked fine. I can't be certain, since I have no idea how I'd check to see whether Octave compiled as 32 bit or 64 bit, but either way, it seems to be running well enough - just using the optimised version of ATLAS gave a nice speedup, then using a newer version of Octave has given another nice speedup, plus the profiler ability that is helping me to shave a bit more time off the run time of the code I'm using.


For anyone else looking for help with this (for Ubuntu 11.10), I'll lay out what I did (in a terminal):

sudo apt-get build-dep atlas
sudo apt-get source atlas
cd atlas-*
sudo fakeroot debian/rules custom
cd ..
ls libatlas*.deb

Then, for each of the entries listed by the ls command (there may be a quicker way to do it, using "*"), type:
sudo dpkg -i <filename here>.deb

This should install an optimised build of the version of ATLAS that Ubuntu provides. There's a more recent version, but it doesn't come with the easy "debian/rules" stuff, so this method won't work. Sadly, it looks like 12.04 won't be coming with the new version of ATLAS, either.

Is it possible for there to be a package or script that automatically builds an optimised version of ATLAS, without need for any user interaction? I ask because the people most likely to have need for optimised ATLAS are people who aren't going to be computer experts in terms of things like building from source in Ubuntu. And since one of Ubuntu's main goals is ease of use, it's rather absurd to expect the user to build from source.