On 2012-03-23, Dima Pasechnik <[email protected]> wrote:
> On 2012-03-23, Robert Samal <[email protected]> wrote:
>> ------=_Part_772_24642055.1332490982625
>> Content-Type: multipart/alternative; 
>>      boundary="----=_Part_773_30231439.1332490982625"
>>
>> ------=_Part_773_30231439.1332490982625
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>>
>>>
>>> Can you post the logs from doing sage -python setup.py instasll, as well 
>>> as explicit instructions (where to download, etc.) for how to duplicate 
>>> the error?

I have had success with installing and running this extenstion on MacOSX
10.6.8, under Sage 4.8. (That is, I didn't even use Atlas - Sage uses
native MacOSX lapack/blas)


Instructions:
fire up Sage shell: sage -sh
1) Compile Csdp static lib in lib/ subdirectory of Csdp distibution and
copy it (i.e. libcsdp.a) to $SAGE_LOCAL/lib/
2) mkdir $SAGE_LOCAL/incluce/sdp/
3) Copy Csdp .h files in include to $SAGE_LOCAL/incluce/sdp/
4) in pycsdp, edit setup.py as follows:
add at the line 3:
import os
SAGE_LIB = os.environ['SAGE_LOCAL']+'/lib'
SAGE_INCLUDE = os.environ['SAGE_LOCAL']+'/include'

replace the lines
     library_dir = ['/usr/local/numerics/lib']
     includes = ['/usr/local/numerics/include/',
with
     library_dir = [SAGE_LIB]
     includes = [SAGE_INCLUDE+'/sdp',
5) run python setup.py install
6) Done! Now you can do python examples/example.py and see it running
  (or you can start Sage proper and try doing
 from pycsdp import _csdp, etc)


I imagine this should work on Linux too. No parallel/multithreaded blas,
though; one has to work on adding parallel Atlas libs to Sage in order
to fix this.

--------------------
We should definitely think of making this a Sage package, perhaps even a
standard one, as Csdp is really fast!

Dmitrii

>>>
>> Sure. It's rather long, but I suppose if it works it would be useful for 
>> other people, too. I was hoping someone could spot the problem just from 
>> the above description.
>>
>> Anyway, here you go:
>>
>> 1) download ATLAS library --- I did use debian package
>> apt-get install libatlas-base-dev  --install-suggests
>>   but one can also download from the web-site 
>> http://math-atlas.sourceforge.net/
>>
>>   --> Now I discovered that sage has its own atlas libraries. Should I be 
>> trying
>>    to build against them? 
>
> yes, absolutely.
>
>> Do I need to build sage from source to do this?
> no, not really (but YMMV, as always :))
>
>
>> 2) download http://www.coin-or.org/download/source/Csdp/Csdp-6.1.1.tgz
>> unzip and install using the instructions. This is straightforward process
>> make
>> make install
>>
>> 3) download 
>> http://ifatwww.et.uni-magdeburg.de/syst/about_us/people/kern/downloads/pycsdp-0.10.zip
>> unzip, edit the setup.py to point to the Csdp library and includes, then run
>> python setup.py install as a root to install "to the system" .
>>
>> To install to sage I tried
>> sage -python setup.py install
>> but I believe now that already here is a problem (or the problem?):
>> the installation using python finds the ATLAS library
>>   FOUND:
>>     libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
>>     library_dirs = ['/usr/lib/atlas-base/atlas', '/usr/lib/atlas-base']
>>     language = f77
>>     include_dirs = ['/usr/include/atlas']
>
> indeed, it's a problem. More than one, actually. To fix paths, you can 
> do the following: somewhere at the top
> of setup.py, insert lines
>
> import os
> SAGE_LIB = os.environ['SAGE_LOCAL']+'/lib'
> SAGE_INCLUDE = os.environ['SAGE_LOCAL']+'/include'
>
> then replace  
>       library_dirs = ['/usr/lib/atlas-base/atlas', '/usr/lib/atlas-base']
> with 
>       library_dirs = [SAGE_LIB+'/atlas-base/atlas', SAGE_LIB+'/atlas-base']
> and
>      include_dirs = ['/usr/include/atlas']
> with
>      include_dirs = [SAGE_INCLUDE+'/atlas']
>
> But Sage does not have 'ptf77blas', 'ptcblas', it has 'blas',
> 'cblas' (i.e. non-multithreaded versions of them).
>
> Perhaps replacing 
>      libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
> with
>      libraries = ['lapack', 'blas', 'cblas', 'atlas']
> would still work.  You should also have  just
>  library_dirs = [SAGE_LIB]
> (not what I posted above).
>
> An alternative would be to install these 'pt'*blas in Sage, doing
> this in Sage shell (i.e. sage -sh), but I have no idea whether this will
> work out of the box, if at all (multithreading is tricky...).
>
> Best,
> Dmitrii
>>
>> while sage-python doesn't find it. Instead, it complains about missing 
>> directories
>> (full logs attached):
>>   
>> /data/local/sage-4.8-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/numpy/distutils/system_info.
>>   UserWarning: Specified path /home/wstein/build/sage-4.8/local/lib is 
>> invalid.
>>     warnings.warn('Specified path %s is invalid.' % d)
>>
>> Is this a bug? What should I do to use my libraries instead of wstein's? :-)
>> Do I need to compile my sage, so that I can add stuff to it?
>>
>> Thanks!
>>                                                Robert
>>
>>
>>  
>>
>

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to