08 June 2012

183. Compiling OpenMM 4.1 on debian testing

OpenMM 4.0 is still somewhat of a traumatic memory. However, having gotten a question about the compilation of v4.1 I can't really resist giving the new version a go.

Having said that, I never ended up using the GPU-enabled gromacs for which I built openmm, so it was all an enormous waste of time -- for those of you thinking about GPU/Gromacs know this:
* not all graphics cards are supported or worth supporting
* there's no speed-up for explicit solvent molecules, and what else would you use gromacs or MD for?
* consumer-grade graphics cards get very hot

I make no attempt at ferreting out what packages are needed other than what I'm explicitly prompted for. Look at http://verahill.blogspot.com.au/2012/01/debian-testing-64-wheezy_20.html for an indication of what you might need.

Also, I already have openmm 4.0 installed, so e.g. paths and other things defined in the post above are still active.


Start here
Register with simtk.org and download the source file.
sudo apt-get install cmake-curses-gui libgccxml-dev gccxml nvidia-cuda-toolkit
unzip -x OpenMM4.1-Source.zipe
mkdir openmm_build
cd openmm_build/
ccmake -i ../OpenMM4.1-Source/

It'll say Empty Cache. Hit c which will populate the list.

I think we can ignore the EMU libs since they do device emulation. I never figured out what the CUT program was and it's not mentioned in the manual from what I can see.


These are the settings I chose -- I had problems before setting the OPENCL parts (in red) to off.

BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/home/verahill/.openmm
CUDA_BUILD_TYPE:STRING=Device
CUDA_INSTALL_PREFIX:PATH=/usr/bin
CUDA_NVCC:FILEPATH=/usr/bin/nvcc
DL_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libdl.so
FOUND_CUBLAS:FILEPATH=/usr/lib/x86_64-linux-gnu/libcublas.so
FOUND_CUBLASEMU:FILEPATH=FOUND_CUBLASEMU-NOTFOUND
FOUND_CUFFT:FILEPATH=/usr/lib/x86_64-linux-gnu/libcufft.so
FOUND_CUFFTEMU:FILEPATH=FOUND_CUFFTEMU-NOTFOUND
FOUND_CUT:FILEPATH=FOUND_CUT-NOTFOUND
FOUND_CUT_INCLUDE:PATH=FOUND_CUT_INCLUDE-NOTFOUND

GCCXML_EXTRA_ARGS:STRING=
GCCXML_PATH:FILEPATH=/usr/bin/gccxml
OPENMM_BUILD_AMOEBA_CUDA_LIB:BOOL=ON
OPENMM_BUILD_AMOEBA_PLUGIN:BOOL=ON
OPENMM_BUILD_CUDA_LIB:BOOL=ON
OPENMM_BUILD_CUDA_TESTS:BOOL=TRUE
OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS:BOOL=ON
OPENMM_BUILD_FREE_ENERGY_CUDA_LIB:BOOL=ON
OPENMM_BUILD_FREE_ENERGY_PLUGIN:BOOL=ON
OPENMM_BUILD_OPENCL_LIB:BOOL=OFF
OPENMM_BUILD_OPENCL_TESTS:BOOL=OFF
OPENMM_BUILD_PYTHON_WRAPPERS:BOOL=ON
OPENMM_BUILD_RPMD_OPENCL_LIB:BOOL=OFF
OPENMM_BUILD_RPMD_PLUGIN:BOOL=ON
OPENMM_BUILD_SERIALIZATION_SUPPORT:BOOL=ON
OPENMM_BUILD_STATIC_LIB:BOOL=ON
OPENMM_GENERATE_API_DOCS:BOOL=OFF
OPENMM_SVN_REVISION:STRING=exported
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
SVNVERSION_PROGRAM:FILEPATH=/usr/bin/svnversion
SWIG_EXECUTABLE:FILEPATH=/usr/bin/swig
SWIG_VERSION:STRING=2.0.7

