VtkMy development

From bone.wiki
Revision as of 21:11, 17 November 2009 by Enodwell (talk | contribs) (→Setting up CVS access from Linux/Unix: Removed - content moved to SSH page)
Jump to navigation Jump to search

vtkMy Installation

Apple
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

 add the following lines to your .bash_profile file
# 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

3. Restart your terminal session, or type:

   $ source ~/.bash_profile

Compiling vtkMy

NOTE: The following directions are outdated and need to be updated.

Required Software

To build vtkMY, you will require SVN, CVS, Qt, ITK and VTK. Refer to the instructions for relevant platform:

Building On Windows

  1. Download vtkMy source using WinCVS (see SmartCVS below as option to WinCVS)
    • a. Verify home directory as set up in Step 5.a.i.
    • b. Open menu Remote-> Checkout Module
      • Enter the following settings:
    Module name and path on server: vtkMy
    Local folder to checkout to: C:\pack\
    Check box: CVSROOT
    CVSROOT: :ssh:username@m177.enme.ucalgary.ca:/localhost/cvsroot
      • Click Ok
      • You will be prompted for your password to access the machine
      • Wait for checkout to complete
  2. Build vtkMy using Cmake
    • a. Open Cmake
    • b. Choose C:\pack\vtkMy\src as source code
    • c. Make C:\pack\vtkMy\bin binary code location
    • d. Click ‘Configure’ and choose desired compiler
    • e. Click the ‘Show Advanced Values’ check box and verify the following settings, all others can be left as defaults:
    BUILD_APPLICATIONS: ON
    BUILD_SHARED_LIBS: ON
    BUILD_TEST_PROJECTS: ON
    BUILD_MIXED_PROJECTS: ON
    BUILD_BACKWARDS_COMPATIBILITY: 2.4
    CMAKE_INSTALL_PREFIX: C:/Program Files/VTKMY
    USE_ITK: ON
    USE_QT: ON
    USE_FLTK: OFF
    • f. Click ‘Configure’, all red values should turn grey
    • g. May have to click configure again if any red values are still present
    • h. Click ‘Ok’, wait as Cmake will close automatically
  3. Add the following environment variables:
    1. Open the Control Panel
    2. Double click and open 'System'
    3. Go to the 'Advanced tab' and click on the 'Environment Variables' button
    4. In the System Variable Section click on the 'Path' variable and click 'edit'
    5. Add the following values separated by semi-colons
    C:\pack\vtkMy\bin\Debug
    C:\pack\vtkMy\bin\Utilities\tetrapack\Debug
    C:\pack\vtkMy\bin\Utilities\aimpack64\Debug
    C:\pack\vtkMy\bin\Unsorted\Debug
  4. Build vtkMy using Visual Studio (or desired program)
    1. Open C:\pack\vtkMy\bin\vtkmy.sln (.dsw)
    2. Click ‘Build’


Add a project to vtkMy

  1. Add a new project directory in the vtkMy/src/Applications directory.
  2. Update the CMakeLists.txt file in /src/Applications to include the new directory in the SUBDIRS() list.
  3. 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.
  4. Edit the copied CMakeList.txt file and the change the name of the .cxx to the name of the new project.
  5. Run CMake, taking the source code from vtkMy/src and building the binaries in vtkMy/bin.
  6. 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).
  7. Compile your new code. Usually, all the development should be done in the “Debug�? mode (rather than “Release�?, etc.).
  8. 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.


File:VtkMy Project Settings.jpg


WinCVS and PuTTY for vtkMy

NOTE: An alternative CVS client has been suggested, see following section:

SmartCVS from www.syntevo.com with a foundation license. 

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.

  1. Install PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/).
  2. Install wincvs (http://www.wincvs.org/)
  3. Make a key:
    • Follow menus: Start/Programs/PuTTY/PuTTYgen From the PuTTY Manual:
    ...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.

File:Putty key generator.jpg

  1. 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.
  2. Save the keys:
    save the public key on your desktop as identity.pub and the private one as identity.ppk
  3. 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).
  4. Setup environment variables
    • Choose Menus:
      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"
  5. In WinCVS, bring up the "Preferences" dialogue box from the Admin menu
    • In the "General" tab put in your CVSROOT value, (i.e. :ext:myusername@m177.enme.ucalgary.ca:/localhost/cvsroot)
      File:Wincvs general.jpg
    • 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".
      File:Wincvs ports tab.jpg
    • Select "OK" on teh "Preferences" dialogue box.
  6. 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.

  1. Download program from: http://www.syntevo.com/smartcvs/download.html
  2. Run program
  3. Choose “Check out project from repository”
    1. Click Manage
    2. Click Add
    3. Click “Enter CVS-Location”
    4. Type: :ext:username@m177.enme.ucalgary.ca:/localhost/cvsroot
    5. Click “Next”
    6. Choose password or Public/Private Key
  4. Either enter password or load key file and passphrase
  5. Click ‘Finish’
  6. When back to Check out project window, click next and wait for checkout