FARSIGHT HowToBuildLinux

From FarsightWiki
Jump to: navigation, search

Putty is a program for accessing the shell of a Linux server through the internet. The shell is the Windows's equivalent of a command prompt.

Follow each step in consecutive order to properly build Farsight in Linux.

Contents

Putty

  • Right-click mouse button to paste

Important information about Linux

  • Case sensitive ("thisismypassword" is not the same thing as "ThisIsMyPassword")
  • Tab to auto-complete
  • Typing "pwd" gives the full path of the working directory
  • Ctrl-C will usually exit you if you accidentally entered a program.

Common Linux Commands

ls [dir] (list the contents of the [dir] directory. If you do not specify dir, it will list the contents of the current directory)
cd [dir] (change directory)
pwd (print working directory)
rm [file or dir] (removes that file or directory <must be empty>)
rm -Rf [file or dir] (removes that file or directory recursively; -R is for recursive, -f is for force)

Instructions to Run Putty

  1. Run putty.exe
  2. Specify the Host Name
  3. Type a name for the Saved Sessions and then hit Save
  4. Double-click on your saved session to run
    Puttyconfiguration.jpg
  5. For the security alert that pops up, press "Yes." The shell will show up.
  6. Type in your login name
  7. Then type your password (the cursor will not move as you type this)

Helpful Shortcuts:

  • Right-click to paste in the shell.
  • Tab to auto-complete.

Download CMake

In the shell, type the following commands:

Note: the words highlighted in blue needs to be changed according to your info.

mkdir /data/htcheung #replace htcheung with your username
cd /data/htcheung
links http://www.cmake.org/cmake/resources/software.html  #Links is a text-based web browser for the Linux shell.

Arrow-key down to cmake-2.8.5.tar.gz and hit Enter.

DownloadCmake.jpg

Then Save.

SaveCmake.jpg

Hit the key 'q' to quit links

tar xzf cmake-2.8.5.tar.gz #Check for version number
cd cmake-2.8.5
mkdir /data/cmake/
./configure --parallel=16 --prefix=/data/cmake #Input the number of threads your computer has
make -j16 
make install #CMake should now be installed in /data/cmake/

Download QT

cd /data/htcheung
mkdir /data/htcheung/qt
links http://qt.nokia.com/downloads

Scroll down and click on "tar.gz".

Save

'q' to quit links

tar xvzf qt-everywhere-opensource-src-4.7.4.tar.gz -C /data/htcheung/qt
cd qt/qt-everywhere-opensource-src-4.7.4
./configure --prefix=/data/qt/
make -j16     #this will take a couple minutes
make install  #QT should now be installed in /data/qt

Download Boost

cd /data/htcheung
links http://www.boost.org/users/download/
#click on "Download"
#click on boost_1_47_0.tar.gz
#click on "direct link"

Save

Create Directories

mkdir src
cd src
mkdir boost
mkdir farsight
mkdir ITK
mkdir VTK
mkdir VXL

Download VXL, ITK, VTK, Farsight

svn co https://vxl.svn.sourceforge.net/svnroot/vxl/trunk VXL
git clone git://itk.org/ITK.git ITK
cd ITK
git checkout v4.0b01
cd ..
git clone git://vtk.org/VTK.git VTK
cd VTK
git checkout nightly-master
cd ..
svn checkout https://farsight-svn.ee.uh.edu/repos/farsight/trunk/ farsight

Extract Boost

cd ..
tar xzf boost_1_47_0.tar.gz -C ./src/boost

Create bin folder

mkdir targets
mkdir bin
cd bin

Build ITK

mkdir ITK
cd ITK
/data/cmake/bin/ccmake /data/htcheung/src/ITK

The following screen should appear:

CmakeITK.jpg

Note: Use the arrow keys to move cursor. Press 'c' to configure; 't' for advanced options; '/' to search; "Enter" to toggle between ON and OFF.

Turn OFF the following:

  • BUILD_EXAMPLES
  • BUILD_TESTING

Press 'c' to configure.

Press 't' for advanced options.

Press '/' to search for each option.

Turn ON the following:

  • ITKGroup_* or ITK_BUILD_ALL_MODULES
  • ITK_USE_64BITS_IDS
  • ITK_USE_REVIEW

Set CMAKE_INSTALL_PREFIX to /data/htcheung/targets/ITK (How to do this.)

Press 'c' to configure again and g to generate.

make -j16
make install
cd ..

Build VTK

mkdir VTK
cd VTK
/data/cmake/bin/ccmake /data/htcheung/src/VTK

Press 'c' to configure.

Turn OFF the following:

  • BUILD_EXAMPLES
  • BUILD_SHARED_LIBS
  • BUILD_TESTING

Press 't' for advanced options.

Press '/' to search for each option.

Turn ON the following options:

  • VTK_USE_BOOST
  • VTK_USE_GUISUPPORT
  • VTK_USE_QT

Press 'c' to configure again.

Turn ON the following option:

  • VTK_USE_QTCHARTS

Set CMAKE_INSTALL_PREFIX to /data/htcheung/targets/VTK (How to do this.)

Set QT_QMAKE_EXECUTABLE to <tt>/data/qt/bin/qmake

Press 'c' to configure and then 'g' to generate.

make -j16
make install
cd ..

Build VXL

mkdir VXL
cd VXL
/data/cmake/bin/ccmake /data/htcheung/src/VXL

Press 'c' to configure.

Press 'e' to exit help.

Set CMAKE_INSTALL_PREFIX to /data/htcheung/targets/VXL

Turn OFF the following:

  • BUILD_BRL
  • BUILD_CONVERSIONS
  • BUILD_EXAMPLES
  • BUILD_GEL
  • BUILD_OUL
  • BUILD_OXL
  • BUILD_PRIP
  • BUILD_TBL
  • BUILD_TESTING

Press 't' for advanced options.

Turn the following options ON:

  • BUILD_RPL_RGTL

Press 'c' to configure and then turn the following option ON:

  • BUILD_RPL_RTVL

Press 'c' to configure and then 'g' to generate.

make -j16
make install
cd ..

Build Farsight

mkdir farsight
cd farsight
/data/cmake/bin/ccmake /data/htcheung/src/farsight

Press 'c' to configure.

Press 'e' to exit help.

Set your desired modules to ON.

Set CMAKE_INSTALL_PREFIX to /data/htcheung/targets/farsight

Set ITK_DIR to: /data/htcheung/bin/ITK

Press 'c' to configure. There should be a warning about finding VXL_DIR.

Press 'e' to exit help.

Set VXL_DIR to: /data/htcheung/bin/VXL (Use '/' to search for VXL)

Set VTK_DIR to: /data/htcheung/bin/VTK

Set QT_QMAKE_EXECUTABLE to: /data/qt/bin/qmake

Press 'c' to configure and 'g' to generate.

To fix bug in vul_file.h:

nano -w /data/htcheung/src/VXL/core/vul/vul_file.h

Ctrl+_ (go to line) 120 change the line from:

#if defined(VCL_WIN32) && VXL_USE_WIN_WCHAR_T

to

#if defined(VCL_WIN32) 
#if VXL_USE_WIN_WCHAR_T

Press Ctrl+_. Type 212 and "Enter".

Add another #endif immediately below the existing one.

Ctrl-X to save. Press 'Y' to save modified buffer.

Press "Enter" to accept the location where to save file.

make -j16
make install

Finished!!

Notes

How to change directory in CMake:

  1. Arrow-key down or '/' to search.
  2. To change to line where the cursor is, press "Enter"
  3. Arrow-key right and "Backspace" to remove current text and type your desired text.
  4. Press "Enter" to accept.