Make your changes and hit c again, then hit g which brings you back to the terminal.



make -d|tee make.log
make test


If all goes well you'll see
126/126 Test #126: TestParser ......................................   Passed    0.02 sec
100% tests passed, 0 tests failed out of 126
Total Test time (real) = 345.83 sec
make install


[..]
-- Installing: /home/verahill/.openmm/examples/Makefile
-- Installing: /home/verahill/.openmm/examples/NMakefile
-- Installing: /home/verahill/.openmm/examples/MakefileNotes.txt
-- Installing: /home/verahill/.openmm/examples/Empty.cpp

And you are done!

tree ~/.openmm/ -L 4 -d
.openmm/
|-- bin
|-- docs
|   |-- api-c++
|   `-- api-python
|-- examples
|   `-- VisualStudio
|-- include
|   `-- openmm
|       |-- internal
|       `-- serialization
|-- lib
|   `-- plugins
`-- licenses


182. Oracle Java JDK (java, javac and javaws) in debian testing/wheezy

With ECCE I was having problems with getting the same version of java and javac on a computer where I was using sun java 6.0

Since I'm using SGE I (think I) need the closed source SUN java version.
Download (and click on the license agreement) here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html


(v7u4 is available here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u4-downloads-1591156.html
)


Then follow this: http://verahill.blogspot.com.au/2012/04/installing-sunoracle-java-in-debian.html
sudo apt-get install java-package
make-jpkg jdk-6u32-linux-x64.bin

and follow the instructions. Once the package is built, install:
sudo dpkg -i oracle-j2sdk1.6_1.6.0+update32_amd64.deb

Unpacking oracle-j2sdk1.6 (from oracle-j2sdk1.6_1.6.0+update32_amd64.deb) ...
Setting up oracle-j2sdk1.6 (1.6.0+update32) ...
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/ControlPanel to provide /usr/bin/ControlPanel (ControlPanel) in auto mode.
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/iceweasel/plugins/libjavaplugin.so (iceweasel-javaplugin.so) in auto mode.
update-alternatives: using /usr/lib/jvm/j2sdk1.6-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/chromium/plugins/libjavaplugin.so (chromium-javaplugin.so) in auto mode.
sudo update-alternatives --config java
There are 6 choices for the alternative java (providing /usr/bin/java).
  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /usr/bin/gij-4.4                                 1044      manual mode
  2            /usr/bin/gij-4.6                                 1046      manual mode
* 3            /usr/lib/jvm/j2re1.6-oracle/bin/java             314       manual mode
  4            /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/java        315       manual mode
  5            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  6            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      auto mode
  1            /usr/lib/jvm/j2sdk1.6-oracle/bin/javac        315       manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1051      manual mode
sudo update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                              Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      auto mode
* 1            /usr/lib/jvm/j2re1.6-oracle/bin/javaws             314       manual mode
  2            /usr/lib/jvm/j2sdk1.6-oracle/jre/bin/javaws        315       manual mode
  3            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      manual mode




While I was making the package this little guy popped up. Don't fret. I think it was meant to take me to the java.com website or something similar. I don't like the sight of that /root/ thingy though -- what's oracle thinking of us punters?





07 June 2012

181. Compiling openmpi on debian wheezy

There's nothing complicated about this compilation. It's not a terribly quick build though, and I'm not yet sure exactly what packages are necessary.

sudo apt-get install build-essential gfortran
wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.tar.bz2
tar xvf openmpi-1.6.tar.bz2
cd openmpi-1.6/

sudo mkdir /opt/openmpi/
sudo chown ${USER} /opt/openmpi/
./configure --prefix=/opt/openmpi/1.6/ --with-sge

make
make install

And you're done.

tree -L2 -d /opt/openmpi




Linking to the libs is done as before, although the path to e.g. libmpi.so is /opt/openmpi/1.6/lib/ and not /opt/openmpi/1.6/lib/openmpi/ like in the regular debian package.

.

└── 1.6
    ├── bin
    ├── etc
    ├── include
    │   ├── openmpi
    │   └── vampirtrace
    ├── lib
    │   ├── openmpi
    │   └── pkgconfig
    └── share
        ├── man
        ├── openmpi
        └── vampirtrace


You might also want to update the /etc/alternatives/libmpi.so symlink.

This is definitely one of those packages where it's worth doing ./configure --help to see what options are available.

Also, I imagine that on ROCKS there may well be a few packages which will have to be compile first and specified using --with-<> switches.

A sample:

  --with-blcr(=DIR)       Path to BLCR Installation
  --with-blcr-libdir=DIR  Search for BLCR libraries in DIR
  --with-hwloc(=DIR)      Build hwloc support. DIR can take one of three
  --with-hwloc-libdir=DIR Search for hwloc libraries in DIR. Should only be
  --with-valgrind(=DIR)   Directory where the valgrind software is installed
  --with-memory-manager=TYPE
  --with-libpicl(=DIR)    Build libpicl support, optionally adding
  --with-libpicl-libdir=DIR
  --with-timer=TYPE       Build high resolution timer component TYPE
  --with-portals=DIR      Specify the installation directory of PORTALS
  --with-portals-libs=LIBS
                          Libraries to link with for portals
  --with-alps             Build ALPS scheduler component (default: no)
  --with-lsf(=DIR)        Build LSF support
  --with-lsf-libdir=DIR   Search for LSF libraries in DIR
  --with-pmi              Build PMI support (default: no)
  --with-cray-pmi-ext     Include Cray PMI2 extensions (default: no)
  --with-slurm            Build SLURM scheduler component (default: yes)
  --with-tm(=DIR)         Build TM (Torque, PBSPro, and compatible) support,
  --with-ftb(=DIR)        Build FTB (Fault Tolerance Backplane) support,
  --with-ftb-libdir=DIR   Search for FTB (Fault Tolerance Backplane) libraries
  --with-esmtp(=DIR)      Build esmtp support, optionally adding DIR/include,
  --with-esmtp-libdir=DIR Search for the esmtp libraries in DIR
  --with-sge              Build SGE or Grid Engine support (default: no)
  --with-loadleveler      Build LoadLeveler scheduler component (default: yes)
  --with-elan(=DIR)       Build Elan (QsNet2) support, searching for libraries
  --with-elan-libdir=DIR  Search for Elan (QsNet2) libraries in DIR
  --with-mx(=DIR)         Build MX (Myrinet Express) support, optionally
  --with-mx-libdir=DIR    Search for MX (Myrinet Express) libraries in DIR
  --with-openib(=DIR)     Build OpenFabrics support, optionally adding
  --with-openib-libdir=DIR
  --with-portals(=DIR)    Build Portals support, optionally adding
  --with-portals-config   configuration to use for Portals support. One of
  --with-portals-libs=LIBS
                          Libraries to link with for portals
  --with-sctp(=DIR)       Build SCTP support, searching for libraries in DIR
  --with-sctp-libdir=DIR  Search for SCTP libraries in DIR
  --with-knem(=DIR)       Build knem Linux kernel module support, searching
  --with-udapl(=DIR)      Build uDAPL support, optionally adding DIR/include,
  --with-udapl-libdir=DIR Search for uDAPL libraries in DIR
  --with-fca(=DIR)        Build fca (Mellanox Fabric Collective Accelerator)
  --with-io-romio-flags=FLAGS
  --with-mxm(=DIR)        Build Mellanox Messaging support
  --with-mxm-libdir=DIR   Search for Mellanox Messaging libraries in DIR
  --with-psm(=DIR)        Build PSM (Qlogic InfiniPath) support, optionally
  --with-psm-libdir=DIR   Search for PSM (QLogic InfiniPath PSM) libraries in
  --with-contrib-vt-flags=FLAGS
  --with-event-rtsig      compile with support for real time signals
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR