Thanks for this excellent recipe.<br><br>I have not tried it out myself yet, but I will follow the instruction on clean Ubuntu 9.04 64-bit.<br><br>Best,<br>Minjae<br><br><div class="gmail_quote">On Sat, Jun 6, 2009 at 11:59 AM, Chris Colbert <span dir="ltr"><<a href="mailto:sccolbert@gmail.com">sccolbert@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">since there is demand, and someone already emailed me, I'll put what I<br>
did in this post. It pretty much follows whats on the scipy website,<br>
with a couple other things I gleaned from reading the ATLAS install<br>
guide:<br>
<br>
and here it goes, this is valid for Ubuntu 9.04 64-bit  (# starts a<br>
comment when working in the terminal)<br>
<br>
<br>
download lapack 3.2.1 <a href="http://www.netlib.org/lapack/lapack.tgz" target="_blank">http://www.netlib.org/lapack/lapack.tgz</a><br>
download atlas 3.8.3<br>
<a href="http://sourceforge.net/project/downloading.php?group_id=23725&filename=atlas3.8.3.tar.bz2&a=65663372" target="_blank">http://sourceforge.net/project/downloading.php?group_id=23725&filename=atlas3.8.3.tar.bz2&a=65663372</a><br>

<br>
create folder  /home/your-user-name/build/atlas   #this is where we build<br>
create folder /home/your-user-name/build/lapack #atlas and lapack<br>
<br>
extract the folder lapack-3.2.1 to /home/your-user-name/build/lapack<br>
extract the contents of atlas to /home/your-user-name/build/atlas<br>
<br>
<br>
<br>
now in the terminal:<br>
<br>
# remove g77 and get stuff we need<br>
sudo apt-get remove g77<br>
sudo apt-get install gfortran<br>
sudo apt-get install build-essential<br>
sudo apt-get install python-dev<br>
sudo apt-get install python-setuptools<br>
sudo easy_install nose<br>
<br>
<br>
# build lapack<br>
cd /home/your-user-name/build/lapack/lapack-3.2.1<br>
cp INSTALL/make.inc.gfortran make.inc<br>
<br>
gedit make.inc<br>
#################<br>
#in the make.inc file make sure the line   OPTS = -O2 -fPIC -m64<br>
#and    NOOPTS = -O0 -fPIC -m64<br>
#the -m64 flags build 64-bit code, if you want 32-bit, simply leave<br>
#the -m64 flags out<br>
#################<br>
<br>
cd SRC<br>
<br>
#this should build lapack without error<br>
make<br>
<br>
<br>
<br>
# build atlas<br>
<br>
cd /home/your-user-name/build/atlas<br>
<br>
#this is simply where we will build the atlas<br>
#libs, you can name it what you want<br>
mkdir Linux_X64SSE2<br>
<br>
cd Linux_X64SSE2<br>
<br>
#need to turn off cpu-throttling<br>
sudo cpufreq-selector -g performance<br>
<br>
#if you don't want 64bit code remove the -b 64 flag. replace the<br>
#number 2400 with your CPU frequency in MHZ<br>
#i.e. my cpu is 2.53 GHZ so i put 2530<br>
../configure -b 64 -D c -DPentiumCPS=2400 -Fa  -alg -fPIC<br>
--with-netlib-lapack=/home/your-user-name/build/lapack/lapack-3.2.1/Lapack_LINUX.a<br>
<br>
#the configure step takes a bit, and should end without errors<br>
<br>
 #this takes a long time, go get some coffee, it should end without error<br>
make build<br>
<br>
#this will verify the build, also long running<br>
make check<br>
<br>
#this will test the performance of your build and give you feedback on<br>
#it. your numbers should be close to the test numbers at the end<br>
make time<br>
<br>
cd lib<br>
<br>
#builds single threaded .so's<br>
make shared<br>
<br>
#builds multithreaded .so's<br>
make ptshared<br>
<br>
#copies all of the atlas libs (and the lapack lib built with atlas)<br>
#to our lib dir<br>
sudo  cp  *.so  /usr/local/lib/<br>
<br>
<br>
<br>
#now we need to get and build numpy<br>
<br>
download numpy 1.3.0<br>
<a href="http://sourceforge.net/project/downloading.php?group_id=1369&filename=numpy-1.3.0.tar.gz&a=93506515" target="_blank">http://sourceforge.net/project/downloading.php?group_id=1369&filename=numpy-1.3.0.tar.gz&a=93506515</a><br>

<br>
extract the folder numpy-1.3.0 to /home/your-user-name/build<br>
<br>
#in the terminal<br>
<br>
cd /home/your-user-name/build/numpy-1.3.0<br>
cp site.cfg.example site.cfg<br>
<br>
gedit site.cfg<br>
###############################################<br>
# in site.cfg uncomment the following lines and make them look like these<br>
[DEFAULT]<br>
library_dirs = /usr/local/lib<br>
include_dirs = /usr/local/include<br>
<br>
[blas_opt]<br>
libraries = ptf77blas, ptcblas, atlas<br>
<br>
[lapack_opt]<br>
libraries = lapack, ptf77blas, ptcblas, atlas<br>
###################################################<br>
#if you want single threaded libs, uncomment those lines instead<br>
<br>
<br>
#build numpy- should end without error<br>
python setup.py build<br>
<br>
#install numpy<br>
python setup.py install<br>
<br>
cd /home<br>
<br>
sudo ldconfig<br>
<br>
python<br>
>>import numpy<br>
>>numpy.test()   #this should run with no errors (skipped tests and known-fails are ok)<br>
>>a = numpy.random.randn(6000, 6000)<br>
>>numpy.dot(a, a)     # look at your cpu monitor and verify all cpu cores are at 100% if you built with threads<br>
<br>
<br>
Celebrate with a beer!<br>
<br>
<br>
Cheers!<br>
<font color="#888888"><br>
Chris<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
On Sat, Jun 6, 2009 at 10:42 AM, Keith Goodman<<a href="mailto:kwgoodman@gmail.com">kwgoodman@gmail.com</a>> wrote:<br>
> On Fri, Jun 5, 2009 at 2:37 PM, Chris Colbert <<a href="mailto:sccolbert@gmail.com">sccolbert@gmail.com</a>> wrote:<br>
>> I'll caution anyone from using Atlas from the repos in Ubuntu 9.04  as the<br>
>> package is broken:<br>
>><br>
>> <a href="https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/363510" target="_blank">https://bugs.launchpad.net/ubuntu/+source/atlas/+bug/363510</a><br>
>><br>
>><br>
>> just build Atlas yourself, you get better performance AND threading.<br>
>> Building it is not the nightmare it sounds like. I think i've done it a<br>
>> total of four times now, both 32-bit and 64-bit builds.<br>
>><br>
>> If you need help with it,  just email me off list.<br>
><br>
> That's a nice offer. I tried building ATLAS on Debian a year or two<br>
> ago and got stuck.<br>
><br>
> Clear out your inbox!<br>
> _______________________________________________<br>
> Numpy-discussion mailing list<br>
> <a href="mailto:Numpy-discussion@scipy.org">Numpy-discussion@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
><br>
_______________________________________________<br>
Numpy-discussion mailing list<br>
<a href="mailto:Numpy-discussion@scipy.org">Numpy-discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br>