Install rar/unrar on CentOS 7

It is very easy. The solution is on nixCraft, but on the comments.

## 64 bit linux ##
wget https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
tar -zxvf rarlinux-x64-5.5.0.tar.gz
cd rar
sudo cp -v rar unrar /usr/local/bin/

There’s no need to compile or anything. The binary on the tar file works out of the box. On the above example, we copy it on /usr/local/bin so it is found by default after login on our system. Other “exotic” solutions are possible, but I don’t want to make suggestions.

I did write during the holidays. I didn’t publish. I have like 4 drafts about. A lot of polishing needs to be done, but expect some dragons coming on the next days 🙂

Advertisements
Posted in bits, centos, linux, software | Leave a comment

A relion 2.1.stable module for CentOS 7

There is a new relion to add to the collection. You can find the installation details here. I will tell you my experience doing as suggested. First thing that it calls my attention on the github instructions is that they ‘apt-get’ the packages. Which confirms what I know already: that they are moving onto the ‘market‘ (can I use this word when we speak about science?) of commercial ubuntu systems, not professional distributions. I could write a post discussing why it’s a good move (and another one about why it isn’t) but let’s center. My preliminaries were to install openmpi-3.0.0 as a module. We work with modules, therefore the full installation procedure looks like:

module load cuda-8.0
module load mpi-3.0.0
git clone https://github.com/3dem/relion.git relion-src
cd relion-src
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/relion-2.1.stable/ ..
make -j20
make install

We have a relion-src source folder, and a relion-2.1.stable folder for the binaries. I didn’t get any error on the making or installing in my node. The last line of make install is looking like this:

 -- Installing: 
/path/to/relion-2.1.stable/bin/relion_tiltpair_plot
-- Set runtime path of 
"/path/to/relion-2.1.stable/bin/relion_tiltpair_plot" 
to "/path/to/relion-2.1.stable/lib:
/usr/local/cuda-8.0/lib64:/path/to/openmpi-3.0.0/lib"

Of course the paths are a made-up. My module looks like:

#%Module1.0#####################################
## module relion-2.1.stable
## modulefiles/relion-2.1.stable Relion 2.1.stable
##
proc ModulesHelp { } {
 global version modroot
 puts stderr "relion-2.1.stable "
}

module-whatis "Sets the environment for using relion 2.1.stable"

# for Tcl script use only
set topdir /path/to/relion-2.1.stable
set version 2.1.stable
set sys linux86

setenv RELION_V "2.1.stable"
prepend-path PATH $topdir/bin
prepend-path MANPATH $topdir/man
prepend-path LD_LIBRARY_PATH $topdir/lib

module load mpi-3.0.0
module load cuda-8.0

Now I log in as an user to try my module. When I type ‘relion’ unfortunately I get this error:

/path/to/relion-2.1.stable/bin/relion: 
/usr/lib64/libstdc++.so.6: 
version `GLIBCXX_3.4.20' not found 
(required by /path/to/relion-src/build/lib/librelion_gui_lib.so)

/path/to/relion-2.1.stable/bin/relion: 
/usr/lib64/libstdc++.so.6: 
version `GLIBCXX_3.4.20' not found 
(required by /path/to/relion-src/build/lib/librelion_lib.so)

How about running it directly?

/path/to/relion-2.1.stable/bin/relion

The same error! It is described here. When we do

strings /usr/lib/libstdc++.so.6 | grep GLIBC

indeed it looks like GLIBCXX_3.4.20 is not present by default on our CentOS 7. What can we don then? I don’t want to install a new compiler everywhere, so I look for the library on another system.

find /path/to/my/programs  -iname libstdc\*

The output tells me that there is a libstdc++.so.6.0.21 that comes with a precompiled version of another program. The one we have (on /lib64, but it can be on /usr/lib, /usr/lib64 or similar locations) is called libstdc++.so.6.0.19. Since we don’t want to alter the system, what we do is we copy the libstdc libraries onto /relion-2.1.stable/lib/ and try again. Like this.

cp libstdc++.so* /path/to/relion-2.1.stable/lib/

Now we log in as an user, load the module and… it works. And we can copy the folder around to use it, being sure it has the right standard C library. But I’ve been lucky, so to say. We’ll see next time!

Posted in bits, centos, EM, GPU, hardware, linux, python | Leave a comment

Install openmpi-3.0.0 with UCX and infiniband support on CentOS 7

So I found out (yes I’m not on all mailing lists) there’s a new openmpi. This will be the third time I do this, and I guess it will not be the last. You check how to install openmpi-2.1.0 on Centos 7 or see my first post how to install openmpi from scratch . Anyway, here we go. I download the tarball from here. I untar it, and run the configure directly on the folder I get after the untar, having special care of linking it with my most recent CUDA.

