The atomlib is a modern Fortran library consisting of useful utilities and functions that a computer chemist might need during his/her work. It uses an object-oriented philosophy for reading and storing data for analysis. Works nicely together with xslib standard library. The library is written with primary purpose of learning modern Fortran language, good coding practices, and in hopes that it someday helps someone else in their pursuit of knowledge.
For latest build clone repository from GitHub (or download other releases):
git clone https://github.com/JureCerar/atomlibMove into directory and type the following:
mkdir build
cd build
cmake ..
make
make checkTo install the library type the following as root (or sudo):
make installYou should consider using the following CMake options with the appropriate value instead of xxx:
-DCMAKE_Fortran_COMPILER=xxxequal to the Fortran compiler (or use ENV variableFC)-DCMAKE_C_COMPILER=xxxequal to the C compiler (or use ENV variableCC)-DCMAKE_INSTALL_PREFIX=xxxto install library to a non-standard location (default/usr/local/lib/)-DCMAKE_BUILD_TYPE=xxxequal toRELEASEfor normal build orDEBUGfor debugging purposes.
Documentation is a work in progress and is available here.
To use the library in your project add use atomlib in the modules section of your program:
program main
use atomlib
implicit none
! ...
end program mainWhen compiling your program add -latomlib flag to compiler otions. You may also need to use -I flag to point to where the modules files are (default -I/usr/local/include) even with all of the right environment variables set. When linking use -L to point to library file (default -L/usr/local/lib).
To make things easier pkg-config file is also included to help you with your program compilation. You may need to add the config file to PKG_CONFIG_PATH environment variable (default '/usr/local/lib/pkgconfig').
pkg-config atomlib --libs --cflagsAlternatively, the library can be added with CMake. First, find the library on your computer::
find_package ( atomlib 1.0 REQUIRED )
include_directories ( ${atomlib_INCLUDE_DIRS} )Then link shared or static library to your target build:
# Link shared library
target_link_libraries ( ${CMAKE_PROJECT_NAME} ${atomlib_LIBRARIES} )
# OR link static library
target_link_libraries ( ${CMAKE_PROJECT_NAME} ${atomlib_STATIC_LIBRARIES} )NOTE: In case of non-standard installation path use the following CMake option (with the appropriate value instead of xxx):
-Datomlib_DIR=xxxequal to CMake config file path (default is/usr/local/lib/cmake/atomlib-x.x.x).
This library includes modified versions of libxdrfile and its Fortran wrapper libgmxfort for reading GROMACS .ndx, .trr, and .xtc files created by James W. Barnett.
This program is licensed under the GNU General Public License v3.0
Copyright (C) 2022 Jure Cerar
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.