Paraview and OpenGL

After you enter the command “paraview” and If you are encountering errors like “Your OpenGL drivers don’t support required OpenGL, features for basic rendering. Applications cannot continue. Please exit and use an older version. CONTINUE AT YOUR OWN RISK! OpenGL Vendor: Information Unavailable, OpenGL Version: Information Unavailable OpenGL Renderer: Information Unavailable.

The output messages shows

  • “Unable to find a valid OpenGL 3.2 or later…
  • failed to create offscreen window
  • GLEW could not be initialized

To resolve the issue, do run the command, to bypass hardware acceleration

% paraview --mesa

References:

Compiling USER-GFMD to LAMMPS-10Mar21 with OpenMPI and GNU

Prerequisites

  • openmpi-3.1.4
  • 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
  • python-3.6.9
  • fftw-3.3.8

Download the lammps.10Mar2021.tar.gz from https://download.lammps.org/tars/

Step 1: Untar LAMMPS

% tar -zxvf lammps-10Mar2021.tar.gz

Step 2: Go to $LAMMPS_HOME/src. Make Packages. I will only need kspace and USER-GFMD.

% make yes-kspace
% make pi
% make ps

Step 3: Preparing Green’s function molecular dynamics (GFMD) code on LAMMPS. For more information on the website, https://github.com/Atomistica/user-gfmd

% cd $LAMMPS_HOME
% git clone https://github.com/Atomistica/user-gfmd.git

You should see a directory called user-gfmd in your $LAMMPS_HOME. Rename it to uppercase

% mv user-gfmd USER-GFMD

Copy the USER-GDMD to the $LAMMPS_HOME/src and
Make the package

% cp USER-GFMD to src
% make yes-user-gfmd

Step 4: Edit the Makefile.g++_openmpi

% vim $LAMMPS_HOME/src/MAKE/OPTIONS/Makefile.g++_openmpi
FFT_INC =       -DFFT_FFTW3 -I/usr/local/fftw-3.3.8-gcc6/include
FFT_PATH =      -L/usr/local/fftw-3.3.8-gcc6/lib
FFT_LIB =        -lfftw3

The -DFFT_FFTW3 was important or I will get error like

mpicxx -std=c++11 -g -O3 -DLAMMPS_GZIP -DGFMD_FFTW3 -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -I/usr/local/fftw-3.3.8-gcc6/include -c ../nonperiodic_stiffness.cpp
../nonperiodic_stiffness.cpp:199:4: error: #error NonperiodicStiffnessKernel requires FFTW3
#error NonperiodicStiffnessKernel requires FFTW3
^~~~~
make[1]: *** [nonperiodic_stiffness.o] Error 1

Step 5: Compile LAMMPS

% make clean-all
% make g++_openmpi

You should have binary called lmp_g++_openmpi. Do a softlink

% ln -s lmp_g++_openmpi lammps

Make and Run USER-GFMD Units Tests

% cd src/USER-GFMD/
% make unittests
% ./unittests
[==========] Running 23 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 5 tests from CrystalSurfaceTest
[ RUN      ] CrystalSurfaceTest.fcc100
[       OK ] CrystalSurfaceTest.fcc100 (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_supercell
[       OK ] CrystalSurfaceTest.fcc100_supercell (11 ms)
[ RUN      ] CrystalSurfaceTest.reverse_indices
[       OK ] CrystalSurfaceTest.reverse_indices (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_3nn
[       OK ] CrystalSurfaceTest.fcc100_3nn (0 ms)
[ RUN      ] CrystalSurfaceTest.fcc100_neighbor_shells
[       OK ] CrystalSurfaceTest.fcc100_neighbor_shells (0 ms)
[----------] 5 tests from CrystalSurfaceTest (12 ms total)
.....
.....
.....

Run Tests

% cd src/USER-GFMD/tests
% sh run_tests.sh ../../lmp_g++_openmpi

I had some errors, but it did not look critical. Tests were run without failures

.....
.....
TEST_Hertz_sc100_128x128_a0_1.3
eval.py:83: RuntimeWarning: invalid value encountered in sqrt
  pa_xy = np.where(r_xy<a, p0*np.sqrt(1-(r_xy/a)**2), np.zeros_like(r_xy))
.ok.
TEST_restart
.ok.
Ran 20 tests; 0 failures, 20 successes.

Changing License Server on ABAQUS Clients

If you are modifying your ABAQUS client to point to another license server, you can do the following.

For ABAQUS 2020 later

% vim /usr/SIMULIA/EstProducts/2020/linux_a64/SMA/site/custom_v6.env
.....
.....
abaquslm_license_file="27000@192.168.1.0"
.....
.....

For ABAQUS 2019 and earlier

% vim /var/DassaultSystemes/SimulationServices/V6R2019x/linux_a64/SMA/site/custom_v6.env

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