Menu

Tree [725956] master /
 History

HTTPS access


File Date Author Commit
 CMake 2025-03-27 Marc van der Sluys Marc van der Sluys [9a5425] Add module astro, for astronomy/astrophysics pr...
 doc 2025-03-02 Marc van der Sluys Marc van der Sluys [01069b] Update copyright and licence.
 examples 2020-09-20 Marc van der Sluys Marc van der Sluys [6ffa5c] getopt: provide functions to extract integers o...
 src 2025-04-08 Marc van der Sluys Marc van der Sluys [725956] astro: flux_from_magnitude()/magnitude_from_flu...
 CMakeLists.txt 2023-08-05 Marc van der Sluys Marc van der Sluys [14d1c5] CMakeLists.txt: minimum CMake version: 2.8 -> 3.0.
 LICENCE 2025-03-02 Marc van der Sluys Marc van der Sluys [01069b] Update copyright and licence.
 code_version.sh 2016-04-02 MvdS MvdS [65dd0a] Add \param unit to version.f90
 readme.org 2025-03-02 Marc van der Sluys Marc van der Sluys [01069b] Update copyright and licence.

Read Me

#+title: LibSUFR readme


* Summary
+ Package:      libSUFR
+ Description:  A LIBrary of Some Useful Fortran Routines
+ Homepage:     https://libsufr.sourceforge.net
+ Copyright:    (c) 2002-2025  Marc van der Sluys - Nikhef/Utrecht University - https://marc.vandersluys.nl
+ Licence:      EUPL1.2

libSUFR is a LIBrary of Some Useful Fortran Routines that I wrote for my own use, but that may also be useful
for others.  It currently also "SUFRs" from the fact that Fortran module files are compiler dependent...  To
download the libSUFR package, read the code documentation, or to contact the developer, see:
https://libsufr.sourceforge.net/



* Installation

** Dependencies

libSUFR is written in Fortran, hence you will need a Fortran compiler.  Gfortran, part of gcc, is a free,
open-source Fortran compiler included in many GNU/Linux distributions and available from
https://gcc.gnu.org/fortran/.

The default installer uses CMake to configure and compile the code.  CMake is also open-source software, also
included in most GNU/Linux distributions, and can be downloaded from https://www.cmake.org/.  Alternatively,
you can create your own Makefile or compile and link the code manually.



** Unpacking

After downloading from libsufr.sf.net, you can unpack the tarball and cd into its
directory by doing e.g.:

  $ tar xfz libsufr-0.0.1.tar.gz
  $ cd libsufr-0.0.1/

(replace "0.0.1" with the correct version number).



** Configuring, compiling and installing

To configure, compile and install the code (into CMake's default system directories /usr/local/...), from the
main package directory (the one that contains the file CMakeLists.txt), do:
#+begin_src bash
  mkdir build && cd build/
  cmake ..
  make
  sudo make install
#+end_src
The second step above configures the code and should find your Fortran compiler.  The third step compiles and
links the code, and the last step installs it on your system - for which you need root priveliges, hence the
'sudo' command.

To install the package in a specific system directory, e.g. the Linux default ~/usr/...~  (recommended), do:
#+begin_src bash
  mkdir build && cd build/
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
  make
  sudo make install
#+end_src

To install the package in your own user directory, you don't need root priveliges, can omit the 'sudo' command
and combine the last two commands, e.g.:
#+begin_src bash
  mkdir build && cd build/
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/me/usr ..
  make install
#+end_src

To compile the code with your favourite compiler (in case you have several installed), prepend the cmake line
with e.g. FC=gfortran:
#+begin_src bash
  FC=gfortran cmake ..
#+end_src

If you have multiple cores or processors, you can speed up the make step by specifying the number of parallel
build jobs using the -j option.  E.g., for four cores, you can have four parallel jobs and use:
#+begin_src bash
  make -j4
#+end_src

To compile the code without installing it anywhere, leave out the install step
 #+begin_src bash
   mkdir build && cd build/
   cmake ..
   make
 #+end_src
The compiled libraries and modules can then be found in the usr/ subdirectory of the package dir.

On a Linux system, the library and module files could be installed as:
: /usr/lib/libSUFR.*
: /usr/include/libSUFR/*.mod

If you want to use the libraries with multiple Fortran compilers, you will want to 
keep the different versions of the library separated.  In this case, use (in addition 
to any other options):
#+begin_src bash
  cmake -DCOMPILER_SPECIFIC_LIBS=on ..
#+end_src

The library files will then be installed as:
: /usr/lib/libSUFR_<NameOfFortranCompiler>.*
: /usr/include/libSUFR/<NameOfFortranCompiler>/*.mod

If one of your Fortran compilers is your default, you can use both the default installation method and the
compiler-specific method to install the library for both compilers on the same system.


** Contact

If you run into problems or have questions, please feel free to contact Marc van der Sluys by email through
https://marc.vandersluys.nl.




* Licence

Copyright (c) 2002-2025  Marc van der Sluys - Nikhef/Utrecht University - https://marc.vandersluys.nl

This file is part of the libSUFR package.

This is free software: you can redistribute it and/or modify it under the terms of the European Union Public
Licence 1.2 (EUPL 1.2).  This software 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
EU Public Licence for more details.  You should have received a copy of the European Union Public Licence
along with this code.  If not, see <https://www.eupl.eu/1.2/en/>.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.