|
|
| (7 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| ==vtkMy Installation==
| |
| <b>Apple</b><br>
| |
| 1. Install the code:
| |
| grab a copy from sodor/bonelab/software directory: vtkMy-osx.tar.bz2
| |
| create an /opt directory (if not already existing):
| |
| $ sudo mkdir /opt
| |
| copy vtkMy-osx.tar.bz to /opt
| |
| $ sudo cp vtkMy-osx.tar.bz /opt
| |
| unpack vtkMy
| |
| $ sudo bunzip2 vtkMy-osx.tar.bz2
| |
| $ sudo tar -xvf vtkMy-osx.tar
| |
|
| |
|
| 2. Edit your default paths in .bash_profile
| | ==Compiling vtkMy== |
| add the following lines to your .bash_profile file
| |
|
| |
|
| <pre>
| | NOTE: vtkMy classes and programs are gradually being migrated to vtkski and Bone Lab Applications. |
| # vtkMy
| |
| if [ ! `echo $PATH | grep /opt/vtkMy-osx/bin` ] ; then
| |
| export PATH="/opt/vtkMy-osx/bin:$PATH"
| |
| fi
| |
| if [ ! `echo $DYLD_LIBRARY_PATH | grep /opt/vtkMy-osx/lib` ] ; then
| |
| export DYLD_LIBRARY_PATH="/opt/vtkMy-osx/lib:$DYLD_LIBRARY_PATH"
| |
| fi
| |
| </pre>
| |
|
| |
|
| 3. Restart your terminal session, or type:
| | In order to build vtkMy, you must first build vtkski. Refer to [[vtkski Development]]. |
| $ source ~/.bash_profile
| |
|
| |
|
| ==vtkMy Development - Windows Setup== | | ===Required Software=== |
| <br>
| | |
| '''Required Software:<br>'''
| | To build vtkMY, you will require SVN and VTK, as well as possibly Qt, ITK and FLTK, depending on which parts you want to build. Refer to the instructions for relevant platform: |
| Cmake 2.4.8 <br>
| | |
| WinCVS 2.0<br>
| | *[[Development on OS-X]] |
| ITK 2.8.1<br>
| | *[[Development for Linux]] |
| VTK 5.0.4<br>
| | *[[Development on Windows]] |
| Qt 4.4.0 Open source<br>
| | |
| | ==OBSOLETE== |
| | |
| | The following instructions are obsolete, but are kept here temporarily for reference. |
| | |
| | ===Building On Windows=== |
|
| |
|
| #Create directory C:\pack to keep all programs
| |
| #Download and install cmake-2.4.8.zip from: http://www.cmake.org/HTML/Download.html
| |
| #Download and install WinCvs 2.0.2.4 (released 2005-08-15) from:http://www.wincvs.org/download.html#WINCVS
| |
| #Download InsightToolkit-2.8.1.zip (hosted at SourceForge) from:http://www.itk.org/HTML/Download.htm
| |
| #Use WinCVS to download source files for VTK:
| |
| #*a. Open WinCVS and click menu Admin-> Preferences-> CVS Tab
| |
| #**Enter HOME: C:\pack
| |
| #**Click Ok
| |
| #*b. Open menu Admin-> Command Line
| |
| #**Enter the following:
| |
| #:::cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK login{space}{enter}
| |
| #:::cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK checkout –d VTK
| |
| #**Click Ok
| |
| #**You will be prompted for the password. Enter: vtk
| |
| #**Wait for checkout to complete
| |
| #Download vtkMy source using WinCVS (see SmartCVS below as option to WinCVS) | | #Download vtkMy source using WinCVS (see SmartCVS below as option to WinCVS) |
| #*a. Verify home directory as set up in Step 5.a.i. | | #*a. Verify home directory as set up in Step 5.a.i. |
| Line 62: |
Line 31: |
| #**You will be prompted for your password to access the machine | | #**You will be prompted for your password to access the machine |
| #**Wait for checkout to complete | | #**Wait for checkout to complete |
| #Install Qt 4.4.0 Open Source version
| |
| #*a. Extract all from “qt-win-opensource-4.4.0.zip” to your "C:\pack\qt-win-opensource-src-4.4.0" folder
| |
| #*b. Make changes to the Environment Variables which can be found in Control Panel -> System -> Advanced -> Environment Variables
| |
| #::-In System Variables, make new variable with name "QMAKESPEC" and value "win32-msvc2008" (*Note: 2008 or whichever version of VS being used)
| |
| #::-In System Variables, make new variable with name "QTDIR" and value "(your QT directory)"
| |
| #::-In System Variables, in variable Path, add ";(your QT directory)\bin;(your QT directory)\qmake;" (*Note: Ensure that there are no spaces and do not remove anything from the path that was previously there)
| |
| #*c. Ensure the Visual Studio Environment Variables are set. You may have the run either of the following in the Visual Studio Command Prompt Window:
| |
| #::- the "vsvars32.bat" file found in "Microsoft Visual Studio 9.0\VC\bin" folder
| |
| #::- or for 64-bit, "vcvarsamd64.bat" file found in "Microsoft Visual Studio 9.0\VC\bin\amd64"
| |
| #*d.In the standard Command Prompt, go to your QT directory and type "configure". (approx 10 mins)
| |
| #*e.Once completed, type "nmake". (approx 2 hrs)
| |
| #Build ITK using Cmake
| |
| #*a. Open Cmake
| |
| #*b. Choose C:\pack\InsightToolkit-2.8.1 as source code
| |
| #*c. Make C:\pack\InsightToolkit-2.8.1\bin binary code location
| |
| #*d. Click ‘Configure’ and choose desired compiler
| |
| #*e. Use the following Cache values:
| |
| #::BUILD_EXAMPLES: ON
| |
| #::BUILD_SHARED_LIBS: ON
| |
| #::BUILD_TESTING: ON
| |
| #::BUILD_BACKWARDS_COMPATIBILITY: 2.4
| |
| #::CMAKE_INSTALL_PREFIX: C:/Program Files/ITK
| |
| #*f. Click ‘Configure’, all red values should turn grey
| |
| #*g. Click ‘Ok’, wait as Cmake will close automatically
| |
| #Build ITK using Visual Studio (or desired program)
| |
| ##Open C:\pack\InsightToolkit-2.8.1\bin\itk.sln (.dsw)
| |
| ##Click ‘Build’
| |
| #Build VTK using Cmake
| |
| #*a. Open Cmake
| |
| #*b. Choose C:\pack\VTK as source code
| |
| #*c. Make C:\pack\VTK\bin binary code location
| |
| #*d. Click ‘Configure’ and choose desired compiler
| |
| #*e. Click the ‘Show Advanced Values’ checkbox and verify the following settings, all others can be left as defaults:
| |
| #::BUILD_EXAMPLES: ON
| |
| #::BUILD_SHARED_LIBS: ON
| |
| #::BUILD_TESTING: ON
| |
| #::BUILD_BACKWARDS_COMPATIBILITY: 2.4
| |
| #::CMAKE_INSTALL_PREFIX: C:/Program Files/VTK
| |
| #::VTK_USE_GUISUPPORT: ON
| |
| #*f. Click ‘Configure’, then new red values should appear
| |
| #::VTK_USE_QVTK: ON
| |
| #::VTK_USE_MFC: ON
| |
| #*g. Enter '4' when asked which version of Qt
| |
| #*h. Click ‘Configure’, then new red values should appear, leave as defaults
| |
| #*i. Click ‘Configure’, all red values should turn grey
| |
| #*j. Click ‘Ok’, wait as Cmake will close automatically
| |
| #Build VTK using Visual Studio (or desired program)
| |
| ## Open C:\pack\VTK\bin\vtk.sln (note: file extension is .dsw for VS 6.0 and older)
| |
| ## Click ‘Build’
| |
| #Build vtkMy using Cmake | | #Build vtkMy using Cmake |
| #*a. Open Cmake | | #*a. Open Cmake |
| Line 142: |
Line 62: |
| ##Open C:\pack\vtkMy\bin\vtkmy.sln (.dsw) | | ##Open C:\pack\vtkMy\bin\vtkmy.sln (.dsw) |
| ##Click ‘Build’ | | ##Click ‘Build’ |
|
| |
| ==Setting up CVS access from Linux/Unix==
| |
| *To understand the codes for a CVS update, see page 121 of CVS users guide, section A.16.2.
| |
| # Valuable resource for understanding ssh:
| |
| #* http://www-106.ibm.com/developerworks/library/l-keyc.html
| |
| #* http://www-106.ibm.com/developerworks/library/l-keyc2/
| |
| # Setting up SSH access from "localbox" to "remotebox": <BR> <U>Localbox:</U>
| |
| #* ssh-keygen -t rsa [use a passphrase]
| |
| #: NOTE: Put the "id_rsa" (private file) in ~/.ssh. There should only be one of these on a machine account.
| |
| #: NOTE: Put the “id_rsa.pub�? (public file) in ~/.ssh as “authorized_keys�? on remote machines; see “Remotebox�? below.
| |
| #* scp identity.pub skboyd@remotebox: [don't forget the last colon]
| |
| #* in ~/.bashrc:
| |
| #* export CVS_RSH=ssh
| |
| #* export CVSROOT=:ext:skboyd@m177.enme.ucalgary.ca:/localhost/cvsroot
| |
| #* eval `ssh-agent` {use the funny back single quotes}
| |
| :<BR><U>Remotebox:</U>
| |
| #* cat identity.pub >> ~/.ssh/authorized_keys
| |
| # To avoid writing your passphrase every time you log on, run ( on the local box!):
| |
| #* ssh-add ~/.ssh/ida_rsa
| |
| #: Should work if ssh-agent is already running (eval `ssh-agent` in the .bashrc file).
| |
| # Do the following to limit access to cvs for the users:
| |
| #* edit the public key installed in the .ssh/authorized_keys file with the following at the beginning of the public key line:
| |
| #: command="/usr/bin/ssh server"
| |
|
| |
| <U>NOTES ABOUT KEYS</U>
| |
| Remember, the "authorized_keys" file is a concatenation of public (id_rsa.pub) keys,
| |
| and the "id_rsa" is the private key.
| |
| Every user on every computer should only have ONE "id_rsa" file,
| |
| but can have multiple "id_rsa.pub" files concatenated into
| |
| their "authorized_keys" file.
| |
|
| |
| ==Using CVS from a command line==
| |
| # To find a difference:
| |
| #* <code> $ cvs diff mylocalfile.cxx </code>
| |
| # To add a new file:
| |
| #* <code> $ cvs add mynewfile.cxx </code>
| |
| #* <code> $ cvs commit mynewfile.cxx </code>
| |
| # To update local file:
| |
| #* <code> $ cvs update -dCP </code>
| |
| #: or
| |
| #* <code> $ cvs update -dCP myfile.cxx </code>
| |
| # To check if a more recent version is available:
| |
| #* <code> $ cvs diff myfile.cxx </code>
| |
| #: or (this will change the files):
| |
| #* <code> $ cvs update </code>
| |
| #: or (local files are unchanged):
| |
| #* <code> $ cvs -nq update </code>
| |
| #: update outputs are:
| |
| #* <code>U file</code> new or newer file in repository
| |
| #* <code>M file</code> newer file in local directory
| |
| # To update CVS repository:
| |
| #* <code> $ cvs commit mylocalfile.cxx </code>
| |
| # To look at the changes made to a file:
| |
| #* <code> $ cvs log mylocalfile.cxx </code>
| |
|
| |
| ==Add a project to vtkMy==
| |
|
| |
| # Add a new project directory in the vtkMy/src/Applications directory.
| |
| # Update the CMakeLists.txt file in /src/Applications to include the new directory in the SUBDIRS() list.
| |
| # Copy the CMakeLists.txt and source code files from an existing project such as AppMohr and put them into the new directory. These files can be edited for your new project.
| |
| # Edit the copied CMakeList.txt file and the change the name of the .cxx to the name of the new project.
| |
| # Run CMake, taking the source code from vtkMy/src and building the binaries in vtkMy/bin.
| |
| # Open the Visual C++ workspace and edit the source code (since at the moment it will be a duplicate of whatever project you copied in step 3).
| |
| # Compile your new code. Usually, all the development should be done in the “Debug�? mode (rather than “Release�?, etc.).
| |
| # If, to run your application, you need to include command line arguments, go to the menu item [Project][Settings], and on the ‘debug’ tab set the Program Arguments as shown.
| |
|
| |
|
| |
| [[Image:VtkMy_Project_Settings.jpg|center]]
| |
|
| |
|
| |
| ==WinCVS and PuTTY for vtkMy==
| |
|
| |
| NOTE: An alternative CVS client has been suggested, see following section:
| |
| <pre>
| |
| SmartCVS from www.syntevo.com with a foundation license.
| |
| </pre>
| |
|
| |
| Setting up WinCVS to use PuTTY is fairly straightforward, but does require a few configuration settings in addition to installing the software. You can do it with the following steps.
| |
|
| |
| #Install PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/).
| |
| #Install wincvs (http://www.wincvs.org/)
| |
| #Make a key:
| |
| #*Follow menus: Start/Programs/PuTTY/PuTTYgen From the PuTTY Manual: <br>
| |
| #:...press the "Generate" button and PuTTYgen will begin the process of actually generating the key.
| |
| #*First, a progress bar will appear and PuTTYgen will ask you to move the mouse around to generate randomness. Wave the mouse in circles over the blank area in the PuTTYgen window, and the progress bar will gradually fill up as PuTTYgen collects enough randomness. You don't need to wave the mouse in particularly imaginative patterns (although it can't hurt); PuTTYgen will collect enough randomness just from the fine detail of exactly how far the mouse has moved each time Windows samples its position.
| |
| #*When the progress bar reaches the end, PuTTYgen will begin creating the key. The progress bar will reset to the start, and gradually move up again to track the progress of the key generation. It will not move evenly, and may occasionally slow down to a stop; this is unfortunately unavoidable, because key generation is a random process and it is impossible to reliably predict how long it will take.
| |
| #*When the key generation is complete, a new set of controls will appear in the window to indicate this.
| |
| [[Image:putty_key_generator.jpg|center]]
| |
| # Set the key comment and password. Set the key comment to your email address by typing it into the "Key Comment" box. Set the password by entering it twice, once in the "Key passphrase" box and once in the "Confirm Passphrase" box.
| |
| #Save the keys:<br> save the public key on your desktop as <code>identity.pub</code> and the private one as <code>identity.ppk</code>
| |
| #Email the identity.pub file as an attachment to skboyd@ucalgary.ca and ask for it to be added to the .ssh/authorized_keys file for your cvs repository. Please specify which repository you are requesting access to in the e-mail (i.e., vtkMy).
| |
| #Setup environment variables
| |
| #* Choose Menus:<br>Start/Settings/Control Panel
| |
| #* Double click on the "System" Control Panel
| |
| #* Pick the "Advanced" tab and pick "Environment Varibles..."
| |
| #* Add User environement variables
| |
| #:- Add PLINK_PROTOCOL value "ssh"
| |
| #:- Add CVS_RSH value "plink"
| |
| #:- Edit or Add PATH appending value ";C:\Program Files\PuTTY"
| |
| # In WinCVS, bring up the "Preferences" dialogue box from the Admin menu
| |
| #* In the "General" tab put in your CVSROOT value, (i.e. <code>:ext:myusername@m177.enme.ucalgary.ca:/localhost/cvsroot</code>)<br>[[Image:Wincvs general.jpg|center]]
| |
| #* Switch to the "Ports" tab.
| |
| #* Tick the box there labelled "Check for an alternate rsh name" and in the text entry field to the right enter "plink". <BR>[[Image:Wincvs ports tab.jpg|center]]
| |
| #* Select "OK" on teh "Preferences" dialogue box.
| |
| # Once you've heard back from the administrator (skboyd) that your ssh keys have been added, test your putty key configuration:
| |
| #*Double click on "identity.ppk" on your desktop. If this doesn’t start pagaent.exe automatically, then manually start the program from the directory you installed putty.exe.
| |
| #* If your identity file isn't already loaded, you will be prompted for the password you entered in step 4.
| |
| #*The Pageant icon (a little PC with a hat) should appear in the bottom right menu bar.
| |
|
| |
|
| |
| You should now be able to use WinCVS to access the repository, with a secure connection whenever Pageant is running. You can start Pageant by double-clicking on your identity.ppk file.
| |
|
| |
| ==SmartCVS (Windows and MacOSX) ==
| |
|
| |
| This program is an option instead of using WinCVS. While it is easier to setup it is slower and WinCVS is preferred. It works great on MacOSX.
| |
|
| |
| #Download program from: http://www.syntevo.com/smartcvs/download.html
| |
| #Run program
| |
| #Choose “Check out project from repository”
| |
| ##Click Manage
| |
| ##Click Add
| |
| ##Click “Enter CVS-Location”
| |
| ##Type: :ext:username@m177.enme.ucalgary.ca:/localhost/cvsroot
| |
| ##Click “Next”
| |
| ##Choose password or Public/Private Key
| |
| #Either enter password or load key file and passphrase
| |
| #Click ‘Finish’
| |
| #When back to Check out project window, click next and wait for checkout
| |