Open main menu

Changes

m
__TOC__ == Download preparation ==This guide should follow [http://www.nmr-relax.com/windows_devel.html Homepage for MS Windows development platform] 
First: Download these packages, do not unpack them yet.
# (.exe): wxPython: http://www.lfd.uci.edu/~gohlke/pythonlibs/#wxpython
# (.exe): scons: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scons
# (.zip): [{{minfxhomepage}} minfx]: httphttps://downloadsourceforge.gna.orgnet/projects/minfx/files/# (.zip): [{{bmrblib homepage}} bmrblib]: httphttps://downloadsourceforge.gna.orgnet/projects/bmrblib/files/
'''take amd64 the win32 bit versions if you have a computer with 64 bit.'''
== Install python and necessary packages ==
I recommend to install a python distribution which is packed with several packages already.
=== Winpython ===
You could consider winpython, which includes Ipython, numpy, scipy. matplotlib etc.:<br>
[https://code.google.com/p/winpython Homepage]
Make a folder: '''C:\WinPython27'''.<br>Run the downloaded winpython exe file, and extract for example to: '''C:\WinPython27'''.<br>Open '''WinPython Control Panel''' in ex. '''C:\WinPython27\WinPython-64bit32bit-2.7.4.1x'''<br>
Drag the 4 above mentioned packakes, into the window, and install the packages.<br>
For a command window, use the '''WinPython Command Prompt''' found in '''C:\WinPython27\WinPython-64bit32bit-2.7.4.1x''', which fixes path issues for finding python.
==== Trick to set variables in cmd ====Make a folder '''own''' in '''C:\WinPython27\WinPython-32bit-2.7.x\scripts''' and <br>copy '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\env.bat''' to '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\own\pyt32.bat'''<br>and copy '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\cmd.bat''' to '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\own\cmdpyt32.bat'''<br> Modify '''pyt32.bat''' from<source lang="python">set WINPYDIR=%~dp0..\python-2.7.5</source>to include '''..\'''<source lang="python">set WINPYDIR=%~dp0..\..\python-2.7.5</source> Modify '''cmdpyt32.bat''' from<source lang="python">call %~dp0env.bat</source>to<source lang="python">call %~dp0pyt32.bat</source> ==== Trick to add .bat files to PATH ====If you have permission to change the Environment Variables in windows, you can add the '''pyt32.bat''' and '''cmdpyt32.bat''' to your path.<br>Right click Computer -> properties -> Advanced system settings -> Environment Variables -> User variables -> Edit: PATH <br>Add to end of the Variable value: ;C:\WinPython27\WinPython-32bit-2.7.x\scripts\ownIn any folder, hold "Shift" and right click, "Open command window here". Write:<source lang="powershell">pyt32python</source> == Install Visual Studio Express 2012 for Windows Desktop ==
[http://msdn.microsoft.com/en-us/library/vstudio/hs24szh9.aspx See versions of VS 2012 here].<br>
 For 64 32 bit compiling, you will only need, '''Visual Studio ProfessionalExpress for Windows Desktop''', since it has: 64-bit x64 compiler.<br>From http://www.microsoft.com/visualstudio/eng/downloads, download and install: [http://go.microsoft.com/?linkid=9810223 9816758 Visual Studio Professional 2012 90-day trialExpress for Windows Desktop].<br>
Skip all extra packages install. After install, just exit any program, which opened after install.
== Bugfix scons for 32bit building - ONLY do this if you have winpython 32 bit. ==Due to a bug, versions of scons '''<=2.3''' should alter a line in:<br>'''C:\WinPython27\WinPython-32bit-2.7.4.1\python-2.7.4\Lib\site-packages\scons-2.3.0\SCons\Tool\MSCommonvc.py''' Line '''364''': if not req_target_platform and target_platform in ('amd64','x86_64'):Should be: if target_platform in ('amd64','x86_64'): = Install Subversion checkout of relax =={{historical svn}}
Install a subversion client. For example: http://tortoisesvn.net/
Right click in winpython folder: '''C:\WinPython27\WinPython-64bit-2.7.4.1''', and select '''SVN Checkout'''. Write the path: svn://svn.gna.org/svn/relax/trunk svn://svn.gna.org/svn/relax/branches/relax_disprelax_trunk
== Build relax ==
Open the '''WinPython Command Prompt''' <br>
Navigate to the SVN checked out relax folder.<br> cd C:\WinPython27\relax_trunk_32 scons
Or navigate to C:\WinPython27\relax_trunk_32, hold "Shift" and right click, "Open command window here". Write: cd ..\relaxpyt32
scons
(Scons will automatically find CL.exe, and setup compilation for 64 bit.)
=== Modify relaxpyt32.bat ===Copy relaxModify '''C:\WinPython27\WinPython-32bit-xxx\scripts\own\pyt32.bat ''', and add to relaxgui.batend of file<source lang="powershell">set PATH=%PATH%;C:\WinPython27\relax_trunk_32</source>
Modify relax.batTest installation, by clicking '''C: 32x: %~dp0\..WinPython27\pythonWinPython-32bit-2.7.4xxx\scripts\python "%~dp0own\relaxcmdpyt32.pybat''', and write<source lang="powershell" %*>relax 64x: %~dp0\..\pythonrelax -2.7.4.amd64\python "%~dp0\relax.py" %*g</source>
Modify relaxgui==== Tip - shortcut to cmdpyt32.bat====Make shortcut to '''C:\WinPython27\WinPython-32bit-xxx\scripts\own\cmdpyt32.bat''', and modify the shortcut. Set 32x'''Start in: ''' %~dp0\PWD%You can now copy this shortcut around, which open a command prompt at the current folder, and set the paths correctly. == Install other software ===== xmgrace - for the plotting results of NMR-relax ===relax produces xmgrace "'.agr" files for plotting. There exist two ports for xmgrace to windows [http://qtgrace.sourceforge.\python-2net/ QtGrace] and [http://sourceforge.net/projects/gracegtk/ GraceGTK].7 Download [http://sourceforge.4net/projects/qtgrace/files/ qtgrace_windows_binary], and unpack to '''C:\python "%~dp0WinPython27\relaxqtgrace_windows_binary'''.py" -g %*<br>Then copy '''C:\WinPython27\qtgrace_windows_binary\bin\qtgrace.exe''' 64xto '''C: %~dp0\WinPython27\qtgrace_windows_binary\bin\xmgrace..exe''' Modify '''C:\WinPython27\pythonWinPython-32bit-2xxx\scripts\own\pyt32.7.4.amd64\python bat''', and add to end of file<source lang="powershell">set PATH=%~dp0PATH%;C:\relaxWinPython27\qtgrace_windows_binary\bin</source> Test installation, by clicking '''C:\WinPython27\WinPython-32bit-xxx\scripts\own\cmdpyt32.pybat''', and write<source lang=" -g %*powershell">xmgrace</source>which should start xmgrace. === Python editor ===A good lightweight editor for windows could [[Pyscripter]] == Test installation =={{caution|After an installation you should really run an [[Installation_test]].}} == Build manual and API documentation ==See [[Manual]].
== Trouble shooting ==
=== Possible DLL error in Winpython ===
To fix a current DLL error in Winpython 64 bit, you need to install
[http://www.lfd.uci.edu/~gohlke/pythonlibs/ Microsoft Visual C++ 2008 Redistributable Package (x64)].
[http://www.microsoft.com/en-us/download/details.aspx?id=15336 Download here]
== See also ==
 
[[Category:Installation]]
Trusted, Bureaucrats
4,228

edits