## > tar -xvzf openmpi-3.0.0.tar.gz
## > ./configure --prefix=/path/to/openmpi-3.0.0 
--with-cuda=/path/to/cuda-8.0/

The output of running the configuration looks right. Here you have it:

Open MPI configuration:
-----------------------
Version: 3.0.0
Build MPI C bindings: yes
Build MPI C++ bindings (deprecated): no
Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08
MPI Build Java bindings (experimental): no
Build Open SHMEM support: yes
Debug build: no
Platform file: (none)

Miscellaneous
-----------------------
CUDA support: yes

Transports
-----------------------
Cray uGNI (Gemini/Aries): no
Intel Omnipath (PSM2): no
Intel SCIF: no
Intel TrueScale (PSM): no
Mellanox MXM: no
Open UCX: yes
OpenFabrics Libfabric: no
OpenFabrics Verbs: yes
Portals4: no
Shared memory/copy in+copy out: yes
Shared memory/Linux CMA: yes
Shared memory/Linux KNEM: no
Shared memory/XPMEM: no
TCP: yes

Resource Managers
-----------------------
Cray Alps: no
Grid Engine: no
LSF: no
Moab: no
Slurm: yes
ssh/rsh: yes
Torque: no

The configure was able to detect that I’m compiling it on a node of my slurm cluster.  Next step is to make it.

## > make all install

On the node, I get numa error. It looks like this:

/usr/bin/ld: cannot find -lnuma
collect2: error: ld returned 1 exit status
make[2]: *** [mca_pml_ucx.la] Error 1

We will want numa, the numerical libraries for memory management (also known as memory affinity). The fix is in principle obvious. We install the numa headers.

## > yum install numactl-devel

But still it’s not giving a clean install. The next error I encounter is looking like this:

/usr/bin/ld: cannot find -lbfd
/usr/bin/ld: cannot find -liberty
collect2: error: ld returned 1 exit status

The solution is, as before, install more “missing” packages. In my case, I overcome it with binutils and binutils-devel:

 ## > yum install binutils binutils-devel

Of course this is not the end of the story. Otherwise there is no post. The next error reads:

