Compiling GNU Parallel on CentOS-7

GNU parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU parallel can then split the input and pipe it into commands in parallel.

To Download, the got to the website https://mirror.freedif.org/GNU/parallel/

% tar -xvf parallel-latest.tar.bz2 
% ./configure --prefix=/usr/local/gnu/parallel 
% make 
% make install

There are some Youtube Resources on GNU Parallel which could be useful if you wish to learn how to use GNU Parallel

References:

  1. GNU Parallel

Compiling g2o with Eigen-3.3.9 with GNU-6.5

g2o is an open-source C++ framework for optimizing graph-based nonlinear error functions. g2o has been designed to be easily extensible to a wide range of problems and a new problem typically can be specified in a few lines of code. The current implementation provides solutions to several variants of SLAM and BA.

A wide range of problems in robotics as well as in computer-vision involve the minimization of a non-linear error function that can be represented as a graph. Typical instances are simultaneous localization and mapping (SLAM) or bundle adjustment (BA). The overall goal in these problems is to find the configuration of parameters or state variables that maximally explain a set of measurements affected by Gaussian noise. g2o is an open-source C++ framework for such nonlinear least squares problems. g2o has been designed to be easily extensible to a wide range of problems and a new problem typically can be specified in a few lines of code. The current implementation provides solutions to several variants of SLAM and BA.

https://github.com/RainerKuemmerle/g2o

What I used:

  • gnu-6.5
  • m4-1.4.18
  • gmp-6.1.0
  • mpfr-3.1.4
  • mpc-1.0.3
  • isl-0.18
  • gsl-2.1
  • cmake-3.21.3
% git clone https://github.com/RainerKuemmerle/g2o
% cd g2o
% mkdir build
% cd build

Sometimes, cmake does not capture your export value. The best is to force the c and cxx compilers directly by stating their path.

% cmake .. -DEIGEN3_INCLUDE_DIR=/usr/local/eigen-3.3.9/build/include/eigen3 -DCMAKE_INSTALL_PREFIX=/usr/local/g2o/ -DCHOLMOD_INCLUDE_DIR=/usr/lib64/ -DCMAKE_C_COMPILER=/usr/local/gcc-6.5.0/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-6.5.0/bin/g++
% make -j 4
% make all

References:

Gromacs-2020.6 and Plumed-2.7.2 with Intel-2019

Install Plumed-2.7.2

Plumed-2.7.2 can be installed in a similar fashion as Compiling plumed-2.6.4 with Intel 2019

Download and unpack Gromacs-2020.6

% wget https://ftp.gromacs.org/gromacs/gromacs-2020.6.tar.gz
% tar -zxvf gromacs-2020.6.tar.gz
% cd gromacs-2020.6

Plumed Gromacs-2020.6

% plumed patch -p
PLUMED patching tool

1) gromacs-2019.6   4) gromacs-4.5.7    7) namd-2.14
2) gromacs-2020.6   5) namd-2.12        8) qespresso-5.0.2
3) gromacs-2021     6) namd-2.13        9) qespresso-6.2
Choose the best matching code/version:2

Compile Gromacs as according to Compiling Gromacs-2019.3 with Intel 2018 MKL and AVX-512

References:

  1. Compiling plumed-2.6.4 with Intel 2019
  2. Compiling Gromacs-2019.3 with Intel 2018 MKL and AVX-512
  3. Install Gromacs-2016.3 and Plumed-2.3.3

Compiling ANTs with GNU-6.5

What is Advanced Normalization Tools?

ANTS is a tool for computational neuroanatomy based on medical images. ANTS reads any image type that can be read by ITK (www.itk.org), that is, jpg, tiff, hdr, nii, nii.gz, mha/d and more image types as well. For the most part, ANTS will output float images which you can convert to other types with the ANTS
ConvertImagePixelType tool. ImageMath has a bunch of basic utilities such as multiplication, inversion and many more advanced tools such as computation of the Lipschitz norm of a deformation field. ANTS
programs may be called from the command line on almost any platform.

ANTs project site can be found at GitHub – ANTsX/ANTs: Advanced Normalization Tools (ANTs). Compilation Information can found at Compiling ANTs on Linux and Mac OS · ANTsX/ANTs Wiki · GitHub

Prerequisites

  • gnu-6.5
  • m4-1.4.18
  • gmp-6.1.0
  • mpfr-3.1.4
  • mpc-1.0.3
  • isl-0.18
  • gsl-2.1
  • cmake-3.21.3

ANTs can be not too difficult if you use their installation script found here

