Skip to content
cod-developersPublic

About

Tools for handling CIF files, and CIF parsers used for the Crystallography Open Database (COD)

Resources

Stars

26 stars

Watchers

6 watching

Forks

Repository files navigation

cod-tools -- a set of tools for CIF manipulation.

INSTALLATION

Before the installation of cod-tools, dependencies have to be installed.
Dependency installers for some operating systems are provided with the
cod-tools, under dependencies/, and can be executed as follows:

    sh dependencies/Ubuntu-24.04/install.sh

To install cod-tools from a clean distribution, the following steps have
to be executed.

For distributions based on Ubuntu 24.04, the first step should explicitly
specify the non-default version of the GCC compiler due to a bug in the
default version 13.2.0:

    # Skip the first step if not on a Ubuntu 24.04-based system
    COD_UBUNTU_GCC_MITIGATION="CC=gcc-14 EXTRA_CFLAGS=-fPIC"
    make all ${COD_UBUNTU_GCC_MITIGATION}
    make check
    make install PREFIX=/usr/local/install/cod-tools

Variable 'PREFIX' may be set to any preferred writable location.

ENVIRONMENT SETUP

After a successful installation, ideally, the package can be used out
of the box, either from the installation PREFIX or from the source
build directory. Since ^/trunk revision 10914 (cod-tools version
3.12.1) all scripts in the ~/scripts and ~/tools directories find
their required Perl modules using FindBin, and fetch the .pm files
from the lib/ directories next to the corresponding executable. In
this way, correct libraries will always be found, and several
cod-tools installations can be used simultaneously. To use cod-tools
programs as Linux/Unix commands, it is enough to have the newly
installed bin/ directory somewhere in your PATH:

    COD_TOOLS_PREFIX=/usr/local/install/cod-tools
    export PATH=${COD_TOOLS_PREFIX}/bin:${PATH}

For more convenience, and to use PYTHON bindings, several environment
variables should be updated to make the installed programs and
libraries automatically discoverable by the system. This can be done
by executing the following commands:

    COD_TOOLS_PREFIX=/usr/local/install/cod-tools
    export PERL5LIB=${COD_TOOLS_PREFIX}/lib/perl5:${PERL5LIB}
    export PYTHONPATH=${COD_TOOLS_PREFIX}/usr/local/lib/python${PYTHON_VERSION}/dist-packages:${PYTHONPATH}

Where "${PYTHON_VERSION}" is the Python3 version in the X.Y format
(e.g. '3.10'). On Debian/Ubuntu systems this version can be found by
executing the following command:

    py3versions --default --version

For distributions based on Ubuntu 22.04 the PERL5LIB variable should be further
modified to circumvent a bug in the libmath-bigint-gmp-perl software package:

    export PERL5LIB=/usr/share/perl/5.34:${PERL5LIB}

The provided commands can also be copied to the ~/.bashrc file to
automatically execute them each time a new shell is started.

REPLACING COD TOOLS MODULES

Occasionally, especially if you want to experiment with the cod-tools
code, you may want to replace the cod-tools Perl modules with your
custom ones. Since the cod-tools scripts started to use FindBin to
locate their libraries, it is *not* enough to just add your module
path at the beginning of the PERL5LIB value – the cod-tools scripts
will continue to look at their neighbouring lib/ directories first.

For the replacement to work, you need to symlink or to copy the
required scripts to your working directory, or to some other
executable file directory that has no "official" lib/ either in itself
or one level up. If you then call the linked/copied executable from
this new location, they will no longer find the old libraries and you
can use the standard method of setting PERL5LIB environment variable
to your desired locations. Alternatively, you can create a "lib/perl"
tree next to the linked cod-tools executable or the executable file
directory, and place your modules there. Of course if you do not
replace *all* cod-tools modules, the remaining modules with the
correct version for the script still need to be found, either in the
directories listed in PERL5LIB, or as symlinks in the local lib/
directories.

BUGS

If you find bugs in cod-tools or have any feedback, please contact us at
cod-bugs@ibt.lt

About

Tools for handling CIF files, and CIF parsers used for the Crystallography Open Database (COD)

Resources

Stars

26 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages