Installation

Requirements

FLUKA is available at the moment only for x86 and x86_64 Linux​ systems. The FLUKA package can be downloaded from the FLUKA website www.fluka.eu​​. This version of the code should be run on the platforms for which it has been released, which are:

  • FLUKA 32 bits, requires gcc/g77 (version \(≥\) 3.4)

  • FLUKA 64 bits, requires gcc/gfortran (version \(≥\) 8.0)

The Linux​ x86 version must be compiled at 32 bits with g77 but can run on both 32 and 64 bit machines while the Linux x86_64 version must be compiled with gfortran and works only on 64 bits machine. The latter is still tentative, we cannot exclude some issues with that version. The code has been checked and validated for these platforms/compilers only for the time being.

The availability of the source code​ (available under the license reported at the beginning of this volume) shall not be exploited for tentative builds on other architectures or with different compilers/compiler options than the ones recommended by the development team. Our experience shows that for a code of the complexity of FLUKA the chances of hitting one or more compiler issues are very large. Therefore users shall not make use for every serious task, including whichever form of publication or presentation, of code versions built on platforms and/or with compiler options which have not been cleared as safe by the development team.

We distribute a package containing compiled libraries​, user routines in source form, INCLUDE files, various unformatted and formatted data files and a number of scripts for compiling ($FLUPRO/flutil/fff), ​​ linking ($FLUPRO/flutil/lfluka) ​​ and running ($FLUPRO/flutil/rfluka) ​ the program on a given platform. A list of the contents is provided in a README​ file, and information on the current version, possibly overriding parts of the present manual, may be contained in a file RELEASE-NOTES​. No external library routines are required. The timing and other necessary service routines are already included.

Installation instructions

Different packages can be downloaded from the FLUKA website www.fluka.eu​​ (in the tar file name below, yy and zz are respectively the gfortran compiler and glibc versions used when generating the code libraries):

  • 32 bits: requires gcc/g77 (version \(≥\) 3.4)

    • Linux x86 (tar.gz package): fluka2024.1-linuxAA.tar.gz

    • Linux x86 (rpm installer): fluka-2024.1-0.i686.rpm

  • 64 bits: requires gcc/gfortran (version \(≥\) 8.4)

    • Linux x86_64 (tar.gz package): fluka2024.1-linux-gfor64bit-yy-glibczz-AA.tar.gz

    • Linux x86_64 (rpm installer): fluka-2024.1-0.x86_64.rpm

    • Mac (intel) (tar.gz package): fluka2024.1-mac-gfor64bit-yy-AA.tar.gz

    • Mac (arm) (tar.gz package): fluka2024.1-macm123-gfor64bit-yy-AA.tar.gz

  • data files required by FLUKA, all versions:

    • fluka2024.1-data.tar.gz

