Monday, September 17, 2018

Moving with the Times : Topspin 1.3 PL10 on a CentOS 7 machine - 32 Bit version

I will quickly summarize the barebone list of 'todo' for you to setup a CentOS 7 system and make it play with the ageing Topspin 1.3 PL10 version application.

 I assume that you have built a system with CentOS 7 32 bit version (about the 64 bit version, later).

You enter the commands shown here in a BASH shell window.  Unless mentioned otherwise, you should be root or use the 'sudo' method to execute the command as a superuser.

 Firewall configuration :

By default, CentOS 7 enables firewalld daemon in place of the older iptables.  Please note that kernel still uses iptables functionality for network packet filtering but firewalld  is the wrapper that communicates with this function.  So the so-called 'iptables service' is not installed in CentOS 7 by default. 

You can install iptables as root (or sudo user)  viayum install iptables-services

Then, if you are paranoid like me,  you can disable the firewalld daemon and enable iptables in one step like so : 

systemctl disable firewalld; systemctl stop firewalld; systemctl start iptables; systemctl enable iptables

The semicolon separates each command on the same line and so the steps of stopping firewalld and starting iptables services are done with very little gap in time between the two commands. For that duration, in theory, the system  is vulnerable when the Kernel netfilter table is fleshed of all rules, but we are probably talking on the order of milliseconds and so it should be fine. 

Please make sure that you have enabled full access to the eth1 network interfaceIn my case the iptables entry contains the following to ensure that the communication between the Linux machine and NMR console is unhindered by the firewall :

 -A INPUT -i eth1 -j ACCEPT

In case  you are wondering, since this dedicated interface card is not connected to the internet and the spectrometer is on the so-called 'non routable subnet' i.e. 149.236.99.0, there are no security problems involved in this configuration.


 Other Linux and Network related configurations specific to CentOS 7 :

CentOS 7 defines the network interface cards with a new naming scheme and the flexlm license manager will not recognize these names.  The names look something like 'p4p1' instead of the older 'eth0'.   To restore this older naming, you have to take a few steps :
  •   /etc/default/grub :  In this file, you most probably already have an entry such as : GRUB_CMDLINE_LINUX="crashkernel=auto..." etc.  Add, within the double quotes, the following phrase at the end of this line : net.ifnames=0 biosdevname=0"
 Next step is to configure the definitions of your 'eth0' and 'eth1' interface cards. These are done via two files, one for each interface, stored under : /etc/sysconfig/network-scripts/. You might have files already created with the default names such as :  ifcfg-p4p1, pertaining to the original interface naming conventions.  After creating a new file for each interface card, you should either remove or rename the files with names such as above.

  • eth0 : you create or edit a file : ifcfg-eth0The entries in my case looks as below :
    • TYPE="Ethernet"
      BOOTPROTO="dhcp"
      DEFROUTE="yes"
      IPV4_FAILURE_FATAL="no"
      IPV6INIT="yes"
      IPV6_AUTOCONF="yes"
      IPV6_DEFROUTE="yes"
      IPV6_FAILURE_FATAL="no"
      NAME="eth0"
      UUID="95260f6a-4ac2-4fa2-b72b-32a67b46103a"
      DEVICE="eth0"
      ONBOOT="yes"
      DNS1="128.95.120.1"
      DOMAIN="128.95.172.1"

      PEERDNS="yes"
      PEERROUTES="yes"
      IPV6_PEERDNS="yes"
      IPV6_PEERROUTES="yes"
      IPV6_PRIVACY="no"
      NM_CONTROLLED="no"
    • The things we need to focus on in this file are those in red and blue.  
      •  You set BOOTPROTO  to "dhcp"  if your system derives its IPV4 address from a DHCP server (in case you are wondering, DHCP stands for Dynamic Host Configuration Protocol) - similar to the router at home that provides addresses to all the devices you connect
      • You should set this to "none", if you are provided a 'static ip' address by your network czar for this system (less common nowadays). 
      • The NAME field is what identifies this interface card as 'eth0', which will keep the flexlm license manager happy for starting Topspin later.  The DEVICE field is only optional and so you can even remove it to avoid confusion between NAME and DEVICE definitions.
      •  ONBOOT is what tells the system that the network card should be started up when a reboot occurs. When troubleshooting network issues, we normally set this to 'no', since a inactive/failed Network card startup normally hangs the system for a long time during boot.   Once everything is working, this should be  set to "yes".
      • You must set the NM_CONTROLLED to "no"
        • NetworkManager is a so-called daemon that handles network address allocation and such in a mobile environment such as a wifi network space and when you are moving around with a laptop. This is the module that makes it possible for your smartphone automatically connect with the wifi in that coffee shop that  you visited a month ago without asking any questions.  
        • IN a static environment such as a desktop workstation system, it is quite safe to turn this off (I will tell how, in a bit).  Turning off NetworkManager control means that the definitions in the ifcfg-ethX files will be the ONLY ones used for configuration of the network for both eth0 and eth1, even after a system reboot.
      • As to the blue entries, these are not needed at all, if you your BOOTPROTO is set to "dhcp". The DHCP server will supply these automatically.   They are there in my case because, I copied this file from a static IP configuration.  They do not hurt to keep, though.       






 

