=== Installation Guide === -- FLUKA DOWNLOAD -- The FLUKA packages can be downloaded from the FLUKA website http://fluka.cern FLUKA is available as tgz package (including the source), binary packages, RPM and Debian packages. It is available on Windows machine with the Windows subsystem for Linux (WSL) on Windows 10 or with Docker on Windows 7. -- OS/SOFTWARE PREREQUISITES -- FLUKA can be built on the following platforms: - Linux or Mac OS (x86_64) with gcc/gfortran (version >= 7) The availability of the source code 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 pretty high. 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 the compiler options which have not been cleared as safe by the development team. -- FLUKA DISTRIBUTION -- FLUKA can be installed from the binary packages or the source code(*) available from http://fluka.cern (*) Source code is only available to affiliates of institutes/universities holding an institutional FLUKA licence, and to CERN Staff and Fellows. Refer to the FLUKA licences. -- INSTALLATION INSTRUCTIONS -- 1) No environment variables are needed to compile and run FLUKA. However, see the note below. 2) Uncompress the downloaded tgz package '> tar -xzvf cd /pathtofluka/src/' '> make' This creates the FLUKA executables ('fluka' and 'flukadpm') and the auxiliary programs in the directory /pathtofluka/bin. - INSTALLATION FROM PACKAGE INCLUDING SOURCES - 3b) In case of the package including the source, the compilation is done by typing: '> cd /pathtofluka/' '> make' This creates the FLUKA libraries in the directory /pathtofluka/lib and the executables ('fluka' and 'flukadpm') and the auxiliary programs in the directory /pathtofluka/bin. Optionally one can specify additional parameters to make, type 'make help' for more information. Some useful parameters are: '> make -j 8' to use 8 CPU cores in parallel for compilation. Use up to the maximum cores of your machine. '> make install DESTDIR=/usr/local/fluka' To install install the compiled code to DESTDIR, e.g. /usr/local/fluka Note: As mentioned, no environment variables are needed to compile and run FLUKA. It is convenient to add the enviroment PATH variable the /pathtofluka/bin directory where all FLUKA executables and post-processing utilities are located. If you work on bash type: '> export PATH=/pathto/fluka:$PATH' or if you work on csh or tcsh type: '> setenv PATH /pathto/fluka:$PATH' Such definition of an environment variable is lost when you logout. 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; -- RUNNING FLUKA -- The rfluka script in /pathtofluka/bin should be used to drive the FLUKA run. In the following, it is supposed that FLUKA input file is named example.inp. The command to type is: '/pathtofluka/bin/rfluka example' This will runs five statistically independent cycles with the default FLUKA executable (/pathtofluka/bin/fluka). If user routines are linked and a new executable executable is created (see below), the name of the new executable can be input using the -e option: '/pathtofluka/bin/rfluka -e my_fluka.exe example' More details about running FLUKA and accessing the results are available in the manual. A usage help is available issuing '> /pathtofluka/bin/rfluka -h' -- HOW TO MAKE A FLUKA EXECUTABLE PROGRAM -- A shell script lfluka can link all routines into an executable. To create a FLUKA executable, type: '> /pathtofluka/bin/lfluka -so fluka' (the name of the resulting executable will be 'fluka') If heavy-ion nuclear interactions are needed, DPMJET and RQMD are needed. These software are included as external libraries. To create a FLUKA executable linking DPMJET And RQMD, type: '> /pathtofluka/bin/lfluka -d -o flukadpm' or '> /pathtofluka/bin/ldpmqmd -o flukadpm' (the name of the resulting executable will be 'flukadpm') A usage help is available issuing '> /pathtofluka/bin/lfluka -h' - HOW TO MAKE A FLUKA EXECUTABLE PROGRAM WITH USER ROUTINES - User-written routines can be compiled separately and linked to override the default routines of the library. A typical case is the SOURCE subroutine (see list of user interface routines in Sec. 13} of the FLUKA manual). The following instructions, which refer to the compilation of a source user routine, can be immediately extended to different or multiple user routines. The 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 '> /pathtofluka/bin/lfluka source.f' # it creates 'fluka' executable 2) appending the object files (precompiled using the /pathtofluka/bin/fff) as last arguments to the lfluka '> /pathtofluka/bin/fff source.f' # it creates source.o object file '> /pathtofluka/bin/lfluka source.o' # it creates 'fluka' executable 3) inserting the object files into a library and giving the library name to the script with the -O option. '> /pathtofluka/bin/fff source.f' # it creates source.o object file '> ar rv libmine.a source.o' # it creates the static library libmine.a '> /pathtofluka/bin/lfluka -O mine' # it creates 'fluka' executable A usage help is available issuing '> /pathtofluka/bin/lfluka -h' -- PACKAGE CONTENT -- We distribute a package containing a compiled library (in /pathtofluka/lib/), user routines and several post-processing programs to analyze user scores in source form (in /pathtofluka/src/user/ and /pathtofluka/src/tools, respectively), INCLUDE files needed to compile the program (in /pathtofluka/include/), various unformatted and formatted data files (/pathtofluka/data/) and a number of scripts for compiling (fff), linking (lfluka) and running (rfluka) the program (in /pathtofluka/bin/). A list of the package content follows: +- /pathtofluka/ +- bin/ +- fff* +- fluka_src_converter.py* +- ldpmqmd* +- lfluka* +- rfluka* +- data/ | ... data files ... +- doc/ +- fluka.manual +- examples/ +- fluka.spec +- include/ | ... files.inc ... +- INSTALL +- lib/ +- LICENSE +- makefile +- README.md +- RELEASE-NOTES +- src/ | ... FLUKA modules ... (included in the package with source) +- makefile +- tools/ +- user/ +- test/ +- Version.tag If the source code is included in the distribution, it will be contained in the /pathtofluka/src/ directory. The basic FLUKA program on UNIX/LINUX machines consists of 39 directories: bamjet block bme c cascade comlat decay dedx dummy els emf eventq eventv evffr external fluox gcr geolat interface cascade linux lowneu main math neutrino nopt nundis nunres opphoton output pemf pg precl preeq prin rnd score tools user See Sec. 4} of the FLUKA manual for a description of the content of these files. A makefile compiles all the files and inserts the object files in the FLUKA library /pathtofluka/lib/libfluka.a. The DPMJET, RQMD, PHOJET, and PYTHIA object files are collected in separate libraries (in /pathtofluka/lib/). No external library routines are required. The timing and other necessary service routines are already included. - INCLUDE FILES - The naming scheme of the INCLUDE has been changed by removing the parentheses and adding a file extension. As a consequence, old user routines written in FORTRAN need to be adapted. In order to facilitate this process, a script has been provided which takes care of converting sources, making this process transparent to the end-user. This python script is called fluka_src_converter.py and can be found in the /pathtofluka/bin directory of your installation. It accepts as argument the name of the file(s) (supporting wildcards) to be converted must be given. For example: fluka_src_converter.py mysrc*.f will convert all files starting with “mysrc” and having the extension .f By default backups of the original files will be made. - DATA FILES - The program needs several auxiliary data files, containing cross sections, nuclear and atomic data and so on. Some of these files are unformatted and have an extension .bin (or .dat). The auxiliary data files are kept in /pathtofluka/data 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 neuxsc.bin Low-energy neutron cross sections: needed for all problems with neutron transport below 20 MeV. 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 xnloan.dat Fission nuclide yields and neutron multiplicities sidae.dat, sidan.dat, sidap.dat, sidapi.dat Silicon damage weighting functions