The Extra-Small Library (xslib) is a modern Fortran library consisting of useful utilities and functions as stand-in for Fortran "standard" library. The library is written with primary purpose of learning modern Fortran language, good coding practices, and in hopes that it helps someone else on their quest of learning Fortran.
For latest build clone repository from GitHub (or download other releases):
git clone https://github.com/JureCerar/xslibMove 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 xslib to a non-standard location (default/usr/local/lib/)-DCMAKE_BUILD_TYPE=xxxequal toRELEASEfor normal build orDEBUGfor debugging purposes.
Documentation is available at doc/README.md.
To use the library in your project add use xslib in the modules section of your program:
program main
use xslib
implicit none
! ...
end program mainWhen compiling your program add -lxslib flag to compiler options. 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 xslib --libs --cflagsAlternatively, the library can be added with CMake. First, find the library on your computer:
find_package ( xslib 3.0 REQUIRED )
include_directories ( ${xslib_INCLUDE_DIRS} )Then link shared or static library to your target build:
# Link shared library
target_link_libraries ( ${CMAKE_PROJECT_NAME} ${xslib_LIBRARIES} )
# OR link static library
target_link_libraries ( ${CMAKE_PROJECT_NAME} ${xslib_STATIC_LIBRARIES} )NOTE: In case of non-standard installation path use the following CMake option (with the appropriate value instead of xxx):
-Dxslib_DIR=xxxequal to CMake config file path (default is/usr/local/lib/cmake/xslib-X.X.X).
Functions for handling molecular files are now available separately. See atomlib for more information.
Also check out (arguably much better) Fortran-lang/stdlib project.
This program is licensed under the GNU General Public License v3.0
Copyright (C) 2019-2023 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/.