Nov 19, 2014

HPC debugging tools

comparative debugging: fortran opnmp mpi
https://www.nersc.gov/users/software/debugging-and-profiling/ccdb-lgdb/

openmp runtime debugging
https://www.itc.rwth-aachen.de/go/id/ggqn/lidx/1

STAT from LANL
https://computing.llnl.gov/?set=code&page=index

Unit testing tools/ frameworks
travis ci
https://github.com/phpbb-extensions/test-framework


Oct 31, 2014

Running CMake Files with Catalist

http://www.cs.swarthmore.edu/~adanner/tips/cmake.php

--------------------------------------------------------------------------------------------------

ParaViewConfig.cmake files are needed to run these. So development version of Paraview has to be installed.
lib\paraview-XXX\ contains these files.
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
openmp-------------------------
gcc -fopenmp hello.c -o hello.o
export OMP_NUM_THREADS=4
.hello.o
-------------------------------
mpi----------------------------
uma@uma-Dell-System-XPS-L321X:~$ mpicc mpi_hello.c -o ./hello
uma@uma-Dell-System-XPS-L321X:~$ mpirun -np 2 ./hello
Hello world from process 0 of 2
Hello world from process 1 of 2
---------------------------------
latex
----------t-----------------------
cmake cmake version 2.8.12.2
vtk???
-------------------------------
Qt :http://qt-project.org/wiki/Install_Qt_5_on_Ubuntu
g++
------------------------------------------------------
OpenGl sudo apt-get install mesa-common-dev
sudo apt-get install libglu1-mesa-dev -y
home/ffmpeg : extracted files.
git
mesa 10.3.1 :http://www.paraview.org/Wiki/ParaView_And_Mesa_3D


make -j4 distclean # if in an existing build

autoreconf -fi

./configure \
    CXXFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
    CFLAGS="-O2 -g -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
    --disable-xvmc \
    --disable-glx \
    --disable-dri \
    --with-dri-drivers="" \
    --with-gallium-drivers="swrast" \
    --enable-texture-float \
    --disable-shared-glapi \
    --disable-egl \
    --with-egl-platforms="" \
    --enable-gallium-osmesa \
    --enable-gallium-llvm=yes \
    --with-llvm-shared-libs \
    --prefix=/work/apps/mesa/10.3.1/llvmpipe

sudo apt-get autoremove automake
sudo apt-get install automake

make -j2
sudo make -j4 install

-------------------------------------
--------------------------------------
Libraries have been installed in:
   /work/apps/mesa/10.3.1/llvmpipe/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
-----------------------------------------
-----------------------------------------


---------------------------------------------------------
-----------ffmpeg for ubuntu: discontinued in 14

sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
  libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libx11-dev \
  libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev

    mkdir ~/ffmpeg_sources

-----sudo apt-get install yasm-----
cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-nonfree \
  --enable-x11grab
PATH="$PATH:$HOME/bin" make
make install
make distclean
hash -r

https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
--------------------------------------------------------------

Prepare directory for download
 # mkdir $HOME/projects
 # cd $HOME/projects

To download the source code
 # git clone git://paraview.org/ParaView.git ParaView
 # cd ParaView
 # git checkout -b trunk origin/master
 # git submodule init
 # git submodule update

To update the code
 # git fetch origin
 # git rebase origin/master
 #git submodule update
---------------------------------------------
sudo apt-get install cmake-curses-gui
-----------------------------------------------
mkdir $HOME/projects/ParaView-bin
cd $HOME/projects/ParaView-bin

ccmake $HOME/projects/ParaView
-----------Here configure the variables like qt path etc..
sudo apt-get install libxt-dev //to fix    X11_Xt_LIB could not be found. 


---------------------------qt problem
reinstall and run on Paraview directory where the cmake.txt files are
cmake QT_QMAKE_EXECUTABLE==/home/uma/Qt/5.3/gcc_64/bin/qmake .

Oct 28, 2014

Configuring VTK and cmake

Installed in following order : openmpmpicmake vtk-------------------------------    Installation of VTK in Ubuntu (11.10 onward)
 
We typically use VTK together with Qt. To do that, please read the VTK with Qt section below.

To install the latest version of VTK alone, you may try the following method.

Installation of VTK is performed by compiling the source codes. Let's assume that you want to install VTK in /opt/VTK. Unzip the source files into /opt/VTK. Then, run the following commmands:

   cd /opt/VTK
   sudo cmake .
   sudo make
   sudo make install


The last instruction will install the .h, .a and .cmake files under /usr/local, such as /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8.For convenience of upgrading, it would be useful to create symbolic links such as /usr/local/include/vtk and /usr/local/lib/vtk to these directories:

   cd /usr/local/include
   sudo ln -s vtk-5.8 vtk
   cd /usr/local/lib
   sudo ln -s vtk-5.8 vtk


After installing VTK, go to the directory where cmake is installed, e.g., /usr/share/cmake-2.8. Then, go to the subdirectory Module and open the file FindVTK.cmake, and you'll see the following lines:

   # The following cache entries must be set by the user to locate VTK:
   # VTK_DIR  - The directory containing VTKConfig.cmake.


Insert a line into FindVTK.cmake to indicate where to find VTKConfig.cmake, in this case,

   SET(VTK_DIR "/usr/local/lib/vtk")

This completes the installation process.

For more information, refer to the README.html file that comes with the VTK source.
 
VTK with Qt
 
To use VTK with Qt, it is easier to install both Qt and VTK as follows:

   sudo apt-get install libqt4-dev libvtk5-qt4-dev