Topspin 1.3 specific things to install on the Linux Side : 

I once again take it that you have installed the Topspin 1.3 PL10 software under the /opt/topspin tree.  The install script will throw up a few errors but for the present you ignore those. The check list in the following will address all those. The bold faced names are those of programs or files that need to be installed/updated  :
  • Install bootparamd.  The Topspin 1.3 DVD has a copy, if you cannot download the 'bootparamd.i686' version from the default repository.  As of this writing,  the EPEL repository is not yet up for CentOS 7 32 bit version.  So, you may have to use the rpm in the DVD.
  • Install portreserve. This is nothing but the portmapper,  which is needed for communication between the CCU and the PC.  
  • Check that the installation script successfully updated the following. You can edit these files by hand and add the following, if the install script didn't do it
    •  /etc/hosts. The entries pertaining to Topspin are :  
      •  149.236.99.1    ASP_ST2
        149.236.99.99    spect
    •  /etc/exports 
      •  /usr/diskless/dl_usr            spect(sync,ro)
        /usr/diskless/clients/spect     spect(sync,rw,no_root_squash)
    • /etc/services : the following line should be there
      •  bruker_ls    1753/tcp    # FLEXlm licensing for Bruker
    • /etc/hosts.allow : make sure that this entry is present
      •  ALL : 149.236.99.99

  • Configuring NFS :
    •  Since the CCU/11 uses, by now a rather old implementation of NFS i.e. version 2, the NFS server on the Linux side should be explicitly enabled to accommodate that.  Many distributions will have the default configuration set to honor NFS connection requests using either version 3 or 4.  
    • Make sure you have the following entry in /etc/sysconfig/nfs
      • RPCNFSDARGS="-V 2"

Friday, March 9, 2018

Topspin 3.5PL6 and my Fedora 27 box

AU programs and Compilation


Since the AU compilation issues have been vexing me for a while, I moved in the direction of creating couple of CentOS 7 virtual machines to run Topspin, hopefully with no issues.  My previous posts in relation to Topspin3.5 on CentOS 7 were driven by this workaround.

The bad news is that, even within the CentOS 7 (both 32 bit and 64 bit), I have been running into AU compilation errors.  This pointed to a common source of the pain and so I decided to take a stab at making TS3.5PL6 play nicely with my Fedora 27, once again.

The good news is that, it works !

The take home message is that :

  • Bruker did make progress to keep up with the current advances in the Linux world, by providing a systemd unit file to start the bruker license manager script at boot time. 
  • But, not all the components of the Topspin software (upto 3.5, that is) have been ported to play well with 64 bit libraries.
Example Case :

If you get an error message similar to the following, when you compile a stock AU program, this means that, you are still missing the 32 bit libraries.

 cplbruk : Compilation of angle failed with exit(1)
09-13:42:33.098   external cmd from "/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory


It turns out that the linker is missing some of the libraries such as crti.o from /usr/lib tree, even though they do exist in /usr/lib64. 

Solution

 Fedora 27 :

dnf install glibc-devel.i686 

did it for me.  You can now check that indeed the object libraries crt1.o and crti.o are found in /usr/lib.

 
 
 

Monday, October 16, 2017

Topspin 3.5pl6 on a CentOS 7 64 bit system....more than libraries

