Saturday, December 26, 2009

Ubuntu 9.04, 9.10, 10.04 Installation Tweaks

MATLAB
  • JRE 
    • sudo apt-get install sun-java6-jre

  • VPN 
    • sudo aptitude install network-manager-vpnc 
    • Panel --> VPN connections --> Configure VPN --> Import the .pcf file
    • IPv4 Tab --> click Routes --> uncheck "Use this connection only..."
    • click OK, Apply, Close
    • Reboot
    • Panel --> VPN connections --> MITnet VPN Connection
  • MATLAB
    • tar -xvf thefile 
    • cd thefolder
    • sudo ./install...sh

    Eclipse
    • download: http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-cpp-galileo-SR1-linux-gtk.tar.gz
    • tar -xvf thefile

    Microsoft Office
    • WineHQ 
      • wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
      • sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/jaunty.list -O /etc/apt/sources.list.d/winehq.list
      • sudo apt-get update
      • sudo apt-get install wine
      • (some steps may be redundant. need further checks.)

    • WineHQ (for 10.04)
      • Just go to Ubuntu Software Center. Search for it and install it.

    • Windows Programs
      • Right click on "setup.exe --> Open with "Wine Windows Program Loader"
      Latex
      • TexLive 
        • sudo apt-get install texlive (~200 MB) or
        • sudo apt-get install texlive-full (~700 MB)

      • TexMaker
        An Latex IDE with fewer KDE library dependencies
        Pros: smaller (~200 MB), looks nice, intuitive configuration
        Cons: not very good auto completion, no block indent 
        • sudo apt-get install texmaker
      • Kile
        An Latex IDE with huge KDE library dependencies
        Pros: looks nicer (much better than the screenshots in its official website) and many utilities
        Cons: fat (~500 MB)
        • sudo apt-get install kile

        Input Method (also works for 9.10 and 10.04)
        • noseeing 
          • sudo apt-get install gcin 
          • set up default input method manager: 
          • im-switch -s gcin 
          • download the mapping table 
          • wget http://edt1023.sayya.org/gcin/noseeing-12.tar.gz 
          • move the table to the gcin folder 
          • mv noseeing.gtab ~/.gcin  
          • Reboot and right click gcin-setup

          Numerical Libraries
          • Lapack (share)
            • sudo apt-get install liblapack3gf 
            • sudo ln -s /usr/lib/liblapack.so.3gf /usr/lib/liblapack.so

          • Blas (share)
            • sudo apt-get install libblas3gf 
            • sudo ln -s /usr/lib/libblas.so.3gf /usr/lib/libblas.so

          • GotoBlas (static)
            • download http://www.tacc.utexas.edu/tacc-projects/ 
            • tar -xvf thefile 
            • cd thefolder 
            • ./quickbuild.32bit or 
            • gedit Makefile.rule 
            • make 
            • mkdir temp --> cp libgoto2_penryn-r1.09p3.a ./temp --> cd temp 
            • unarchive: ar x libgoto2_penryn-r1.09p3.a 
            • recompile into a shared library:
            • gfortran -shared -Wl,-soname,libgoto2.so -o libgoto2.so.1.09p3 *.o
            • See here for the knowledge of shared libraries. 
            • sudo cp libgoto2.so.1.09p3 /usr/lib 
            • sudo ldconfig
          Misc.
          • Turn off the terminal beep (9.04 only)
            • Terminal --> Profiles --> Edit --> General Tab --> uncheck Terminal bell

          • RAR Archiver 
            • sudo apt-get install rar
            • sudo ln -fs /usr/bin/rar /usr/bin/unrar
          • 7z Archiver 
            • sudo apt-get install p7zip-full

            • Skype (works well for 9.04, 9.10, 10.04) 
              • http://www.skype.com/intl/zh-Hant/download/skype/linux/choose/ 
              • 8.10+ 32-bit works fine on 9.04 32-bit

            • Printer (D-Link DI-707p) 
              • System --> Administration --> Printing --> Devices --> Network Printer --> LPD/LPR Host or Printer --> Host: 192.168.0.1 Queue: lp
              • Select your printer driver

            • Codec (obsolete)
              • sudo apt-get install ubuntu-restricted-extras

            • Battery management (Thinkpad)
              • not yet done....

            • CPU hiss "CPU Whine" (from ThinkWiki)
              (for grub2, applicable to ubuntu 9.10 and after)
              • sudo joe /etc/default/grub 
              • Search for the line GURB_CMDLINE_LINUX="" 
              • Replace "" with "processor.max_cstate=2" 
              • If the original "" is not empty inside the double quote, simply add processor.max_cstate=2 before the closing quote mark, e.g. replace
              • GRUB_CMDLINE_LINUX="acpi_osi="Linux"" with 
              • GRUB_CMDLINE_LINUX="acpi_osi="Linux" processor.max_cstate=2"
              • sudo update-grub
              • sudo reboot
            • Install restricted codec and more
              • Launch Amarok 
              • Choose to install all recommended packages

              Thursday, December 24, 2009

              Installation List

              Windows 7:

              7-zip
              Anti-vir
              Dr. eye
              cwtex
              Eclipse
              GIMP
              Google Desktop
              Logitech driver
              MATLAB
              Microsoft Office
              Microsoft Visio
              FireFox
              • AutoPager, Video DownloadHelper, DownThemAll!, Forecastfox, Personal Menu,
              Chromifox, Foxdie: neat and configurable

              NX Client
              PC Man
              PDF Creator
              PDF Xchange Viewer
              RealPlayer
              Secure CRT/FX
              Skype
              WinDjView
              Windows Live
              X-Win32
              紫微論斷

              Ubuntu:
              Wine
              Microsoft Office, Visio
              MATLAB
              Firefox and its add-ons
              Fastcap
              GotoBLAS, libblas, liblapack
              Eclipse
              Nx server/client

              Ubuntu server:
              OpenSSH
              FTP

              Thursday, November 19, 2009

              Scientific Computing / Linear Algebra Library Survey

              This is my 101st times surveying linear algebra libraries for C++. Originally I tried to google the performance comparison from one to the other, but unexpectedly this is the most fruitful survey I have ever had since three months ago.

              1. Linear Algebra Libraries by Claire Mouton, March 2009.
                Detailed comparison btw CPPLapack, Eigen, Flens, Gmm++, GNU Scientific Library, IT++, Lapack++, MTL, PETSc, Seldon, SparseLib++, TNT, Trilinos, uBlas, and others by listing developers, license, interface, performance description, portability, dependencies, and some limitations. A very clear and useful document.

              2. On the Reusability and Numeric Efficiency of C++ Packages in Scientific Computing
                http://www.linuxclustersinstitute.org/conferences/archive/2003/PDF/Mello_U.pdf
                by Ulisses Mello and Ildar Khabibrakhmanov, IBM T.J. Watson Research Center, Yorktown, NY, USA

                Performance comparison by plots in different Blas level 1, 2, 3 experiments. It compares ATLAS, Goto Blas, Blitz, uBlas, STL implementation, Fortran 77 code, C code, bsm, MTL, and A++. It's more like pure performance comparison regardless its interface or whether there is OO wrapper or not. It also provides some observations and reasons why one beats another.

              3. Help choosing a C++ matrix library
                http://old.nabble.com/Help-choosing-a-C%2B%2B-matrix-library-td18857631.html
                In-depth forum discussion. Point out several requirements for a good matrix library.
              Some webpages regarding specific libraries:
              1. Goto Blas
                http://www.utexas.edu/features/2006/goto/
                The author's story. Goto is the author's Japanese last name. GotoBlas is known to be the fastest Blas library in the world. It is handcrafted down to assembly code for different specific architectures.
              2. Discussion about the adoption of either uBlas or MTL4
                http://stackoverflow.com/questions/1067821/ublas-vs-matrix-template-library-mtl4
                One mentioned Eigen.
              3. Eigen benchmark
                http://eigen.tuxfamily.org/index.php?title=Benchmark
                OO abstract, though it provides readable and maintainable code, is always a penalty for performance consideration. Eigen is one of the actively developing libraries which claims its performance. Others as I know are MTL and armadillo. One reason of not claiming performance of their C++ code is because although they provide OO interface, many of them are "wrappers" of Blas and Lapack, like IT++, Lapack++, in order to provide Fortran level performance instead of C++ implementations. It is interesting to note that Eigen claims their code is at a similar speed as ATLAS (Automatically Tuned Linear Algebra Software) and Goto Blas (critically parts are written in assembly). The other thing that is worth noting is that the FLOPS drops when performing vector-vector additions over a certain vector size, while in the IBM report above it happens in matrix-vector multiplication instead. By the way, the performance results are all about Blas level 1, 2, 3. None of them compare solving linear systems or some other advanced decomposition method, like SVD, Cholesky, eigenvalue, etc.
              Short conclusion: My criteria are OO wraper, namespace, performance, and actively developing or not. I used to be pro MTL4 before I look closer Eigen. Though their is no direct comparison between MTL4 and Eigen (there is a comparison btw MTL2 and Eigen where MTL2 is very slow in Eigen benchmark). MTL4 in their performance report does not beat Goto Blas but the Eigen authors claim they do. Though there is no way to convince myself the comparison is fair, Eigen does provide several "lazy" shortcut and comfortable coding interface compared with MTL4. The other candidate is Boost::uBlas. The advantage of uBlas is it is part of Boost project. That seems to imply more users and better maintenance at the first glance. However, comparing those three, MTL4 seems much more updated than uBlas, and Eigen is more actively updated on its website than the rest two. Eigen also seems more willing to provide other decomposition methods like SVD, eigenvalues.

              The last thing: license. LGPL vs. GPL used to be a very big drawback of Qt before version 4.5 since GPL means using the library is equivalent to open your source code to everyone who have access to GPL code (virtually every human being), while LGPL provides flexibility for commercial software and closed code is permitted. Eigen is either GPL or LGPL. It depends on your choice. MTL4 seems not that liberal.

              Friday, October 9, 2009

              LATEX: Font Style

              Crash Course in Latex
              http://www.haptonstahl.org/latex/basics_formatting.php
              • avant
              • bookman
              • chancery -- this is a nice flowing font
              • charter
              • courier
              • helvet (helvetica) -- this only changes the monospace font, and I don't know when that is used
              • lucida
              • newcent (new century)
              • palatino - great everyday font, very readable
              • pslatex
              • punk -- silly font
              • times (time new roman)
              • utopia
              All of these worked for me just by putting a line like this in the header
              \usepackage{avant}
              
              The font is automatically set for the whole document.

              Sunday, October 4, 2009

              LATEX: Miktex and cwtex installations

              It used to be trivial, but this time it takes me more than five hours.
              Tips are as the following:
              1. Edit c:\autoexec.bat. Change all d:\ to be c:\ if disk D is not a writable hard drive.
              2. Make sure the Miktex folder is not 'read-only.'
              3. Change cwps.bat file to set gsview in a correct path. (if the path of gsview in bat files is not set correctly.)
              Then, have fun! (0rz...)

              Wednesday, September 9, 2009

              QT: Use Qt Creator as an alternative of Eclipse CDT

              http://stackoverflow.com/questions/675986/how-does-qt-creator-shape-up-against-eclipse-cdt

              Simply remove all Qt headers and use C++ standard libraries.

              Test on: Qt Creator 1.2
              (Qt creator 1.0 needs more steps in order to make sure everything is correctly linked.)