Open main menu

Changes

Epd canopy

7,933 bytes added, 14:18, 15 October 2015
Forced creation of a TOC - this will improve the formatting on the main page 'Did you know...' section.
__TOC__
 
== Download from ==
Download from:<br>
</source>
It will make a '''bash''' activation script in: '''$HOME/Enthought/Canopy_64bit/User/bin/activate'''
That will make an activation source file.
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
 
# unset PYTHONHOME if set
The path to the Canopy installation is: '''/sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64'''.
=== Install ===
<source lang="bash">
tcsh
set IND=/sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64
cd $IND
# Maybe remove already installed EnthougtEnthought
rm -rf $HOME/Enthought/
rm -rf $HOME/.canopy
# Install
canopy_cli –common-hcanopy_cli --common-install --no-gui-setup --install-dir $PWD</source> === Make tcsh activation script === Now we want to make a tcsh activation script. <source lang="bash">cat > cshrc_epd << 'EOF'set VIRTUAL_ENV_DISABLE_PROMPT=1 # unset irrelavent variablesif ( $?_OLD_VIRTUAL_PATH ) then set PATH=$_OLD_VIRTUAL_PATH setenv PATH $PATH unset _OLD_VIRTUAL_PATHendif if ( $?_OLD_VIRTUAL_PYTHONHOME ) then set PYTHONHOME=$_OLD_VIRTUAL_PYTHONHOME setenv PYTHONHOME $PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOMEendif if ( $?_OLD_VIRTUAL_PS1) then set PS1=$_OLD_VIRTUAL_PS1 setenv PS1 $PS1 unset _OLD_VIRTUAL_PS1endif unset VIRTUAL_ENV set VIRTUAL_ENV=MYINSTALLDIRsetenv VIRTUAL_ENV $VIRTUAL_ENV set _OLD_VIRTUAL_PATH=$PATHset PATH=$VIRTUAL_ENV/bin:$PATHsetenv PATH $PATH # unset PYTHONHOME if set# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)# could use `if (set -u; : $PYTHONHOME) ;` in bashif ( $?PYTHONHOME ) then set _OLD_VIRTUAL_PYTHONHOME=$PYTHONHOME unset PYTHONHOMEendif if ( ! $?VIRTUAL_ENV_DISABLE_PROMPT ) then set _OLD_VIRTUAL_PS1=$PS1  if ( "x(Canopy 64bit) " != x ) then set PS1="(Canopy 64bit) $PS1" else if ( `basename $VIRTUAL_ENV` = "__" ) then # special case for Aspen magic directories # see http://www.zetadev.com/software/aspen/ set DIRN=`dirname $VIRTUAL_ENV` set BN=`basename $DIRN` set PS1="$BN $PS1" else set PS1="(`basename $VIRTUAL_ENV`)$PS1" endif  #setenv PS1 $PS1endif'EOF'</source> Then let us see it, and change the one important line.<source lang="bash">set EPDUSER=$PWD/Canopy_64bit/User# Sed can use any separator instead of / in the s command. Just use something that is not encountered in the path: s+AAA+BBB+sed -i "s+MYINSTALLDIR+$EPDUSER+g" cshrc_epdgrep "set VIRTUAL_ENV" cshrc_epd</source> === Add to shared cshrc ===Let the user ''software''' has a shared '''cshrc''' file, which all users with source from their own '''$HOME/.cshrc''' file. <source lang="bash">cat >> $HOME/cshrc << EOF#--------------------------------------------------------------# Enthought Python distribution# Canopy#--------------------------------------------------------------# Alias 'ap' as activate python.alias ap 'source $PWD/cshrc_epd'EOF</source> === Source shared cshrc for all users ===Each user needs to put in their '''.cshrc''' file <source lang="bash">source /sbinlab2/software/cshrc</source> == Install Minfx and Bmrblib and mpi4py == # [[Minfx#Install | Minfx]]# [[Bmrblib#Install | Bmrblib]]# [[Mpi4py#Install | Mpi4py]] == Scripts to run relax ==See [[Installation_linux#mpi4py | linux mpi4py installtion]] if you want to run multi processor mode. Here we have one computer, with 24 cores, called '''haddock'''.We want to have the users logon on to haddock, when they want to do multi-core calculations. Make these scripts available somewhere in PATH. For private single computer<source lang="bash">#!/bin/tcsh # Set the lax version used for this script.set RELAX=/sbinlab2/software/NMR-relax/relax_trunk/relax # Run relax in multi processor mode.set RELAXRUN="$RELAX $argv" # Activate pythonap$RELAX $argv</source> For multi core computations.<source lang="bash">#!/bin/tcsh # Set the lax version used for this script.set RELAX=/sbinlab2/software/NMR-relax/relax_trunk/relax # Set number of available CPUs.#set NPROC=`nproc`set NPROC=5set NP=`echo $NPROC + 1 | bc ` # Run relax in multi processor mode.set RELAXRUN="/usr/lib64/openmpi/bin/mpirun -np $NP $RELAX --multi='mpi4py' $argv" # Check machine, since only machine haddock have openmpi-devel installedif ( $HOST != "haddock") then echo "You have to run on haddock. I do it for you" ssh haddock -Y -t "cd $PWD; ap; $RELAXRUN; /bin/tcsh"else # Activate python ap /usr/lib64/openmpi/bin/mpirun -np $NP $RELAX --multi='mpi4py' $argvendif</source> == Compile program issues with scons ==<source lang="bash"># Go into install directorytcshset IND=/sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64cd $IND # setenv PYTHON_LIBRARY XXXXX/libpython2.7.so# libpython2.7.sofind . -name libpython2.7.so -type f./appdata/canopy-1.4.0.1938.rh5-x86_64/lib/libpython2.7.so./appdata/canopy-1.4.0.1938.rh5-x86_64/lib/python2.7/config/libpython2.7.so./Canopy_64bit/User/lib/libpython2.7.so./Canopy_64bit/System/lib/libpython2.7.so # setenv PYTHON_EXECUTABLE XXXXX/python2.7# find . -name python\*# find . -name python -type f# find . -name python2.7 -type f./appdata/canopy-1.4.0.1938.rh5-x86_64/bin/python2.7./Canopy_64bit/User/bin/python./Canopy_64bit/User/bin/python2.7./Canopy_64bit/System/bin/python./Canopy_64bit/System/bin/python2.7 # setenv PYTHON_INCLUDE_DIR XXXX/# find . -name Python.h -type f./appdata/canopy-1.4.0.1938.rh5-x86_64/include/python2.7/Python.h</source> === Python.h ===<source lang="bash">[tlinnet@tomat disp_spin_speed]$ sconsscons: Reading SConscript files ...scons: done reading SConscript files.scons: Building targets ...gcc -o target_functions/relax_fit.os -c -I/sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64/Canopy_64bit/User/include/python2.7 -fPIC target_functions/relax_fit.ctarget_functions/relax_fit.c:21:20: error: Python.h: No such file or directorytarget_functions/relax_fit.c:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' tokentarget_functions/relax_fit.c:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' tokentarget_functions/relax_fit.c:117: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' tokentarget_functions/relax_fit.c:142: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' tokentarget_functions/relax_fit.c:153: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' tokentarget_functions/relax_fit.c:171: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'relax_fit_methods'target_functions/relax_fit.c: In function 'initrelax_fit':target_functions/relax_fit.c:227: error: 'relax_fit_methods' undeclared (first use in this function)target_functions/relax_fit.c:227: error: (Each undeclared identifier is reported only oncetarget_functions/relax_fit.c:227: error: for each function it appears in.)scons: *** [target_functions/relax_fit.os] Error 1scons: building terminated because of errors.</source>Then try<source lang="bash">#setenv PYTHON_LIBRARY $IND/appdata/canopy-1.4.0.1938.rh5-x86_64/lib/libpython2.7.so#setenv PYTHON_EXECUTABLE $IND/appdata/canopy-1.4.0.1938.rh5-x86_64/bin/python2.7setenv PYTHON_INCLUDE_DIR $IND/appdata/canopy-1.4.0.1938.rh5-x86_64/include/python2.7</source> Setting system environment variable '''PYTHON_INCLUDE_DIR''' to point to the dir with '''Python.h''' solved the problem.
=== For MAC ===
==== Python.h ====
<source lang="bash">
echo "PYTHON_INCLUDE_DIR=/Applications/Canopy.app/appdata/canopy-1.4.0.1938.macosx-x86_64/Canopy.app/Contents/include/python2.7" >> $HOME/.bash_profile
echo "export PYTHON_INCLUDE_DIR" >> $HOME/.bash_profile
</source>
 
==== Wx program running on Canopy 1.4 on OS X "Please run with a Framework build of python" ====
See https://support.enthought.com/entries/22601196-wxPython-2-8-and-2-9 to fix it.
 
=== For Linux ===
==== Python.h ====
<source lang="bash">
setenv PYTHON_INCLUDE_DIR /sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64/appdata/canopy-1.4.1.1975.rh5-x86_64/include/python2.7
 
# Or
cd /sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64/appdata/canopy-1.4.1.1975.rh5-x86_64/include
ln -s /sbinlab2/software/python-enthought-dis/canopy-1.4.0-full-rh5-64/appdata/canopy-1.4.1.1975.rh5-x86_64/include/python2.7 python2.7
</source>
 
== See also ==
[[Category:Installation | Installation category]]
[[Category:Installation]]
Trusted, Bureaucrats
4,223

edits