% mkdir /usr/local/ANTs
% cd /usr/local/ANTs
% git clone https://github.com/cookpa/antsInstallExample.git
% ./installANTs.sh

Once done, you should see in the ANTs directory

ANTs  build  install  installANTs.sh

Inside ANTs, you can see the install directory where the bin and lib lies

The C++ compiler does not support C++11 during bootstrap for cmake

What is CMAKE?

CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. 

You can download the latest cmake from https://cmake.org/download/

Prerequisites that I use

  • gnu-6.5
  • m4-1.4.18
  • gmp-6.1.0
  • mpfr-3.1.4
  • mpc-1.0.3
  • isl-0.18
  • gsl-2.1

Step 1: You can use the bootstrap which will default the cmake to default location ie /usr/local/. If you are using bootstrap,

# tar -zxvf cmake-3.21.3.tar.gz
# cd cmake-3.21.3 
# ./bootstrap 
# make 
# make install

Errors encountered

CMake 3.21.3, Copyright 2000-2021 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++  -std=gnu++1y
Makefile processor on this system is: gmake
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
gmake: Warning: File `Makefile' has modification time 0.15 s in the future
gmake: `cmake' is up to date.
gmake: warning:  Clock skew detected.  Your build may be incomplete.
loading initial cache file /myhome/melvin/Downloads/cmake-3.21.3/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at CMakeLists.txt:107 (message):
  The C++ compiler does not support C++11 (e.g.  std::unique_ptr).


-- Configuring incomplete, errors occurred!
See also "/myhome/melvin/Downloads/cmake-3.21.3/CMakeFiles/CMakeOutput.log".
See also "/myhome/melvin/Downloads/cmake-3.21.3/CMakeFiles/CMakeError.log".

Resolutions:

Step 1: You may want to export this before compiling

export CXXFLAGS="-O3"

Step 2: You might want to move to an unmounted directory like /root and try compiling again with root access.

Alternatively, instead of using ./boostrap, you can use the traditional configure command

#./configure --prefix=/usr/local/cmake-3.21.3
# make
# make install

References:

  1. The C++ compiler does not support C++11 (e.g. std::unique_ptr). building OpenWRT
  2. c++11 std::unique_ptr error cmake 3.11.3 bootstrap

Error: Too many elements extracted from the MEAM Library on LAMMPS

If you encounter an errors similar

ERROR: Too many elements extracted from MEAM library (current limit:5 ). Increase 'maxelt' in meam.h and recompile. 
Last command: pair_coeff     * * library.alloy2.meam .............................

Move to /usr/local/lammps-29Oct20/src/USER-MEAMC/meam.h and /usr/local/lammps-29Oct20/src/meam.h. Edit line 22. The default value is #define maxelt 5

#definte maxelt 6

Recompile the lammps. Go to /usr/local/lammps-29Oct20/src

% make clean-all
% make g++_openmpi -j 16

References

  1. Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

No MEAM parameter file in pair coefficients Errors in LAMMPS

If you are encountering errors like, you may want to check

ERROR: No MEAM parameter file in pair coefficients (../pair_meamc.cpp:243)

When a pair_coeff command using a potential file is specified, LAMMPS looks for the potential file in 2 places. First it looks in the location specified. E.g. if the file is specified as “niu3.eam”, it is looked for in the current working directory. If it is specified as “../potentials/niu3.eam”, then it is looked for in the potentials directory, assuming it is a sister directory of the current working directory. If the file is not found, it is then looked for in one of the directories specified by the LAMMPS_POTENTIALS environment variable. Thus if this is set to the potentials directory in the LAMMPS distribution, then you can use those files from anywhere on your system, without copying them into your working directory. Environment variables are set in different ways for different shells. Here are example settings for

 export LAMMPS_POTENTIALS=/path/to/lammps/potentials

For more information, do read LAMMPS Documentation https://docs.lammps.org/stable/pair_coeff.html

KIM_SimulatorHeaders.h: No such file or directory during compilation of lammps

If you encounter an error such as the one below during compilation for lammps such as written in Compiling LAMMPS-15Jun20 with GNU 6 and OpenMPI 3

After running the command,

% make g++_openmpi -j 16

you may encounter

In file included from ../style_pair.h:112:0,
                 from ../force.cpp:20:
../pair_kim.h:70:34: fatal error: KIM_SimulatorHeaders.h: No such file or directory
 #include "KIM_SimulatorHeaders.h"

This is due to one of the a header file not found at /usr/local/lammps-29Oct20/src/pair_kim.h. At line 70, modify the actual location of KIM_SimulatorHeaders.h

/* #include "KIM_SimulatorHeaders.h" */
#include "/usr/local/lammps-29Oct20/lib/kim/kim-api-2.1.3/build/installed-kim-api-2.1.3/include/kim-api/KIM_SimulatorHeaders.h"

Again, after running the command,

% make g++_openmpi -j 16

you may encounter

mpicxx -g -O3  -DLAMMPS_GZIP -I../../lib/colvars -DLMP_USER_OMP -I../../lib/voronoi/includelink -DLMP_PYTHON -I../../lib/poems -DLMP_MPIIO -I../../lib/message/cslib/src -I../../lib/latte/includelink -DLMP_KOKKOS  -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1     -I/usr/include/python2.7 -I/usr/include/python2.7   -I./ -I../../lib/kokkos/core/src -I../../lib/kokkos/containers/src -I../../lib/kokkos/algorithms/src --std=c++11 -fopenmp -I./ -I../../lib/kokkos/core/src -I../../lib/kokkos/containers/src -I../../lib/kokkos/algorithms/src   -DLMP_KIM_CURL   -c ../kim_param.cpp
../kim_param.cpp:73:34: fatal error: KIM_SimulatorHeaders.h: No such file or directory
 #include "KIM_SimulatorHeaders.h"

This is due to one of the a header file not found at /usr/local/lammps-29Oct20/src/kim_param.cpp. At line 73, modify the actual location of KIM_SimulatorHeaders.h

/* #include "KIM_SimulatorHeaders.h" */
#include "/usr/local/lammps-29Oct20/lib/kim/kim-api-2.1.3/build/installed-kim-api-2.1.3/include/kim-api/KIM_SimulatorHeaders.h"

There might be the same issue for kim_init.cpp, fix_store_kim.cpp, pair.kim.h etc

Issues when launching ABAQUS/CAE

I was using FastX3, loaded the ABAQUS 2020 cae,

% module load abaqus/2020
% abaqus cae
 Error: code 2 major 153 minor 3: BadValue (integer parameter out of range for operation).
X Error: code 167 major 153 minor 5: GLXBadContext.
X Error: code 167 major 153 minor 26: GLXBadContext.
X Error: code 167 major 153 minor 4: GLXBadContext.
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
failed to create drawable
.....
.....
.....



Warning: There was a problem creating an OpenGL feedback context for printing.
If you encounter any problems with printing, verify that indirect GLX context
creation is enabled on your X server. For more information on indirect / direct
GLX context and how to enable indirect GLX context creation, see Knowledge Base
article QA00000043316

The issue is that on some graphics devices Abaqus/CAE and Abaqus/Viewer may fail when hardware acceleration is turned on. To mitigate the issue, you can turned off hardware acceleration which may have some performance degradation for the graphics performance. This can be done by simply

% abaqus cae --mesa

ABAQUS maintained a list of Graphics Devices which has passed the test and you may want to take a look

ABAQUS 2020 Graphics Devices

Setting up FreeSurfer 7.2.0 for CentOS-7

FreeSurfer is an open source software suite for processing and analyzing (human) brain MRI images.

  • Skullstripping
  • Image Registration
  • Subcortical Segmentation
  • Cortical Surface Reconstruction
  • Cortical Segmentation
  • Cortical Thickness Estimation
  • Longitudinal Processing
  • fMRI Analysis
  • Tractography
  • FreeView Visualization GUI
  • and much more..

The freesurfer downloads can be found here

The Tar GZ for Linux Install can be found here

% tar -zxvpf freesurfer-linux-centos7_x86_64-7.0.0.tar.gz
% cd freesurfer

Prepare the Environment in your .bashrc

export FREESURFER_HOME=/usr/local/freesurfer
export FSFAST_HOME=$FREESURFER_HOME/fsfast
export FSF_OUTPUT_FORMAT=nii.gz
export FMRI_ANALYSIS_DIR=$FREESURFER_HOME/fsfast
export FUNCTIONALS_DIR=$FREESURFER_HOME/sessions
export FS_OVERRIDE=0
export MNI_DIR=$FREESURFER_HOME/mni
export MINC_BIN_DIR=$FREESURFER_HOME/mni/bin
export MINC_LIB_DIR=$FREESURFER_HOME/mni/lib
export MNI_DATAPATH=$FREESURFER_HOME/mni/data
export PERL5LIB=$FREESURFER_HOME/mni/share/perl5
export MNI_PERL5LIB=$FREESURFER_HOME/mni/share/perl5