If you want to use the lastest vesion of VTK with Qt, then install the latest version of VTK as discussed in the preceding section. Next, create a build directory such as /opt/VTK-build, go to the build directory and run

   sudo ccmake ../VTK

In the text-based GUI, set the following options to "ON" by using arrow key to choose the option item and pressing enter to toggle the option:

   VTK_USE_QT
   VTK_USE_GUISUPPORT
   VTK_USE_QVTK

Press c to configure, then press g to generate the Makefile. Finally, compile VTK using the Makefile:

   sudo make
   sudo make install

The last command typically installs the .h and library files in /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8.
 
Compiling VTK Programs
 
To compile a VTK program, go to the directory that contains the program, create the file CMakeLists.txt. This file contains information that tells cmake how to generate the required make file. For example,

   CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

   PROJECT (test1)

   IF(NOT VTK_BINARY_DIR)
   FIND_PACKAGE(VTK REQUIRED)
   INCLUDE(${VTK_USE_FILE})
   ENDIF(NOT VTK_BINARY_DIR)

   ADD_EXECUTABLE(test1 test1.cpp)
   TARGET_LINK_LIBRARIES(test1 vtkRendering)


In this example, the name of the source file is test1.cpp and the names of the project and the executable are test1.

After creating CMakeLists.txt, compile the program as follows:

   cmake .
   make


The first command invokes cmake to create the makefile which make uses to compile the program.

For more information of using cmake, refer to examples in VTK's tutorial /opt/VTK/Examples/Tutorial or Kitware's online page.
  
Compiling Qt and VTK Programs
 
Refer to Compiling Qt and VTK Programs web page for information.
 
Documentation
 
For online documentation, browse VTK online documentation.

For offline documentation, download the html documentation from VTK website. Note that this documentation contains many, many files.
 
Reference: https://www.comp.nus.edu.sg/~leowwk/install-vtk.html

Apr 10, 2014

Installing openGL

sudo apt-get install build-essential
sudo apt-get install python-setuptools
sudo apt-get install python-pygame
sudo apt-get install python-opengl
sudo apt-get install python-gst0.10
sudo apt-get install python-enchant
sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install cython
sudo apt-get install python-dev
sudo apt-get update --fix-missing
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libegl1-mesa-dev
sudo apt-get install libgles2-mesa
sudo apt-get install libgles2-mesa-dev 
 

Your hardware/driver need to support the required OpenGL version, you can check the version reported using
glxinfo | grep "OpenGL version"
 
sudo apt-get update
    OpenGL: sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
    OpenAL: sudo apt-get install libopenal0a libopenal-dev
    ALUT:   sudo apt-get install libalut0 libalut-dev 

Apr 3, 2014

Ubuntu 12.10 bug : paraview

https://launchpad.net/~gladky-anton/+archive/paraview
http://ppa.launchpad.net/gladky-anton/precise-backports/ubuntu/dists/devel/main/binary-amd64/

So in essence: this is a common bug in Ubuntu.

http://www.cfd-online.com/Forums/openfoam-paraview/121904-nuisance-output-messages-paraview-3-12-0-64-bit-openfoam-version.html


The quickest solution to no longer have to be bothered by this kind of buggy warning messages, should be to do these steps as follows:

  1. Add the repository that has got the fixed ParaView 3.98 for Ubuntu 12.04 and 12.10, by running:
    Code:
    sudo add-apt-repository ppa:gladky-anton/paraview
  2. Then update apt-get's cache and upgrade ParaView:
    Code:
    sudo apt-get update
    sudo apt-get install paraview
  3. Then uninstall the ParaView 3.12.0 version that is provided for OpenFOAM:
    Code:
    sudo apt-get remove paraviewopenfoam3120
  4. Add an alias command to your "~/.bashrc" file:
    Code:
    alias paraFoam='paraFoam -builtin'
  5. Start a new terminal window and try running paraFoam from within your case folder.

Mar 10, 2014

wasabi xbox 360 mod to play backups from hard disk : a to z

Tutorials

general
http://xboxpirate.eu/forums/topic/1599-wasabi-360s-setup-and-installation-guide-beta/

check your dashboard version is compatible
https://www.youtube.com/watch?v=58gryfLMlew
-----------------------------------------------
get the dvd drive key
https://www.youtube.com/watch?v=4edHp_ltFpQ
hands on: http://www.ehow.com/how_5806788_out-360-dvd-drive-key.html
using computer:
---------------------------------------------------
or use wasabi ultra with auto key extraction
https://www.youtube.com/watch?v=BPtIVJ8IwYI

Where to get the hw
http://www.modchipcentral.com/store/wasabi360-wasabi-360-usa-canada.html
http://www.ebay.com/itm/TWO-Wasabi360-ultra-for-X360-Slim-/141155127529?pt=LH_DefaultDomain_0&hash=item20dd8050e9

installation
http://www.modcontrol.com/Board/xbox-360-reviewcenter/34738-wasabi360-ultra-x360s-review-english.html
http://team-xecuter.com/forums/archive/index.php/t-73706.
hard disk (esata)

Jan 31, 2014

Overwriting to set of files in a folder with awk + add a line to print existing variables with fortran

shell script

#!/usr/bin/
for file in *.txt
do
awk -f f.awk "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
done

awk script

{
  print gensub(/sqrt\(([^)]*)\)/,"&; print*, \"\\1\"","g")

}

Run the shell script to excecute
sh ./run.sh

This will execute the awk script
example:

input.txt

abc;
sqrt(7);
def;

after we run the script

input.txt will look like following.

abc;
sqrt(7); print, "7";
def;


Followers