make[2]: *** [sshmem_ucx_module.lo] Error 1
make[2]: Leaving directory `/openmpi-3.0.0/oshmem/mca/sshmem/ucx'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/openmpi-3.0.0/oshmem'
make: *** [all-recursive] Error 1

Now it complains about ucx, the Unified Communication X.  This is due to the mellanox infiniband fabric we have in the node. You may not experience any issue at all if you compile it on a node connected with a “traditional”  1 GB network. On this github openmpi 3.0 thread they give you some directions about how to fix this error. So we download the openucx tarball, and compile it as it is written here, without issues.

% ./autogen.sh
% ./contrib/configure-release --prefix=$PWD/install
% make -j8 install

Our new configure run looks like this:

 ## > ./configure --prefix=/path/to/openmpi-3.0.0 
--with-cuda=/path/to/cuda-8.0/ 
--with-ucx=/path/to/openucx-ucx-1338d7f

Unfortunately, it seems that the ucx tarball is not what we want, and the configure gives us this error:

--- MCA component pml:ucx (m4 configuration macro)
checking for MCA component pml:ucx compile mode... dso
checking --with-ucx value... not found
configure: WARNING: Expected file 
/path/to/openucx-ucx-1338d7f/include/ucp/api/ucp.h not found
configure: error: Cannot continue

So I try with the git version.  That is:

git clone https://github.com/openucx/ucx.git ucx-git
cd ucx-git
mkdir build
cd build
 ../configure --prefix=/path/to/ucx-bin/
make
make install

After this, I correct the configuration path and run it again. The output reads:

Open MPI configuration:

-----------------------
Version: 3.0.0
Build MPI C bindings: yes
Build MPI C++ bindings (deprecated): no
Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08
MPI Build Java bindings (experimental): no
Build Open SHMEM support: yes
Debug build: no
Platform file: (none)

Miscellaneous
-----------------------
CUDA support: yes

Transports
----------------------
Cray uGNI (Gemini/Aries): no
Intel Omnipath (PSM2): no
Intel SCIF: no
Intel TrueScale (PSM): no
Mellanox MXM: no
Open UCX: yes
OpenFabrics Libfabric: no
OpenFabrics Verbs: yes
Portals4: no
Shared memory/copy in+copy out: yes
Shared memory/Linux CMA: yes
Shared memory/Linux KNEM: no
Shared memory/XPMEM: no
TCP: yes

Resource Managers
-----------------------
Cray Alps: no
Grid Engine: no
LSF: no
Moab: no
Slurm: yes
ssh/rsh: yes
Torque: no

installation now goes fine.  The end of it is looking like this:

----------------------------------------------------------
Libraries have been installed in:
 /path/to/openmpi-3.0.0/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.
---------------------------------------------------------
make[3]: Nothing to be done for `install-data-am'.
...
make[1]: Leaving directory `/path/to/openmpi-3.0.0'

Time to write a module to use it. My module looks like:

#%Module1.0###########################################
## modules openmpi-3.0.0
##############################

proc ModulesHelp { } {
        global version modroot
        puts stderr "mpi-3.0.0 - sets mpi 3.0.0 " }

module-whatis "Set mpi 3.0.0 "

# for Tcl script use only
set     topdir          /path/to/openmpi-3.0.0
set     version         3.0.0
set     sys             linux86

conflict        mpi
prepend-path    PATH            $topdir/bin
prepend-path    MANPATH         $topdir/man
prepend-path    LD_LIBRARY_PATH $topdir/lib
setenv          MPIHOME         $topdir
setenv          MPIBIN          $topdir/bin
setenv          OPAL_PREFIX     $topdir

setenv MPI_V "3.0.0"

Note that you could define on the module MPI_BIN and similar variables if you need them. I don’t do it because most of the “clients” of openmpi do it for me. So no need to mess it up beforehand 😛

A question is still open. We compiled it with infiniband support. Will this openmpi run on our 1GB terminals? Stay tuned to find it out!

Posted in bits, hardware, linux, slurm, software, yum | 1 Comment

Ho ho ho

I wake up and I look to my desk in the darkness. There’s definitely something moving over there. My cat? It can’t be my cat, I don’t have one as far as I remember. A rat? One of the outside squirrels that somehow managed to enter? A bat? Slowly, very slowly so that it doesn’t run away, whatever it is, I move my hand to the light switch and switch it on, while I jump out of bed.

– What? – a manly deep voice shouts at me. His tone is of annoyance, not of surprise. – Oh, it’s you. Sorry I woke you up. – I look to my desk. Over it, a Santa Claus the size of an average garden gnome is trying to drink the remnants of my whiskey out of the big  crystal glass that I served myself yesterday. I left the half when I achieved at around midnight the desired effect, that is, to forget about my shitty job. Wait. Am I still dreaming? – No you’re not. – Santa says. Are you sure? – The small Santa looks me in the eyes to say: – Yes I am. And before you ask about it, yes I do read your mind. I got the power so I can quickly find out if you’re lying or not – He seems to laugh to himself about an internal joke – not that it’s a reliable power, but it’s a good one most of the time.

– So what are you doing in my humble property? – Small Santa empties my glass and looks with lovely eyes to the bottle I left a little bit beyond his reach. Yes, you can take it if you need it, I think, not intentionally proving his powers but deep in my heart. He leaves the glass and start to move slowly in the direction on the bottle. First things first, I say to myself. Even if he’s not real, the sense of hospitality must be kept.

-Well, you know, I have these reindeers, Donner, Blitzen, Vixen, Cupid and so on. You remember them, right? – I try to remember the names but I can’t manage. Probably it’s not important. – Not for you, but it is for me! So you know, there are some open issues between Cupid and Dasher. This is not of public domain, but before they entered under my command there was that beautiful reindeer that they both wanted to cover…- At this point Small Santa managed to pour himself another generous whiskey. – You know how these things are. I’m sure you know, don’t lie to me. Humans are not so different to reindeers, some of them can really get crazy around a carrot. Yes, yes, lame joke. The thing is, as for your car, I do tests rides before the big day. Yeah… this is not our real size, it’s that we can compress or expand my body – suddenly he becomes blurry, like defocused, then he focuses again – depending on the needs. How the hell do you expect me then to go through the chimney? – It makes totally sense. There’s the problem of making the presents less dense or smaller, but I think you could explain that one with magic. – But let’s focus. The thing is, I was on my test ride, invisible and so on, when we cross that reindeer…. and guess what? Cupid and Dasher decide to start over the old fight in the middle of the ride! Since I respect and do not interfere on the sexual life of all the creatures, I’m forced to hop off.  Do you know how long is lasting the sexual intercourse of reindeers? – I show my ignorance about the subject on my face the best way I can. – What do you do when two of your friends decide to go for a girl, and you’re in the middle? Exactly! And I was lucky, you were really close and friendly! – I guess I could define myself in that way. Friendly. So Santa does know me. Interesting. At this moment, I decide to accept the situation and go for a second glass. Do we have ice? -Yes thanks, I want also if you can bring me…- I go to the fridge, take four cubes, come back to my desk and add two cubes to small Santa’s glass. Then I take the bottle an add two fingers to my glass.

-Cheers.- Small Santa scratches his butt, and with a geometrical effort takes the glass (that is half his size) to cling it with mine. We smile. A sudden feeling of happiness invades me. A sudden and meaningless, reasonless feeling.

-Cheers! You rock, man! -I got the joke. A very bad one also. But we laugh together, as old friends do. – Do you have some snacks by any chance? I’m starving!

Posted in dragons, fantasy, new dreams, unpublished | Leave a comment

I don’t like it

I know that it’s a lame excuse, but I got a new laptop, and when I type the keyboard does this “tip tap tip tap tap ” that may remembers you to a typewriter but it’s not a typewriter. I wonder if it’s an intended effect, artificially created to satisfy the growing tribe of hipsters across the world, or a mechanical side effect. One thing is true: I’m able to write just fine on my old laptop, but not on my new one. Is it a matter of discipline, or only of feeling? Let’s say you land right now somewhere in the middle of the MOON and the only thing you have to write about your experience is an old typewriter. I feel like that, like the man on the moon. But I have a choice: I can write on my old laptop, only that it’s at my working place, so I tend to write about work.

Yes I’m not the writer I could be.

Posted in dragons, new dreams | Leave a comment

Windows XP ignoring the hosts file

A little bit of context is needed. We have a subnet with 3 computers that need to connect to each other. It’s a Windows XP, a Windows 7 and a Centos 6. We can’t get rid of the OS, since they are controlling devices. We need to be able to ping by name, and unfortunately, we can’t hook them up with a DNS server.

We are doing this to be able to run leginon on the subnet. The installation guide is telling us how to add the hosts so that each member is able to see each other. Unfortunately, on the Windows XP, no matter what we write on the host file, we can’t ping the others by name. If you google the problem, a lot of nice information is coming back. We tried what is explained on this thread on serverfault without success. First we check the that the Registry Key is pointing to the right entry. We open regedit, and look for:

The key that is on

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Services\Tcpip\Parameters\DataBasePath

is indeed:

%SystemRoot%\System32\drivers\etc

So I assume is not the key. To rule out permission problems, we cut the host file out and paste it on the desktop, we create a new one and fill it up, without luck. Also the right click path (Properties->Security) is looking OK. All the users are having all the relevant permissions. We then change the proxy settings by going to Internet Explorer -> Internet Options -> Connections -> LAN settings. Also it look like is suggested. Just in case, we check the network configuration, but still no ping. We can’t flush the DNS cache (on a cmd window, ifconfig /flusdns), since we don’t have a DNS on the subnet. What is it?

I found the answer here. I go to Start–>Control Panel–>Administrative Tools–>Component Services–>Services(Local).

It looks like this, depending on your XP tuning:servicesdialog

I search for the service called DNS Cache (not in the picture) and disable by clicking on it. Then I come back to my host file, test the ping by name and voila! It works! Finally I can ping from the Windows XP. Why the DNS cache was configured like that, I will never know. Why I didn’t think about it in the first place, I can explain, if asked. Anyway, thanks google, for being there when I need you 😀

Posted in bits, EM, hardware, leginon, windows | Leave a comment

A cisTEM module on CentOS 7

cistem

cisTEM is user-friendly software to process cryo-EM images of macromolecular complexes and obtain high-resolution 3D reconstructions from them. And you will find it here. I will not discuss about why you want to have it on your system instead of any other tool. The installation is very easy, if you choose the precompiled version as recommended on the documentation. Just unzip and run. I like it!

So my module looks like:

#%Module1.0#############################################
## modules cisTEM
##
## modulefiles/cisTEM module
##
proc ModulesHelp { } {
        global version modroot
        puts stderr "cisTEM  - sets the Environment
for using  cisTEM "
}

module-whatis   "Sets the environment for using cisTEM "

# for Tcl script use only
set     topdir           /usr/local/cistem-1.0.0-beta/
set     version         1.0
set     sys                linux86

setenv CISTEM_V "1"

prepend-path    PATH            $topdir
prepend-path    LD_LIBRARY_PATH   /usr/lib:/usr/lib64/:

I save it and test it as a user: module load blablabla, a window pops up, so everything looks fine to send it to the test users. This time to make a difference I had quite a quick feedback. There are programs doing the same image refinements over GPUS. Well, it looks like with this code, that rely on CPUs again, the refinements are done in a shorter time: in around 30% less time. That is impressive, and if you ask me, it has not an easy explanation without a careful benchmark. How many CPUs per GPU core you need to emulate the processing time? We’ll never know…or will we?

About usage, we fought a little to apply the suggested cluster settings and we end up launching 80 jobs if the processing requires 80 threads, but it’s nothing that cannot be sorted out or ignore if the software delivers what it’s promising. And it looks like it is. Now I wonder, what shall we do with the other GPUs that we have on different machines? But that’s science, I guess. The winner is that one who has it all, brain, resources and mood.

Posted in bits, centos, GPU, linux, nvidia, slurm, software | Leave a comment