Let us start refreshing ourselves with the following notes, before we add the additional points learnt in making TS3.5 work in a CentOS 7 64 bit system :

Post on Topspin and 32 bit libraries


To the above list, I will add one more package that is needed.  This doesn't get pulled in as a dependency of any of the above mentioned packages, but one.

libXtst.i686

pulls in as dependency :

libXi.i686


systemd and Topspin 3.5 installation:

CentOS 7 employs 'systemd'  daemon to control all processes in the system that were individually handled by different binaries such as 'system' or 'chkconfig', etc.  Please refer to the CentOS 7 FAQ and documentation for a through review:

The shell command we use to communicate with systemd is 'systemctl'.

For instance, to query the status of Bruker License Manager daemon that is supposed to start at boot time, we have to say :

# systemctl status bruker_lmgr.service

The suffix 'service' can be omitted as long as there no possibility of another unit file with the same head such as 'bruker_lmgr'.

The above command gives the following :
 _______________________________________________________________________________________
 ● bruker_lmgr.service - BRUKER FlexLM license server
   Loaded: loaded (/etc/systemd/system/bruker_lmgr.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2017-10-16 13:06:00 PDT; 20min ago
 Main PID: 1202 (lmgrd)
   CGroup: /system.slice/bruker_lmgr.service
           ├─1202 /usr/local/flexlm/Bruker/lmgrd -local -2 -p -z -c /usr/local/flexlm/Bruker/licenses/license.dat
           └─1217 bruker_ls -T vgaruda 9.5 3 -c /usr/local/flexlm/Bruker/licenses/license.dat -p --lmgrd_start 59e51129

Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) EXPIRED: SMP_STRUCELU_RANK
Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) EXPIRED: MODGR_IFC
Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) Server started on vgaruda for:        TOPSPIN3
Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) TOPSPIN_1D        TOPSPIN_2D        XWINPLOT
Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) TOPSPIN_ACQU        NMRSIM                NMRGUIDE
Oct 16 13:06:01 vgaruda lmgrd[1202]: 13:06:01 (bruker_ls) TOPSPIN2
Oct 16 13:14:34 vgaruda lmgrd[1202]: 13:14:34 (bruker_ls) OUT: "TOPSPIN3" rajan@vgaruda
Oct 16 13:14:34 vgaruda lmgrd[1202]: 13:14:34 (bruker_ls) OUT: "TOPSPIN2" rajan@vgaruda
Oct 16 13:14:38 vgaruda lmgrd[1202]: 13:14:38 (bruker_ls) IN: "TOPSPIN3" rajan@vgaruda
Oct 16 13:14:38 vgaruda lmgrd[1202]: 13:14:38 (bruker_ls) IN: "TOPSPIN2" rajan@vgaruda
 _______________________________________________________________________________________

The output is more or less what you will see in the flexlm.log file under : /usr/local/flexlm/Bruker/licenses directory.

The above tells us that Bruker license manager has successfully read the license file and Topspin is ready to start.

Perl development libraries for instllation : 

In addition to the packages mentioned above, one crucial rpm we need is the following :

perl-Sys-Syslog.x86_64

Other than this, there are few other perl development components we need in the system for your installation to proceed smoothly. 

To begin with, do :  yum install perl-devel.i686

Since all the relevant Perl modules are going to come from CPAN, I found the following solution very elegant.  

yum install perl-App-cpanminus

This installs the CPAN module downloader and builder that can be used directly to pull any relevant Perl modules that are in CPAN repository.

Two of the relevant ones for us are installed like so :

cpanm Data::Dumper
cpanm Sys::Syslog

If you ran into install errors before, you do the above and then, just remove the /usr/local/flexlm directory completely, before running the Topspin3.5 install script from the medium, again.


For whatever reason, the install script did not create an empty license.dat file under /usr/local/flexlm/Bruker/licenses,  as it used to do with earlier versions.  At least with CentOS 7 distro, I couldn't see this happening. 

For that matter, it doesn't even create the /usr/local/flexlm/Bruker/licenses branch of the tree. I had to create it by hand. 

Topspin3.5 and native Network Interface Card names :

 It came as a great relief for me that Topspin 3.5PL6  install script now recognizes the native Network Interface Card naming scheme. We had to jump through several hoops in the past to somehow force name the first interface card as 'eth0' for the flexlm license daemon to work correctly.   But now, the install script automatically gives a pull down menu of the recognized interface card names and you can choose the appropriate one, whose MAC ID is the one that is found in the license.dat file.

