Compilation for both GPU add -DGPU to the command line 


%%For CLARK and TUMBAO (opensuse 12.2)
  g++ optical_alignment.cpp -o xmipp_optical_alignment `pkg-config --cflags --libs opencv` -I$XMIPP_HOME -I$XMIPP_HOME/libraries -L$XMIPP_HOME/lib -lXmippData -lXmippExternal
%%For Crunchy (profesional suse 11 with manual compilation of opencv)
  g++ optical_alignment.cpp -o xmipp_optical_alignment `pkg-config --cflags --libs opencv` -I/gpfs/fs1/apps/opencv-2.4.8/include/ -L/gpfs/fs1/apps/opencv-2.4.8/lib/ -I$XMIPP_HOME -I$XMIPP_HOME/libraries -L$XMIPP_HOME/lib -lXmippData -lXmippExternal -lopencv_core -lopencv_gpu
  %THEN execute
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/gpfs/fs1/apps/opencv-2.4.8/lib/

Command line looks like:

  xmipp_optical_alignment     -i input_stack              -o output_aligned                   --winSize win_size --gpu use_GPU
  xmipp_optical_alignment_gpu -i 130_movie_gc_window.mrcs -o 105_movie_gc_window_aligned.mrcs --winSize 150      --gpu 1

where:

input stack: Name of the input video
output_aligned: Name of the aligned micrograph
win_size: Window size for optical flow algorithm
GPU: GPU device to be use 0/1. 0 by default.

IMPORTANT: xmipp environment needs to be available
(in clark ./usr/local/xmipp_master/.xmipp.bashrc)
