Difference between revisions of "Compiling Ants"

From Kraken Wiki
Jump to: navigation, search
(Linux)
 
(8 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
*Requires [https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html Intel oneAPI Math Kernel Library (oneMKL)]. MKL is already available on VTT computational clusters. Easy to install on Ubuntu Bionic at least.
 
*Requires [https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html Intel oneAPI Math Kernel Library (oneMKL)]. MKL is already available on VTT computational clusters. Easy to install on Ubuntu Bionic at least.
 
**In order to install Intel oneAPI packages with apt, add the Intel oneAPI repository using [https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/apt.html#GUID-560A487B-1B5B-4406-BB93-22BC7B526BCD these instructions].
 
**In order to install Intel oneAPI packages with apt, add the Intel oneAPI repository using [https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/apt.html#GUID-560A487B-1B5B-4406-BB93-22BC7B526BCD these instructions].
**If installing with apt, the required packages seem to be ('''last two are needed only if you want to use Intel compilers'''):
+
**If installing with apt, the required packages seem to be:
  intel-oneapi-mkl
+
  intel-oneapi-mkl-2024.0
  intel-oneapi-mkl-devel
+
  intel-oneapi-mkl-devel-2024.0
  intel-oneapi-compiler-fortran
+
  intel-oneapi-compiler-fortran-2024.0
  intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
+
  intel-oneapi-compiler-dpcpp-cpp-2024.0
*If you want to use GNU compilers instead, you can '''<tt>sudo apt install gcc</tt>''' and '''<tt>sudo apt install gfortran</tt>''' instead.
 
 
*The environment variable '''<tt>MKLROOT</tt>''' needs to point to the root of the MKL installation directory. For Linux, see the instructions at [https://software.intel.com/en-us/mkl-linux-developer-guide-setting-environment-variables Developer Guide for Intel® Math Kernel Library for Linux] to automate this process.
 
*The environment variable '''<tt>MKLROOT</tt>''' needs to point to the root of the MKL installation directory. For Linux, see the instructions at [https://software.intel.com/en-us/mkl-linux-developer-guide-setting-environment-variables Developer Guide for Intel® Math Kernel Library for Linux] to automate this process.
 
** Basically requires adding '''<tt>source /opt/intel/oneapi/setvars.sh</tt>''' to either '''<tt>~/.bashrc</tt>''' or '''<tt>~/Envs/Kraken/bin/postactivate</tt>'''.
 
** Basically requires adding '''<tt>source /opt/intel/oneapi/setvars.sh</tt>''' to either '''<tt>~/.bashrc</tt>''' or '''<tt>~/Envs/Kraken/bin/postactivate</tt>'''.
Line 20: Line 19:
 
*Requires libomp5 (libomp5 and libomp-dev packages on Ubuntu Bionic).
 
*Requires libomp5 (libomp5 and libomp-dev packages on Ubuntu Bionic).
 
*On Linux use the Makefiles found in bin folder. The temporary files and final executables are placed in different folders for each build/compiler combination (for example, to '''<tt>Ants/bin/Release/ifort/</tt>''' when compiling with the default Makefile). Therefore, make clean is not necessary when consecutively compiling different builds (make -f <makefile>).
 
*On Linux use the Makefiles found in bin folder. The temporary files and final executables are placed in different folders for each build/compiler combination (for example, to '''<tt>Ants/bin/Release/ifort/</tt>''' when compiling with the default Makefile). Therefore, make clean is not necessary when consecutively compiling different builds (make -f <makefile>).
**Makefile: release build for ifort/icc
+
**Makefile: release build for ifort/icx
**Makefile_debug: debug build for ifort/icc
+
**Makefile_debug: debug build for ifort/icx
**Makefile_gfortran: release build for gfortran/gcc
+
**Makefile_gfortran: release build for gfortran/gcc '''We strongly recommend NOT using gfortran at the moment as its use seems to lead to erroneous program code'''.
**Makefile_gfortran_debug: debug build for gfortran/gcc
+
**Makefile_gfortran_debug: debug build for gfortran/gcc '''We strongly recommend NOT using gfortran at the moment as its use seems to lead to erroneous program code'''.
  
 
=== Windows ===
 
=== Windows ===
Line 30: Line 29:
 
*Instead, one can either edit or add the Path-variable in the User variables in the Environment variables to include for example
 
*Instead, one can either edit or add the Path-variable in the User variables in the Environment variables to include for example
 
  C:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64
 
  C:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64
*Ants Visual Studio solution file is in the vs2017 folder (ants.sln).
+
*Ants Visual Studio solution file is in the vs2022 folder (ants.sln).
 
*Always compile either Debug x64 or Release x64 builds, depending on which build is desired.
 
*Always compile either Debug x64 or Release x64 builds, depending on which build is desired.
 
*It might also be necessary to add for example
 
*It might also be necessary to add for example
 
  C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler
 
  C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler
 
in the Path-variable in order to find the correct libiomp5md.dll when Ants is ran.
 
in the Path-variable in order to find the correct libiomp5md.dll when Ants is ran.
 +
*The Visual Studio solution and project files might be unsuitable for all environments with different Visual Studio or compiler versions. These have to be modified accordingly.
 +
 +
=== Additional notes ===
 +
*Intel Fortran compilers (both ifort and ifx) have a regression in the 2024.1 release, where the Release makefiles with -nostand option do not compile. To fix this error, either remove the -nostand or use -stand f18 option.
 +
 +
[[Category:Ants]]

Latest revision as of 08:24, 29 April 2024

Ants is the nodal neutronics program of the Kraken Framework. It is written in Fortran with a C-based interface for multi-physics data exchange.

Compilation instructions are provided for Linux and Windows.

Linux

  • Requires Intel oneAPI Math Kernel Library (oneMKL). MKL is already available on VTT computational clusters. Easy to install on Ubuntu Bionic at least.
    • In order to install Intel oneAPI packages with apt, add the Intel oneAPI repository using these instructions.
    • If installing with apt, the required packages seem to be:
intel-oneapi-mkl-2024.0
intel-oneapi-mkl-devel-2024.0
intel-oneapi-compiler-fortran-2024.0
intel-oneapi-compiler-dpcpp-cpp-2024.0
  • The environment variable MKLROOT needs to point to the root of the MKL installation directory. For Linux, see the instructions at Developer Guide for Intel® Math Kernel Library for Linux to automate this process.
    • Basically requires adding source /opt/intel/oneapi/setvars.sh to either ~/.bashrc or ~/Envs/Kraken/bin/postactivate.
    • Again, after modifying your environment, you will need to refresh it. The surest way is to close the current terminal window and continue in a new one.
  • On VTT computational clusters one recommended way to configure Intel Fortran compiler and Intel MKL is to load suitable module, for example by appending the following command to to ~/.bash_profile:
module load compiler
module load mkl
  • Requires libomp5 (libomp5 and libomp-dev packages on Ubuntu Bionic).
  • On Linux use the Makefiles found in bin folder. The temporary files and final executables are placed in different folders for each build/compiler combination (for example, to Ants/bin/Release/ifort/ when compiling with the default Makefile). Therefore, make clean is not necessary when consecutively compiling different builds (make -f <makefile>).
    • Makefile: release build for ifort/icx
    • Makefile_debug: debug build for ifort/icx
    • Makefile_gfortran: release build for gfortran/gcc We strongly recommend NOT using gfortran at the moment as its use seems to lead to erroneous program code.
    • Makefile_gfortran_debug: debug build for gfortran/gcc We strongly recommend NOT using gfortran at the moment as its use seems to lead to erroneous program code.

Windows

  • Requires Intel oneAPI Math Kernel Library (oneMKL). On Windows, the recommended way is to install Intel oneAPI Base Toolkit.
  • Correct way to set the oneMKL environment on Windows before launching Ants is described here. However, this won't set the environment variables permanently.
  • Instead, one can either edit or add the Path-variable in the User variables in the Environment variables to include for example
C:\Program Files (x86)\Intel\oneAPI\mkl\latest\redist\intel64
  • Ants Visual Studio solution file is in the vs2022 folder (ants.sln).
  • Always compile either Debug x64 or Release x64 builds, depending on which build is desired.
  • It might also be necessary to add for example
C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler

in the Path-variable in order to find the correct libiomp5md.dll when Ants is ran.

  • The Visual Studio solution and project files might be unsuitable for all environments with different Visual Studio or compiler versions. These have to be modified accordingly.

Additional notes

  • Intel Fortran compilers (both ifort and ifx) have a regression in the 2024.1 release, where the Release makefiles with -nostand option do not compile. To fix this error, either remove the -nostand or use -stand f18 option.