Difference between revisions of "User experience"

From LIBISIS
Jump to navigation Jump to search
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
== ISIS LET control machine ==
+
 
The PC came prepared for Libisis and Horace. NeXus, Matlab and Intel Fortran compilers are installed. The task is to identify the locations of all parts, necessary for instillation and  run the installation script resolving all dependencies.  
+
==ISIS LET control machine==
 +
 
 +
The PC came prepared for Libisis and Horace. [http://download.nexusformat.org/kits/ NeXus], [http://www.mathworks.co.uk/products/matlab/index.html Matlab] and [http://software.intel.com/en-us/articles/intel-compilers/ Intel Fortran] compiler are installed. The task is to identify the locations of all parts, necessary for instillation and  run the installation script resolving all dependencies.  
  
 
'''1)''' Verify if nexus is installed
 
'''1)''' Verify if nexus is installed
Line 64: Line 66:
 
I assume 64 bit linux here. If it is 32-bit linux, check ''~/Libisis/Libisis/DLL/_glnxa'' folder;
 
I assume 64 bit linux here. If it is 32-bit linux, check ''~/Libisis/Libisis/DLL/_glnxa'' folder;
  
'''7)''' Building libisis is now completed. Start Matlab and check if it was successful.
+
 
 +
'''7)''' Building binary part of libisis is now completed. Start Matlab and check if it was successful.
 
   $matlab&
 
   $matlab&
 
 
   in matlab:
 
   in matlab:
 
   >>cd ~/Libisis/Libisis/DLL/_glnxa64
 
   >>cd ~/Libisis/Libisis/DLL/_glnxa64
Line 75: Line 77:
 
Follow Windows Maltab installation steps, described on [http://www.libisis.org/Download_and_setup_LIBISIS#Download_LIBISIS Libisis page].
 
Follow Windows Maltab installation steps, described on [http://www.libisis.org/Download_and_setup_LIBISIS#Download_LIBISIS Libisis page].
  
== University of Colorado Group ==
+
==University of Colorado Group==
  
Spacial thanks to '''Dan Parshall'''; dan_DOT_parshall_AT_colorado_DOT_edu, who shared his experience with us.  
+
Special thanks to '''Dan Parshall'''; dan.parshall_AT_colorado.edu, who shared his experience with us.  
  
  
Line 85: Line 87:
 
users.
 
users.
  
1) >>> get legacy file mwdebug.c in place <<<
+
'''1) >>> Get legacy file mwdebug.c in place <<<'''
    The file mwdebug.c (which one can get from Alex or Freddie) must be
+
 
placed into matlabroot/extern/src/ (one needs to make the src
+
The file mwdebug.c (which one can get from Alex or Freddie) must be placed into matlabroot/extern/src/ (one needs to make the src
 
directory).  Do the standard:
 
directory).  Do the standard:
chown -R root matlabroot/*
 
chmod -R 755 matlabroot/*
 
  
2) >>> set up IFORT <<<
+
  chown -R root matlabroot/*
    A 30-day trial is free, academic licenses fairly cheap (I've mucked about a bit, and gfortran seems to also be functional, but as a rule it's 20% slower).   
+
  chmod -R 755 matlabroot/*
    In order to invoke IFORT on the command line, one has to use the "source" command and link to the "compilervars.sh" script.   
+
 
 +
'''2) >>> set up IFORT <<<'''
 +
 
 +
A 30-day trial is free, academic licenses fairly cheap (I've mucked about a bit, and gfortran seems to also be functional, but as a rule it's 20% slower).  In order to invoke IFORT on the command line, one has to use the "source" command and link to the "compilervars.sh" script.   
  
 
Because one can't use "source" in combination with "sudo", one must change to the
 
Because one can't use "source" in combination with "sudo", one must change to the
Line 102: Line 105:
 
     source /path/to/ifort/compilervars.sh intel64
 
     source /path/to/ifort/compilervars.sh intel64
  
3) >>> run autogen.sh / configure / make (as root) <<<
+
'''3) >>> run autogen.sh / configure / make (as root) <<<'''
 +
 
 
One must set matlabroot directly- simlinks aren't followed properly
 
One must set matlabroot directly- simlinks aren't followed properly
 
   bash autogen.sh
 
   bash autogen.sh
Line 108: Line 112:
 
   make
 
   make
  
4) >>> set ownership and permissions of files made during compilation <<
+
'''4) >>> set ownership and permissions of files made during compilation <<'''
 
   chown -R <username> *
 
   chown -R <username> *
 
   chmod -R 777 *
 
   chmod -R 777 *
  
== Jülich Centre for Neutron Science ==
+
==Jülich Centre for Neutron Science==
  
Special thanks to '''Johannes Reim''', j_DOT_reim_AT_fz-juelich_DOT_de; who shared his experience with us;
+
Special thanks to '''Johannes Reim''', j.reim_AT_fz-juelich.de; who shared his experience with us;
  
  
Line 120: Line 124:
 
know a bit about matlab, linux and how horace and libisis works but
 
know a bit about matlab, linux and how horace and libisis works but
 
well, neither of that applied to me *g*.
 
well, neither of that applied to me *g*.
 +
  
 
Okay what did I do for the installation:
 
Okay what did I do for the installation:
 +
  
 
1. Installation of libisis, I actually did not do that myself, but the
 
1. Installation of libisis, I actually did not do that myself, but the
Line 179: Line 185:
 
14. Now you can start matlab, go to the lib folder and run the startup
 
14. Now you can start matlab, go to the lib folder and run the startup
 
routine -> Libisis and Horace should be initialised.
 
routine -> Libisis and Horace should be initialised.
 +
 +
 +
==If you need Libisis for data reduction==
 +
 +
Additional steps have to be considered if you need to use Libisis for data reduction.
 +
Libisis uses NeXus to access instrument description and NeXus[http://www.nexusformat.org] is HDF-based[http://www.hdfgroup.org/HDF5/] file format. Matlab also supports HDF5 and is supplied with its own HDF5 version. Unless you are very lucky, this would be not the version, the NeXus is linked with. Different run-time versions of HDF5 are incompatible with each other.  (e.g. Matlab 2010-2011a uses HDF5 1.8.3 and  Matlab 2011b uses HDF 1.8.6, when NeXus in Lucid 10.4.3 repository comes linked with HDF5-1.8.4 version). This mean that your Matlab application will crash as soon as you try to use NeXus unless you link NeXus against HDF5-libraries statically.
 +
 +
To do this you have to download static library version of HDF-5 or build this version from the source code and build NeXus linked against this library.
 +
Assuming that you have loaded source code for NeXus and HDF5 and are building hdf5 and Nexus in its default location /usr/local, the example of how to do it is as below:
 +
 +
  cd hdf5-1.8.3/
 +
  env CFLAGS="-fPIC -DPIC" ./configure --prefix=/usr/local/hdf5 --disable-fortran --with-pic --disable-shared
 +
  make
 +
  make check
 +
  sudo make install
 +
  ls /usr/local/hdf5/
 +
  ls /usr/local/hdf5/lib/  -- no dynamic libraries found
 +
 +
  cd ../nexus-4.2.1/
 +
  sudo apt-get mxml
 +
 
 +
  ./configure --with-hdf5=/usr/local/hdf5/
 +
  make
 +
  make check
 +
  sudo make install
 +
  ls /usr/local/lib/      -- nexus dynamic library is there .

Latest revision as of 14:54, 4 October 2011

ISIS LET control machine

The PC came prepared for Libisis and Horace. NeXus, Matlab and Intel Fortran compiler are installed. The task is to identify the locations of all parts, necessary for instillation and run the installation script resolving all dependencies.

1) Verify if nexus is installed

   $ locate libNeXus
   ...
  /usr/lib/libNeXus.so
  ...

2) Check if ifort works form command line:

  $ifort --version
  ifort (IFORT) 11.1 20100414
  Copyright (C) 1985-2010 Intel Corporation.  All rights reserved.

3) Identify where Matlab is really installed and if it has all files necessary to use it.

   $what matlab:
   /usr/local/bin/matlab
   $
   $ls -l /usr/local/bin
   ...
   lrwxrwxrwx 1 root   root        38 2011-03-18 11:48 matlab -> /usr/local/MATLAB/Matlab2010bSP1/bin/matlab
   ...

/usr/local/MATLAB/Matlab2010bSP1 is in our case or $MATLAB_ROOT folder which we will use everywhere, referring to matlab


4) Verify if mwdebug.c file is present:

  $
  $ls $MATLAB_ROOT/extern
  examples  include  lib

4a) etc folder is not there, so we have to make it and place mwdebug.c there.

  $
  $sudo mkdir $MATLAB_ROOT/extern/etc
  $sudo mv ~/Downdloads/mwdebug.c  $MATLAB_ROOT/extern/etc/

5) Download libisis from the repository

  $svn co https://svn.libisis.org/code/trunk Libisis


6) Use autotools to build libisis:

  $cd Libisis
  $ sh autogen.sh
  ...
  A lot of messages, no errors
  ...
  $./configure --with-matlabroot=/usr/local/MATLAB/Matlab2010bSP1
  ...
  A Lot of messages, no errors
  ...
  $make
  ...
  A lot of messages no errors
  ...

6) Check if libisis has been build successfully.

  $ls -l ~/Libisis/Libisis/DLL/_glnxa64
  ...
  -rwxr-xr-x 1 User Group 36434653 2011-09-14 19:09 libisisexc.mexa64
  ...

I assume 64 bit linux here. If it is 32-bit linux, check ~/Libisis/Libisis/DLL/_glnxa folder;


7) Building binary part of libisis is now completed. Start Matlab and check if it was successful.

  $matlab&
  in matlab:
  >>cd ~/Libisis/Libisis/DLL/_glnxa64
  >> aa=libisisexc();
  >> aa =
    $Revision:: 1808 $ ($Date:: 2011-03-29 21:43:21 +0000 (Tue, 29 Mar 2011) $)

Follow Windows Maltab installation steps, described on Libisis page.

University of Colorado Group

Special thanks to Dan Parshall; dan.parshall_AT_colorado.edu, who shared his experience with us.


This took a while to get back to, but eventually we got this sorted out. It was a combination of legacy files, compilers, permissions issues, and typos. I'm posting the solution here in order to help future Ubuntu users.

1) >>> Get legacy file mwdebug.c in place <<<

The file mwdebug.c (which one can get from Alex or Freddie) must be placed into matlabroot/extern/src/ (one needs to make the src directory). Do the standard:

  chown -R root matlabroot/*
  chmod -R 755 matlabroot/*

2) >>> set up IFORT <<<

A 30-day trial is free, academic licenses fairly cheap (I've mucked about a bit, and gfortran seems to also be functional, but as a rule it's 20% slower). In order to invoke IFORT on the command line, one has to use the "source" command and link to the "compilervars.sh" script.

Because one can't use "source" in combination with "sudo", one must change to the root account, then complete the remaining steps:

    cd /path/to/libisis
    sudo su
    source /path/to/ifort/compilervars.sh intel64

3) >>> run autogen.sh / configure / make (as root) <<<

One must set matlabroot directly- simlinks aren't followed properly

  bash autogen.sh
  ./configure --with-f77=ifort --with-f90=ifort --with-matlabroot=/path
  make

4) >>> set ownership and permissions of files made during compilation <<

  chown -R <username> *
  chmod -R 777 *

Jülich Centre for Neutron Science

Special thanks to Johannes Reim, j.reim_AT_fz-juelich.de; who shared his experience with us;


And afterwards I have to say, actually it is not that complex, if you know a bit about matlab, linux and how horace and libisis works but well, neither of that applied to me *g*.


Okay what did I do for the installation:


1. Installation of libisis, I actually did not do that myself, but the IT did it, because it should be installed for all users within our institute, but I sent them the instructions found on the subversion server of Libisis: http://svn.libisis.org/viewvc/LIBISISCode/trunk/Linux/README.linux?revision=1577

I will call the libisis directory $1 (think of $1as the variable for the full path to the directory)

2. check if there is a matlab folder within the libisis folder (we will need that later on)

3. download the up-to-date version of horace (not the one which is specified for linux)

4. Just extract it to your directory of choice, I will call the directory $2 (like $1)

5. download the homer-standalone from: http://download.libisis.org/kits/homer_standalone.zip

6. create a folder called InstrumentFiles, my suggestion would be creating it next to the Horace directory.

7. extract the content of the instrument_setup folder within into the created directory, I will call the directory $3 (like $1)

8. if not existing, create a lib directory within your home directory, and into that a matlab directory, access the matlab directory

9. link the Horace installation to the current directory: "ln -s $2 ."

10. go to the parent folder (should be "lib")

11. link the InstrumentFiles folder to this directory: "ln -s $3 ."

12. create a file called startup.m within this directory

13. edit it and insert the following: try

   libisis_off

catch end addpath('$1/matlab') %if there is a matlabfolder within the libsis directory use that, if all the matlab routines are directly within the libisis folder, then omit the "/matlab" libisis_init try

   horace_off

catch end addpath('$2') horace_init

14. Now you can start matlab, go to the lib folder and run the startup routine -> Libisis and Horace should be initialised.


If you need Libisis for data reduction

Additional steps have to be considered if you need to use Libisis for data reduction. Libisis uses NeXus to access instrument description and NeXus[1] is HDF-based[2] file format. Matlab also supports HDF5 and is supplied with its own HDF5 version. Unless you are very lucky, this would be not the version, the NeXus is linked with. Different run-time versions of HDF5 are incompatible with each other. (e.g. Matlab 2010-2011a uses HDF5 1.8.3 and Matlab 2011b uses HDF 1.8.6, when NeXus in Lucid 10.4.3 repository comes linked with HDF5-1.8.4 version). This mean that your Matlab application will crash as soon as you try to use NeXus unless you link NeXus against HDF5-libraries statically.

To do this you have to download static library version of HDF-5 or build this version from the source code and build NeXus linked against this library. Assuming that you have loaded source code for NeXus and HDF5 and are building hdf5 and Nexus in its default location /usr/local, the example of how to do it is as below:

 cd hdf5-1.8.3/
 env CFLAGS="-fPIC -DPIC" ./configure --prefix=/usr/local/hdf5 --disable-fortran --with-pic --disable-shared
 make
 make check
 sudo make install
 ls /usr/local/hdf5/
 ls /usr/local/hdf5/lib/   -- no dynamic libraries found
 cd ../nexus-4.2.1/
 sudo apt-get mxml
 
 ./configure --with-hdf5=/usr/local/hdf5/
 make
 make check
 sudo make install
 ls /usr/local/lib/       -- nexus dynamic library is there .