.. _sec-installation_lin: Installation and Execution on Linux OS ================================================== Installation on Linux OS -------------------------------------------------- Copy ``phits.zip`` from the PHITS installation package to a directory where you would like to install. Copy also the installer for Linux ``PHITS-Installer_lin.sh`` from the ``linux`` folder in the PHITS installation package to the same folder. Open a terminal and move to the installing folder. Then type the following command to add executable property to the installer: .. code-block:: console chmod +x PHITS-Installer_lin.sh Then execute the installer by the following command: .. code-block:: console ./PHITS-Installer_lin.sh Installation will proceed in unzipping the ZIP file, modifying the installation PATH in files, and setting the execution PATH. Input of passward will be required during the unzip. PATH setting will be done in ``.profile`` with the assumption of the use of Bash. If you are using other shells, please change the setting accordingly. Installation is successfully finished if you do not see any error message. Type the following command to activate the PATH setting: .. code-block:: console source ~/.profile This command is not necessary anymore from the next login, since ``.profile`` will be automatically read when logging in. .. _sec-Lin-exe: Execution on Linux OS -------------------------------------------------- In Linux environment, PHITS is executed via terminal. Open a terminal and move to the directory which contains the input file by the ``cd`` command. Then PHITS can be executed in the following fashion. .. code-block:: console phits.sh phits.inp Here ``phits.inp`` is the PHITS input file name (e.g., ``lec01.inp``). As command histories can be retrieved by pressing the ↑ key in the terminal, it is convenient to use the same input file name when you want to repeatedly execute PHITS. The execution of ANGEL and DCHAN-SP can be done in a similar fashion. ANGEL can be executed by .. code-block:: console angel.sh angel.inp where ``angel.inp`` is the input file name (tally output of PHITS. e.g., ``track_xz.out``). To execute DCHAIN, type the following command in the terminal: .. code-block:: console dchain.sh dchain.out where ``dchain.out`` is the name of the DCHAIN input file (the file name is designated in the **[t-dchain]** section of the PHITS input). Note that if errors, such as no permission, occur when executing PHITS, it might be because the execution permission has not been added to the executable file. For such a situation, go to ``phits/bin`` or where the executable file is located in the terminal, and type the following command for authorization: .. code-block:: console chmod +x XXX Here ``XXX`` is the name of the executable file (e.g., ``phits335.exe``). Execute by specifying an executable file without using a shell ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The PHITS code can be executed on Linux without using a shell by the following command: .. code-block:: console phitsXXX.exe < input.inp where ``phitsXXX.exe`` is the PHITS executable file and XXX is the version number, and ``input.inp`` is the input file for PHITS calculation. (Note 1) If additional files are used with the **infl:** parameter when PHITS is executed with this method. In this case, the following text should be written in the first line of the main input file: .. code-block:: console file = phits.inp See :numref:`sec-include_file` for further discussion of **infl:**. (Note 2) To perform a PHITS calculation using distributed-memory parallel computing, the name of the input file must be specified in the first line of the ``phits.in`` file, which locates in the same folder containing the executable file, by the following manner: .. code-block:: console file = input.inp The name of ``phits.in`` is fixed and cannot be changed arbitrarily. See the example in :numref:`sec-paracomp_exe` for more detail.