Install Open Babel 2.4.1 from Source Code

This section provides a tutorial example on how to install Open Babel 2.4.1 from source code on CentOS 8 computers.

If for some reason, you have trouble to install Open Babel latest release from source code, you can try to install Open Babel 2.4.1 from source code on CentOS 8 as shown in this tutorial.

1. Go to Open Babel Code Repository at https://sourceforge.net/projects/openbabel/.

2. Open "Files > openbabel / 2.4.1" folder. And download openbabel-2.4.1.tar.gz.

3. Unzip and untar the download file. You should see a directory openbabel-2.4.1 with all source code.

4. Create a "build" sub-directory and configure the build system.

herong$ cd openbabel-2.4.1/

herong$ mkdir build
herong$ cd build

herong$ cmake ..
...
-- Checking for module 'cairo'
--   Package 'cairo', required by 'virtual:world', not found
-- Could NOT find Cairo (missing: CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)
-- Could NOT find Cairo. PNG output will NOT be supported.
...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/herong/openbabel-2.4.1/build

5. Run the build process.

herong$ make -j2
Scanning dependencies of target inchi
Scanning dependencies of target openbabel
[  0%] Building CXX object src/CMakeFiles/openbabel.dir/alias.o
[  0%] Building C object src/formats/libinchi/CMakeFiles/inchi.dir/ichi_bns.o
[  0%] Building C object src/formats/libinchi/CMakeFiles/inchi.dir/ichi_io.o
...
[100%] Building CXX object test/CMakeFiles/test_runner.dir/unitcell.o
[100%] Building CXX object test/CMakeFiles/test_runner.dir/obtest.o
[100%] Linking CXX executable ../bin/test_runner
[100%] Built target test_runner

6. Run tests on the build result. You may see some failures.

herong$ make test
Running tests...
Test project /home/herong/openbabel-2.4.1/build
        Start   1: test_automorphism_1
  1/151 Test   #1: test_automorphism_1 ..............   Passed    0.01 sec
        Start   2: test_automorphism_2
  2/151 Test   #2: test_automorphism_2 ..............   Passed    0.01 sec
        Start   3: test_automorphism_3
        ...
150/151 Test #150: pytest_kekule ....................   Passed    0.32 sec
        Start 151: pytest_pdbformat
151/151 Test #151: pytest_pdbformat .................***Failed    0.03 sec

94% tests passed, 9 tests failed out of 151
Total Test time (real) =  21.85 sec

The following tests FAILED:
   42 - test_gzip_1 (Failed)
   53 - test_isomorphism_5 (Failed)
   54 - test_isomorphism_6 (Failed)
   57 - test_multicml_1 (Failed)
   64 - test_rotor_2 (Failed)
   65 - test_rotor_3 (Failed)
   66 - test_rotor_4 (Failed)
  146 - pytest_sym (Failed)
  151 - pytest_pdbformat (Failed)
Errors while running CTest
make: *** [Makefile:73: test] Error 8

7. Build final installation targets and install them to the default system location.

herong$ sudo make install
[ 14%] Built target openbabel
[ 16%] Built target plugin_descriptors
...
[100%] Built target test_runner
[100%] Built target roundtrip
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/include/openbabel-2.0/openbabel/babelconfig.h
-- Installing: /usr/local/lib/pkgconfig/openbabel-2.0.pc
...
-- Installing: /usr/local/bin/obgrep
-- Set runtime path of "/usr/local/bin/obgrep" to "/usr/local/lib"
-- Installing: /usr/local/bin/roundtrip
-- Set runtime path of "/usr/local/bin/roundtrip" to "/usr/local/lib"

7. Verify installation.

herong$ babel -V
Open Babel 2.4.1 -- May 25 2020 -- 08:24:13

8. Verify all commands provided by Open Babel.

herong$ cd /usr/local/bin
herong$ ls -l o*

-rwxr-xr-x. 1 root root  38624 May 25  2020 obabel
-rwxr-xr-x. 1 root root 342800 May 25  2020 obchiral
-rwxr-xr-x. 1 root root  24928 May 25  2020 obconformer
-rwxr-xr-x. 1 root root  29456 May 25  2020 obenergy
-rwxr-xr-x. 1 root root  34304 May 25  2020 obfit
-rwxr-xr-x. 1 root root  34112 May 25  2020 obfitall
-rwxr-xr-x. 1 root root  30136 May 25  2020 obgen
-rwxr-xr-x. 1 root root  29120 May 25  2020 obgrep
-rwxr-xr-x. 1 root root  30440 May 25  2020 obminimize
-rwxr-xr-x. 1 root root  38600 May 25  2020 obmm
-rwxr-xr-x. 1 root root  35480 May 25  2020 obprobe
-rwxr-xr-x. 1 root root  34536 May 25  2020 obprop
-rwxr-xr-x. 1 root root  34280 May 25  2020 obrotamer
-rwxr-xr-x. 1 root root  28728 May 25  2020 obrotate
-rwxr-xr-x. 1 root root  75808 May 25  2020 obspectrophore
-rwxr-xr-x. 1 root root  23968 May 25  2020 obsym
-rwxr-xr-x. 1 root root  24776 May 25  2020 obtautomer
-rwxr-xr-x. 1 root root  24184 May 25  2020 obthermo

Table of Contents

 About This Book

 SMILES (Simplified Molecular-Input Line-Entry System)

Open Babel: The Open Source Chemistry Toolbox

 What Is Open Babel

 Install Open Babel with Anaconda

 Install Open Babel on Windows Computers

 Run Open Babel GUI on Windows Computers

 Change Display Command on Open Babel GUI

 Open Babel Installation Options on Linux

 Install Open Babel Binary Package on CentOS

 "Open Babel Error in LoadAllPlugins" Error

 Install Open Babel from Source Code

Install Open Babel 2.4.1 from Source Code

 Open Babel Installation Options on macOS

 Install Open Babel Binary Package on macOS

 Using Open Babel Command: "obabel"

 Generating SVG Pictures with Open Babel

 Substructure Search with Open Babel

 Similarity Search with Open Babel

 Fingerprint Index for Fastsearch with Open Babel

 Stereochemistry with Open Babel

 Command Line Tools Provided by Open Babel

 RDKit: Open-Source Cheminformatics Software

 rdkit.Chem.rdchem - The Core Module

 rdkit.Chem.rdmolfiles - Molecular File Module

 rdkit.Chem.rdDepictor - Compute 2D Coordinates

 rdkit.Chem.Draw - Handle Molecule Images

 Molecule Substructure Search with RDKit

 rdkit.Chem.rdmolops - Molecule Operations

 Daylight Fingerprint Generator in RDKit

 Morgan Fingerprint Generator in RDKit

 RDKit Performance on Substructure Search

 Introduction to Molecular Fingerprints

 OCSR (Optical Chemical Structure Recognition)

 AlphaFold - Protein Structure Prediction

 Resources and Tools

 Cheminformatics Related Terminologies

 References

 Full Version in PDF/EPUB