scipy

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
scipy [2008/03/05 13:05] gerardscipy [2008/10/30 10:09] gerard
Ligne 1: Ligne 1:
-====== référence ====== +====== A propos de python ====== 
-  [[http://www.scipy.org/Download]]+On trouve plusieurs versions de python sur nemo:
  
 +^ origine ^ chemin ^ version ^ PYTHONPATH ^ 32/64 ^
 +| SUNWPython | /usr/bin/python | 2.4.4 | /local/apps/lib/python2.4/site-packages | |
 +| SMCpython | /usr/local/bin/python | 2.5.1 | /local/apps/smc/lib/python2.5/site-packages | | 
 +| CSWpython | /opt/csw/bin/python | 2.5.1 | /local/apps/csw/lib/python2.5/site-packages | |
 +| sources | /local/apps/bin/python | 2.5.2 | /local/apps/lib/python2.5/site-packages | |
  
-====== Installation ====== + 
-  * numpy-1.0.4.tar.gz+===== Compilation de python ===== 
 +==== 32 bits ==== 
 +<code> 
 +./configure --prefix=/local/apps \ 
 +CC=cc CXX=CC \ 
 +CPPFLAGS="-I/usr/sfw/include"
 +LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib" 
 +</code> 
 +Penser à commenter OPT: dans le Makefile 
 + 
 + 
 +==== 64 bits ==== 
 +<code> 
 +./configure --prefix=/local/apps/64 \ 
 +CC=cc CXX=CC \ 
 +CPPFLAGS="-m64 -I/usr/sfw/include"
 +LDFLAGS="-m64 -L/usr/sfw/lib/64 -R/usr/sfw/lib/64" 
 +</code> 
 +erreur: 
 +<code> 
 +"/local/apps/src/Python-2.5.2/./Include/pyport.h", line 761: #error: "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." 
 +cc: acomp failed for /local/apps/src/Python-2.5.2/Modules/_struct.c 
 + 
 +</code> 
 +voir [[http://mail.python.org/pipermail/python-bugs-list/2007-January/036647.html]] 
 + 
 +====== numpy ====== 
 +===== Installation avec Python 2.4 ===== 
 +  * [[http://www.scipy.org/Download|numpy-1.0.4.tar.gz]]
 se logger devel1 sur nemo: se logger devel1 sur nemo:
 <code> <code>
Ligne 14: Ligne 47:
 library_dirs = /opt/studio12/SUNWspro/lib library_dirs = /opt/studio12/SUNWspro/lib
 include_dirs = /opt/studio12/SUNWspro/include include_dirs = /opt/studio12/SUNWspro/include
 +
 +[blas]
 +blas_libs = sunperf
 +
 +[lapack]
 +lapack_libs = sunperf
 +
 +</code>
 +remove numpy/distutils/fcompiler/sun.py f77compact from the optionlist, et enfin:
 +<code>
 +> python setup.py install --prefix=$HOME/lib | & tee INSTALL.LOG
 +
 +</code>
 +et s'installe dans /local/apps/lib/lib/python2.4/site-packages/
 +
 +Le test:
 +<code>
 +setenv PYTHONPATH /local/apps/lib/lib/python2.4/site-packages/
 +python -c 'import numpy; numpy.test()'
 +</code>
 +échoue sur:
 +<code>
 +======================================================================
 +FAIL: check_large_types (numpy.core.tests.test_scalarmath.TestPower)
 +----------------------------------------------------------------------
 +Traceback (most recent call last):
 +  File "/local/apps/lib/lib/python2.4/site-packages/numpy/core/tests/test_scalarmath.py", line 52, in check_large_types
 +    assert b == 6765201, "error with %r: got %r" % (t,b)
 +AssertionError: error with <type 'numpy.float96'>: got 6765201.00000000000364
 +
 +</code>
 +et pourtant:
 +<code>
 +nemo-henry% /usr/bin/python
 +Python 2.4.4 (#1, Jan  9 2007, 23:31:33) [C] on sunos5
 +Type "help", "copyright", "credits" or "license" for more information.
 +>>> 6765201 == 6765201.00000000000364
 +True
 +>>>
 +</code>
 +
 +===== Installation avec Python 2.5 =====
 +se logger devel1 sur nemo:
 +<code>
 +module load ss12 hpc
 +</code>
 +fichier site.cfg dans numpy/distutils/
 +<code>
 +[DEFAULT]
 +library_dirs = /opt/studio12/SUNWspro/lib:/opt/csw/lib
 +include_dirs = /opt/studio12/SUNWspro/include:/opt/csw/include
  
 [blas] [blas]
Ligne 24: Ligne 108:
 et enfin: et enfin:
 <code> <code>
-> python setup.py install --prefix=$HOME/python | & tee INSTALL.LOG+setenv LDFLAGS "-L/opt/csw/lib -R/opt/csw/lib"                                 
 +> /opt/csw/bin/python setup.py install --prefix=$HOME/lib/blastwave | & tee INSTALL_BLASTWAVE.LOG 
 +</code> 
 +et s'installe dans /local/apps/lib/blastwave/lib/python/site-packages
  
 +Le test:
 +<code>
 +setenv PYTHONPATH /local/apps/lib/blastwave/lib/python/site-packages
 +/opt/csw/bin/python -c 'import numpy; numpy.test()'
 </code> </code>
 +
 +===== Installation avec python 2.5.2 =====
 +python a été recompilé à partir des sources:
 +<code>
 +> module load ss12 hpc
 +> setenv PATH /local/apps/lib/bin:/opt/SUNWhpc/bin:/opt/studio12/SUNWspro/bin:/usr/local/wrapper/bin:/usr/bin:/usr/bin:/usr/ccs/bin:/usr/sfw/bin
 +> python setup.py install --prefix=$HOME/lib | & tee INSTALL.LOG
 +
 +
 +====== scipy ======
 +
 +===== Installation avec python 2.4 =====
  
   * scipy-0.6.0.tar.gz   * scipy-0.6.0.tar.gz
Ligne 39: Ligne 142:
  
 > python setup.py config_fc --help-fcompiler > python setup.py config_fc --help-fcompiler
-Running from numpy source directory.+
 SunFCompiler instance properties: SunFCompiler instance properties:
   archiver        = None   archiver        = None
Ligne 48: Ligne 151:
   compiler_fix    = ['/opt/studio12/SUNWspro/bin/f90', '-fixed', '-   compiler_fix    = ['/opt/studio12/SUNWspro/bin/f90', '-fixed', '-
                     xcode=pic32']                     xcode=pic32']
-  libraries       = ['fsu', 'sunmath', 'mvec', 'f77compat']+  libraries       = ['fsu', 'sunmath', 'mvec']
   library_dirs    = []   library_dirs    = []
   linker_exe      = None   linker_exe      = None
-  linker_so       = ['/opt/studio12/SUNWspro/bin/f90', '-Bdynamic', '-G', '-Bdynamic', '-G']+  linker_so       = ['/opt/studio12/SUNWspro/bin/f90', '-Bdynamic', '-G', '- 
 +                    Bdynamic', '-G']
   object_switch   = '-o '   object_switch   = '-o '
   ranlib          = None   ranlib          = None
Ligne 60: Ligne 164:
  
 </code> </code>
 +Puis, en s'inspirant du [[http://mailman.rwth-aachen.de/pipermail/sunhpc/2008-March/000424.html|message]]
 +<code>
 +> setenv LD_PRELOAD /usr/lib/libmtsk.so
 +> wget "http://downloads.sourceforge.net/scipy/scipy-0.5.2.1.tar.gz?modtime=1187640016&big_mirror=0"
 +> tar xzf ../downloads/scipy-0.5.2.1.tar.gz 
 +> cd scipy-0.5.2.1/
 +> python setup.py install --prefix=$HOME/lib | & tee INSTALL.LOG
  
-  python setup.py config_fc --fcompiler=<Vendorinstall +      
-  python setup.py install --fcompiler=sun --prefix=$HOME/python |& tee INSTALL.LOG+</code
 +===== Installation avec python 2.5.1 =====
  
-pour numpy: +<code> 
-> python setup.py config --help +which python 
-Running from numpy source directory+/opt/csw/bin/python 
-Global options: +> /opt/csw/bin/python -c 'import os,sys;print os.name,sys.platform' 
-  --verbose (-v)  run verbosely (default) +posix sunos5 
-  --quiet (-q)    run quietly (turns verbosity off) +> /opt/csw/bin/python -c 'import sys;print sys.version' 
-  --dry-run (-n don't actually do anything +2.5.1 (r251:54863, Nov  3 2007, 02:54:36[C] 
-  --help (-h)     show detailed help message+</code>
  
-Options for 'config' command: +Puis, en s'inspirant du [[http://mailman.rwth-aachen.de/pipermail/sunhpc/2008-March/000424.html|message]] 
-  --compiler           specify the compiler type +<code> 
-  --cc                 specify the compiler executable +> setenv LD_PRELOAD /usr/lib/libmtsk.so 
-  --include-dirs (-I)  list of directories to search for header files +> wget "http://downloads.sourceforge.net/scipy/scipy-0.5.2.1.tar.gz?modtime=1187640016&big_mirror=0" 
-  --define (-D)        C preprocessor macros to define +> tar xzf ../downloads/scipy-0.5.2.1.tar.gz  
-  --undef (-U)         C preprocessor macros to undefine +> cd scipy-0.5.2.1/ 
-  --libraries (-l)     external C libraries to link with +> /opt/csw/bin/python setup.py install --prefix=$HOME/lib/blastwave | & tee INSTALL.LOG
-  --library-dirs (-L)  directories to search for external C libraries +
-  --noisy              show every action (compile, link, run, ...) taken +
-  --dump-source        dump generated source files before attempting to +
-                       compile them +
-  --fcompiler          specify the Fortran compiler type+
  
-usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] +      
-   or: setup.py --help [cmd1 cmd2 ...] +</code>
-   or: setup.py --help-commands +
-   or: setup.py cmd --help+
  
- 
  
-python setup.py install 
  
  
-site.cfg+====== PyStemmer ====== 
 +s'installe sans problème 
 +<code> 
 +/local/apps/src/PyStemmer-1.0.1 
 +> python setup.py install --prefix=$HOME/lib 
 +running install 
 +running build 
 +running build_ext 
 +running install_lib 
 +copying build/lib.solaris-2.10-i86pc-2.4/Stemmer.so -> /local/apps/lib/lib/python2.4/site-packages
  
-python -c 'import numpy; numpy.test()'+</code> 
 + 
 + 
 +====== PyML ====== 
 +  * problèmes de [[compil_pyml|compilation]]