Installation of the tar.gz packages

  1. The user must define few environmental variables:

    • FLUPRO: pointing to the directory where the distribution tar file will be decompressed. If you work on bash do: > export FLUPRO=/pathto/fluka or if you work on csh or tcsh do: > setenv FLUPRO /pathto/fluka

      If the directory does not exist you should first create it by: > mkdir /pathto/fluka

    • FLUFOR (optional): containing the compiler type (gfortran or g77) which must be coherent with the architecture of the package you downloaded. If you work on bash do: > export FLUFOR=g77 or > export FLUFOR=gfortran or if you work on csh or tcsh do: > setenv FLUFOR g77 or > setenv FLUFOR gfortran

      In case FLUFOR is not set the script does an attempt of checking if the name of the $FLUPRO directory contains the gfor string. In this case gfortran is selected. If the FLUFOR variable is not set and the compiler platform name is not coded in the directory name g77 is selected.

    • GFORFLU (optional): set to specify the specific version of gfortran to be used if more than one is available (i.e. if on your machine gfortran points to a version \(<\) 8.x, and gfortran8 points to version 8.x, you can set GFORFLU to gfortran8 and happily use the FLUKA gfortran 64 bits version).

    Note: Such definition of the environment variables are lost when you log out. In order to make it permanently available you should add the export/setenv command to your shell configuration file:

    • If you work on bash add them to your .bashrc file;

    • If you work on csh (or tcsh add them to your .cshrc (or .tcshrc) file;

  2. Go to the FLUPRO directory and move there the selected FLUKA package > cd $FLUPRO > cp /path/fluka2024.1-linux-gfor64bit-yy-glibczz-AA.tar.gz . or > cp /path/fluka2024.1-data.tar.gz .

  3. Now you can uncompress the tar.gz packages > tar -zxvf fluka2024.1-linux-gfor64bit-yy-glibczz-AA.tar.gz or > tar -zxvf fluka2024.1-data.tar.gz

  4. Compile the flutils, link and install FLUKA by typing: > make this creates the default executable flukahp and compiles auxiliary programs in the directory flutil.

Installation of the RPM package

We also distribute a RPM package which can be installed in principle on each x86 RPM-enabled distribution (Fedora, Redhat, Ubuntu, SuSe ..etc). The package requires the compat-libf2c-34 and compat-gcc-34 packages.

  • In order to install the RPM just type (as root): > rpm -ivh fluka-2024.1-0.i686.rpm or > rpm -ivh fluka-2024.1-0.x86_64.rpm

  • If you want instead to upgrade a previous installation run (as root): > rpm -Fvh fluka-2024.1-0.i686.rpm or > rpm -Fvh fluka-2024.1-0.x86_64.rpm

Package content

The FLUKA libraries and most data files are in $FLUPRO, the include files in $FLUPRO/flukapro/, default user routines in $FLUPRO/usermvax/, and compilation, linking and score-processing programs in $FLUPRO/flutil/.

Package content

If the source code​ is included in the distribution, it will be contained in $FLUPRO files with names of the form …vax.for [1].

The basic FLUKA program on UNIX​ machines consists of 34 files (*): ​

aamodmvax.for  bamjmvax.for   blockmvax.for  bmemvax.for    comlatmvax.for
decaymvax.for  dedxmvax.for   dumvax.for     elsmvax.for    emfmvax.for
eventpmvax.for evffrmvax.for  fluoxmvax.for  geolatmvax.for gcrmvax.for
kaskadmvax.for lowneumvax.for mainmvax.for   mathmvax.for   neutrimvax.for
noptmvax.for   nundismvax.for nunresmvax.for opphmvax.for   outputmvax.for
pemfmvax.for   pgmvax.for     preclmvax.for  preeqmvax.for  pripromvax.for
pwxsmvax.for   rndmvax.for    usermvax.for   XXXmvax.for (**)

Three more files contain source code related to the DPMJET and RQMD packages, which can be linked with FLUKA to run simulations involving heavy ion nuclear interactions, or Ultra High Energy Cosmic Ray simulations.

dpmmvax.for    rqmdmvax.for    uhemvax.for

(*)The form …vax.for has historical reasons. Actually, as seen later, the files are automatically split by a Makefile into single routines (with extension .f) before compilation

(**) XXX stands for hp, ibm, linux, osf etc. depending on the platform. Most UNIX Fortran compilers require that the extension .for be replaced by .f (but the makefile​ provided with FLUKA takes care of this, see below).

See FLUKA modules (Fortran files) for a short description of the content of these files.

If the source code is present, the INCLUDE files​ needed to compile the program are grouped into the file flukaadd.add​

A makefile​ and a number of auxiliary programs​ split these files into individual routines and INCLUDE files, which are placed in 34+1 separate directories and compiled. The object files are inserted in a FLUKA library libflukahp.a​. A shell script lfluka​ links all routines into an executable flukahp​ (the name is the same for all UNIX platforms, the “hp” being due to historical reasons).

The DPMJET and Rqmd and UHE object files are collected in three separate libraries. ​ ​ ​ ​ ​ ​

The FLUKA distribution tar file​ normally does not contain an executable file.​ To create the default FLUKA executable, type:

$FLUPRO/flutil/lfluka -m fluka

(the name of the resulting executable will be flukahp)​

or, if heavy ion​ nuclear interactions are needed:

$FLUPRO/flutil/ldpmqmd

(the name of the resulting executable will be flukadpm3) ​​

User-written routines​ (in particular a SOURCE​ subroutine, see list of user interface routines in User routines) can be compiled separately and linked overriding the default routines of the library. The $FLUPRO/flutil/lfluka script can take care of them in three different ways:​

  1. appending the Fortran files (xxx.f) as last arguments to the lfluka procedure (Linux only);

  2. appending the object files (precompiled using the $FLUPRO/flutil/fff procedure supplied with the code) as last arguments to the lfluka procedure;​

  3. inserting the object files into a library and giving the library name to the script with the -O or -l options.

An on-line help​​ is available issuing lfluka -h.

The program needs several auxiliary data files​, containing cross sections​, nuclear​ and atomic​ data and so on. Many of these files are unformatted and have an extension .bin (or .dat).

The auxiliary files are generally kept in the main FLUKA directory and require no modification by the user.

Here is the list:

cohff.bin

Coherent atomic form factors​​

fluodt.dat

Fluorescence emission data, needed for problems involving low-energy electron-photon transport​

gxsect.bin

Photon cross sections​

incohff.bin

Inoherent atomic form factors​​

neuxsc-ind_260.bin

Low-energy neutron cross sections: needed for all problems with neutron transport below 20 MeV, unless point-wise cross sections are requested​

pwxs/*.pwx

Point-wise low-energy neutron cross sections: needed for all problems with neutron transport below 20 MeV if point-wise cross sections are requested ​

nunstab.data

(Anti)neutrino cross sections ​

nuclear.bin

Nuclide masses, abundances and other data: needed for all hadronic problems​

elasct.bin

Elastic cross sections for hadronic problems​

sigmapi.bin

Pion cross sections​

brems_fin.bin

Bremsstrahlung cross sections​

endfb8r0.fyi, jeff33.fyi, jendl40.fyi, xnloan.dat

Fission nuclide yields and neutron multiplicities​

DDS/*.dat, Fad/*.dat

Complete fusion data files for the BME event generator ​

sidae.dat, sidan.dat, sidap.dat, sidapi.dat

Silicon damage weighting functions ​

cx_dj3_AA.bin, cx_dj3.bin

DPMJET-3 nucleus-nucleus and hadron-nucleus cross sections ​

cx_m01.bin

Epos hadron-nucleus cross sections ​

cx_m06.bin

Sibyll hadron-nucleus cross sections ​

grv98lof.grid, grv98lo.grid, grv98nld.grid, grv98nlf.grid, grv98nlm.grid

Structure functions for the (anti)neutrino deep inelastic scattering ​

Pre-connected I/O files

​ FLUKA reads its main input from standard logical unit 5​ and writes its main output​ to logical unit 11. Both are parameterised in the INCLUDE file IOUNIT​ as LUNIN ​ and LUNOUT​, and can therefore be redefined if necessary. Assignment of unit number 5 and log messages​ to the corresponding files is achieved (on Linux/UNIX) via the redirection symbols​ \(<\) and \(>\). ​ Other input and output files on UNIX can be assigned a I/O unit number by means of symbolic links (but the syntax for Fortran implicit connection is not standard and forms like fort.xx or ftnxx can both be found on different platforms). An alternative way is offered by the OPEN​ command of FLUKA, which allows to perform explicit connections.

The $FLUPRO/rfluka script​ supplied with the code contains all relevant I/O file definitions, and can be used to run the code interactively or through a batch queue. It allows to submit multiple runs with a single command. Both rfluka and lfluka​ (the script used for linking, see above) contain usage instructions.

The rfluka​ script creates a temporary directory​ where it copies the necessary files and deletes it after the results have been copied back to the parent directory, thus allowing to run more than one job at the same time in the same directory. Appropriate names for the output files are generated by rfluka, including a sequential number​ for each run.

If user routines are linked and a new executable​ is created, the name of the new executable can be input using the -e option. Some on-line help​ is available issuing rfluka -h.