Personal tools
You are here: Home cmgui Wiki Peter's notes on building cmgui
Views
FrontPage >> Building cmgui on win32 >>

Peter's notes on building cmgui

last edited 1 year ago by pbier

This is the process I followed for getting cmgui to compile on a windows machine. Note that cmgui is usually developed on a linux machine.

Compiling cmgui on a windows machine

  • Step 1: Install Cygwin to provide a linux like environment

    To install Cygwin you will need to have administrator privileges on your machine. See Installing Cygwin for more info on how to do this.

  • Step 2: Create a short cut on the desktop to the Cygwin bash shell

    This shortcut will be used a lot as you are going to be using the bash shell a fair bit.

  • Step 3: Create a directory for cmiss root where the code and libraries will be placed

    I opened up a shell and created my cmiss root in the default home directory (ie in /cygdrive/n on my machine):

       mkdir cmiss
    

  • Step 4: Set up a .bash_profile file to set all your environmental variables up every time you start up a shell

    An easy way to setup your .bash_profile is to start up a cygwin bash shell and then type:: xemacs .bash_profile

    Now add the following lines to this file and then save:

       export CMISS_ROOT=/cygdrive/n/cmiss
       export SYSNAME=win32
    

    Note you will set CMISS_ROOT to be the appropriate directory on your system. Exit xemacs, close your shell script and restart your shell. Check the environmental variables have been set up by typing env | grep CMISS_ROOT

    You should see a line telling you that CMISS_ROOT=/cygdrive/n/cmiss (or whatever you have set CMISS_ROOT to).

  • Step 5: change into the cmiss root directory and use Subversion to checkout the cmgui module

    Assuming you have Subversion and your CMISS enironment variables set up correctly just type:

       cd $CMISS_ROOT
       svn checkout https://svn.physiomeproject.org/svn/cmiss/cmgui/trunk cmgui
    

  • Step 6: copy over the required image_libraries

    I used scp to copy over the required lib and include files for i386-win32 machines from bioeng22. If you want to have a look around the file structure on bioeng22, ssh there using:

       ssh yourusername@bioeng22.bioeng.auckland.ac.nz
    

    To secure copy the required image_libraries directories do the following:

       cd $CMISS_ROOT
       mkdir image_libraries
       mkdir image_libraries/lib
       mkdir image_libraries/include
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/image_libraries/lib/i386-win32/ image_libraries/lib
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/image_libraries/include/i386-win32/ image_libraries/include
    

  • Step 7: check out or copy over the required perl_interpreter code

    I used scp to copy over the required lib and source files for i386-win32 machines:

       cd $CMISS_ROOT
       mkdir perl_interpreter
       mkdir perl_interpreter/lib
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/perl_interpreter/lib/i386-win32/ perl_intrpreter/lib
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/perl_interpreter/source/  perl_interpreter 
    

  • Step 8: copy over the ITK source

    The ITK source is huge and takes a while to copy over:

       cd $CMISS_ROOT
       mkdir itk
       mkdir itk/lib
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/itk/lib/i386-win32 i386-win32/ itk/lib
       scp -r yourusername@bioeng22.bioeng.auckland.ac.nz:/hpc/cmiss/itk/src/ itk
    

  • Step 9: change into the cmgui directory and run make

    Compiling should now be fairly simple:: cd $CMISS_ROOT/cmgui make

    All going well, this should compile an executable and copy it to the appropriate directory. Check it has been built by looking in the following directory:

       ls $CMISS_ROOT/cmgui/bin/i386-win32
    

    Note this executable will not be able to open up graphics consoles but it can still be used to run comfiles. You may like to create an alias to it so that you can run it from anywhere without typing the full path name. I put the following in my .bash_profile file:

       alias cmgui=$CMISS_ROOT/cmgui/bin/i386-win32/cmgui-debug.exe
    

Contributing to this site

Please add to the wiki any relevant information that you think might be useful to other users of this website. For example, you might like to contribute your experiences, questions and answers.

You are encouraged to contribute to this site regardless of your level of experience. Contributions are welcomed from new and regular visitors.

If you ask a question and receive an answer from a developer you should record it in the wiki. This information is extremely useful and can help other users overcome the same problem.

See how to add and edit pages for more information.