TkN 2.3
Toolkit for Nuclei
Loading...
Searching...
No Matches
Download and Install

Prerequisites

Operating systems

Linux (Ubuntu, Scientific Linux, CentOS, Debian, ...) and MacOS X operating systems are supported. No support for Windows yet.

Basic software

You will need :

  • git to download the sources
  • cmake to configure the build (at least version 3.10)
  • a compiler supporting C++17
  • if linked with ROOT, a ROOT version at least version 6.20

Getting the sources

TkN is available to download and build from source from our GitLab repository.

Let's suppose you plan to install TkN in the following directory:

cd /path/to/mysofts/TkN

The first time you download the source code, you need to clone the repository by typing the following command:

git clone https://gitlab.in2p3.fr/tkn/tkn-lib tkn-sources

This will create a directory called tkn-sources containing the source code. By default, the version of TkN in this directory will correspond to the last version of the master branch.

To list the available tkn versions, use:

cd tkn-sources
git tag

The release specific tag can be obtained using:

git checkout -b v2.3 v2.3

Build and install

cmake configuration

In the folder TkN (see above section), create the build and install directories:

cmake -S tkn-sources -B tkn-build -DCMAKE_INSTALL_PREFIX=tkn-install

That should end with something similar to:

TkN version: 2.3
TkN compiled with c++17
TkN compiled in Release mode !
Looking for ROOT:
-- Found Vdt: /Users/dudouet/Softs/root/install/root-6-36-04/include (found version "0.4")
-- ROOT Found in /Users/dudouet/Softs/root/install/root-6-36-04
-- ROOT Version: 6.36.04
Looking for SQlite:
-- tksqlite3 loaded
Loading libraries
-> tkbase
-> tkdb
-> tkphysics
-> tkroot
Building users exec:
-> tkn-print
-> tkn-db-update
ROOT execs -> tkn-root
TkN Configuration
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/dudouet/Softs/TkN/tkn-lib/tkn-build

Advanced options

The following options can be given at the cmake configuration level (with default values):

option(USE_ROOT "compile TkN using ROOT (if installed)" ON)
option(DB_DOWNLOAD "Download the SQL database at install" OFF)
option(USE_CXX11 "Compile TkN using C++11" OFF)

For example, to not link TkN with ROOT, and install the sqlite database at the installation step, use:

cmake -S tkn-sources -B tkn-build -DCMAKE_INSTALL_PREFIX=tkn-install -DUSE_ROOT=OFF -DDB_DOWNLOAD=ON

Compile and install

cmake --build tkn-build --target install -jN

With N being the number of processors available.

Possible compilation issues

In case your compiler does not support C++17, or if ROOT has been compiled with C++11, a patch can be applied to compile TkN with C++11:

cmake -S tkn-sources -B tkn-build -DCMAKE_INSTALL_PREFIX=tkn-install -DUSE_CXX11=ON

Be aware that in the future, possible developments could no longer be C++11 compatible. We do not assure C++11 backward compatibility.

Setting up the environment

After installing, you can use one of the following scripts to set up the necessary paths on your system to find the executables and run-time libraries. Choose the right script for your shell:

source /path/to/mysofts/TkN/tkn-install/bin/thistkn.csh [(t)csh shell]
source /path/to/mysofts/TkN/tkn-install/bin/thistkn.sh [bash/zsh shell]

After doing this you should be able to do e.g.:

tkn-config --version
2.3

Downloading the database

The tkn-db-update executable allows you to download or update the sqlite database:

tkn-db-update --download
[ INFO ] TkN_ensdf_260101_xundl_250101_v2.3.db installed in tkn-install/databases/

This step is not needed if the database has been downloaded during the install process. The database is updated twice a year, following the ENSDF updates.

Interactive session

If TkN has been compiled linked with root, you should be able to do:

tkn-root
_____ _ _ | Documentation: https://tkn.in2p3.fr/
(_ _) | \ | | | Source: https://gitlab.in2p3.fr/tkn/tkn-lib
| |_ _| \| | |
| | |/ / | | Version 2.3
| | <| |\ | |
|_|_|\_\_| \_| | Database: TkN_ensdf_260101_xundl_250101_v2.3.db

If the database has not been downloaded at the cmake step using the option -DDB_DOWNLOAD or using tkn-db-update, you will obtain the following message:

tkn-root
[ ERROR ] database::open(/Users/dudouet/Softs/TkN/test/tkn-install/databases/TkN.db,OPEN)
can't open database: 'unable to open database file'
[ INFO ] use tkn-db-update to download the database

In this case, as indicated, you need to use the tkn-db-update program to download the database.

Notes

  • If ROOT is not detected, set ROOTSYS (and update PATH, LD_LIBRARY_PATH) before running CMake.
  • Re-run the CMake configure step after changing options (e.g. USE_ROOT, DB_DOWNLOAD, USE_CXX11).