NetworkManager and NIC naming :

When NetworkManager service is running in CentOS 7 (which is the default), it uses the logical naming scheme for the NICs found in the system, based on the bus location and other details.   In my system, for instance, these cards are called enp0s3 and enp0s8.

In the past, to make these NIC-s to be called 'ethX',  we had to disable NetworkManager and create configuration files by hand in /etc/sysconfig/network-scripts. Even then it is not guaranteed that it will work as expected.

From Topspin3.5 onwards, Bruker has provided two major updates to the installation process  :
  1. They natively provide the so-called systemd unit file for starting the bruker_lmgr
  2. They also provide a unit file that allows the natural NIC scheme by Network Manager to be recognized.  This way, when license manager runs, it can query the MAC ID of the correct interface card and satisfy itself against the license.dat file
The above makes life so much easier.

/etc/hosts file is still important ! :

We still need to tie the IPV4 address to the hostname that is being used in the license.dat file.  This is still a legacy behavior of flexlm license manager, which does not use DNS lookups or such to get the identity of the host, apparently.



Thursday, May 26, 2016

IMPORTANT UPDATE ON TOPSPIN 3.5PL5 (free version) - CentOS 7

I am referring below to the generously provided free version of the Topspin processing software by Bruker. For those of you who didn't notice (like me), the shell wrapper for this version includes a "al" in its name :  linux-topspin3.5.5.al.sh

I am mentioning because, there are other shell wrapper versions available for download, that turns out to be for installing a 'full license' scenario.  

Ok, on to the next step : 

I am sure you have taken care of installing all the required 32-bit libraries to make Topspin install script as well as the Topspin gui to function. 

You are rubbing your hands and raring to go....but....when you start Topspin (hopefully from the shell, as I do, so that I can immediately see any messages that are relevant) you see the banner appear and after a while it simply quits. 

This is what I got. 

 TopSpin 3.5 pl 5  -  Copyright (C) 2016 Bruker BioSpin GmbH
Installation directory: "/opt/topspin3.5pl5"
Waiting for FLEXlm license

Cannot checkout TopSpin FLEXlm license
Invalid license file syntax
Feature:       TOPSPIN3
License path:  /usr/local/flexlm/Bruker/licenses/license.dat
FLEXlm error:  -2,413
For further information, refer to the FLEXlm End User Manual,
available at "www.macrovision.com".

The FLEXlm host ID of this machine is 080027fd834a

license for noncommercial use, valid until 2017-03-31
error message cprserver: GetSystemPrinterList: dlopen(libcups.so) failed

premature Java Virtual Machine termination
Program is exiting ...


  Like me, it is possible that you ignore that error message from cprserver on this function call : GetSystemPrinterList: (libcups.so) failed.

What more, I was thrown off guard by the earlier snippet of " Cannot checkout TopSpin FLEXlm license
Invalid license file syntax" 


I was thinking that the former has to do with a printer definition and since I was running this on a virtual machine for testing, I didn't care about this particular library "libcups.so".  I couldn't have been more wrong. 

 When I installed the rpm that provides this library i.e. cups-devel, it pulled in literally a dozen more dependencies and some of them appear rather generic and important, such as libstdc++, zlib and dbus-libs. 

Once I installed these, Topspin launched without any problem and what more, the 'license file' related error turned out to be a dud. 

So, the lesson is that, don't ignore any error message thrown by Topspin when you launch and try to address it then and there. 

It is also clear that the way you build the linux distro, may not include some of the crucial components needed for this software to function correctly.  If there is no straightforward way to figure out these mandatory components, then at least pay attention to the error messages and discover the needed packages using those as hints.

UPDATE ON THIS UPDATE !

 I built another another instance of Topspin 3.5 on another virtual machine but even after this last step, Topspin started crashing.  Then I realized my folly...When I did a 'yum install'  I did not explicitly specify the i686 suffix and so it pulled all the cups-devel and dependencies of x86_64 bit version.  Once I did an explicit

yum install cups-devel.i686 

everything worked perfectly.  This might be helpful for you to remember....

Friday, July 18, 2014

Tidbits 2014

  • Topspin and Ubuntu 14.04 LTS

Recently I moved to Ubuntu 14.04 LTS and Topspin 3.2 did not start normally with this platform. Apparently the cprserver was dying and nothing came up after a couple of minutes.  I did install all the 32-bit compatible libraries to take care of all X related issues. But this problem is not remedied by those.

I did find a Bruker knowledge base entry that said that TS3.2 is not playing well with Kernel 3.13.xx yet and understandably Bruker cannot help but wait for the next kernel release. 

Apparently by May '14 Kernel 3.14 has been released, not by the official ubuntu distribution, but from a third party and Bruker encouraged me to update the Kernel and assured that Topspin 3.2 will work well after that.

I am happy to note that, after I updated to Kernel 3.14.3-031403-generic, as I write this, Topspin 3.2 works beautifully, without any issues so far.

Phew !

Wednesday, August 7, 2013

Topspin and 32 bit libraries in a 64 bit system : Summary

I had mentioned earlier that I will summarize the needed 32 bit libraries for Topspin to play well in a 64 bit platform.  This post is an attempt in that direction.  I am referring to either RedHat Enterprise Linux or its "$free$" re-incarnation that is CentOS.  For this reason, I am referring to rpms in this post.

 But I suspect that this approach should in general be applicable to other popular Linux platforms such as Ubuntu or Mint. You have to pull in the equivalent packages with tools such as apt-get. 

Needed RPMs for TS install to work correctly : 

 glibc.i686        
glibc-devel.i686
libX11.i686 (this gets pulled in as a dependency if you install libX11-devel)
libX11-devel.i686


RPMs needed for proper Topspin functionality such as 'edlock' table display.

 libXext-devel.i686
 libXtst.i686 (gets pulled in as a dependency for the former)

RPMs for gui functionality such as pulse program display and 'nmrsim'

  libXmu.i686
 libXt.i686   

As a data station, the above libraries have resulted in the expected Topspin behavior, thus far. I will update the post if I stumble upon any other problems and the possible solutions reached.

I will also mention the passing, the following tip.  Although there are error log files under the $TOPSPINHOME/prog/curdir/$USER directory,  errors related to the missing libraries above are not recorded in any of them. The Topspin 'hist' command is very handy and it gives the most elaborate capture of events as they occur.  For instance, the failure of 'nmrsim' is recorded in the history along with the missing library names :  libXmu.so.6 and libXt.so.6 

Happy spinning !    

UPDATE - 26 May 2016

Today I am trying to build Topspin 3.5 on a CentOS7 Virtual Machine running on my Fc23 box. I had to follow all the above, of course, but it still fell short of one rpm, which is : 
libXft.i686  
This provides the library module libXft.so.2 for the install to work correctly.

Please note that, this also installs the following dependencies automatically :
-------------------
 expat.i686 0:2.1.0-8.el7          fontconfig.i686 0:2.10.95-7.el7          freetype.i686 0:2.4.11-11.el7          libXrender.i686 0:0.9.8-2.1.el7
-----------------------

UPDATE : 

Installing libXmu.i686 automatically pulls the following as dependencies:

libXt
libXext 

among other packages. Since the above two are essential for normal operation of nmrsim, I am highlighting only these.

Monday, January 28, 2013

TidBits 2013

  • When we install Topspin, where does it store the default path information, to start the topspin script ?
Topspin stores this information in two files : 
/etc/profile.d/topspin.sh  
/etc/profile.d/topspin.csh

As can be inferred the former is used for a BASH shell and the latter for a c-shell or its derivatives.  The PATH invocation's syntax is different for the two types of shells and this is the reason for the existence of these two separate files.  

As an example, in my system, inside the topspin.sh file this is what I find : 

 PATH=/opt/topspin3/prog/bin/scripts:$PATH # created by TopSpin Installer

The above defines the global path for Topspin installation.
If you are installing Topspin in two different locations in parallel, for instance, both Topspin 2.1 and Topspin 3.0,  then only one of them will be sourced, when you enter the script name topspin on the shell command line. Which version of Topspin will be started will be decided by the global path defined in the file above.  Normally, you are not expected to kludge this file by hand, as is implied by the comment "created by Topspin Installer".   Having said that, if you change the path here by hand, it does work.