Difference between revisions of "Compiling Kharon"

From Kraken Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Kharon is Kraken's thermal hydraulics solver containing both Fortran and C code.
+
[[Kharon]] is Kraken's thermal hydraulics solver containing both Fortran and C code.
  
 
Build instructions are provided for Linux and Windows.
 
Build instructions are provided for Linux and Windows.
  
 
=== Linux ===
 
=== Linux ===
The makefiles are configured to use gnu compilers (gcc and gfortran)
+
The Makefiles are configured to use gnu compilers (gcc and gfortran).
  
*On Ubuntu Bionic
+
*On Ubuntu Bionic these compilers can be installed with
 
**sudo apt install gcc
 
**sudo apt install gcc
 
**sudo apt install gfortran
 
**sudo apt install gfortran
  
*On potku2 (espnr130)
+
If you want to try a compilation with different compilers the following Makefiles may need to be adjusted
**You can use the common installation of gnu 6.3.0 compilers by setting the following in your ''.bash_profile''
+
 
<pre>
+
./Kharon/libTable/Makefile
##### GCC 6.3.0 (2020) #####
+
./Kharon/Makefile
 +
./Kharon/src/Makefile
 +
./Kharon/libFluid/Water/Makefile
 +
./Kharon/libFluid/Fluid/Makefile
 +
./Kharon/libFluid/HeavyWater/Makefile
 +
./Kharon/libFluid/Makefile
 +
./Kharon/libFluid/test/Makefile
 +
./Kharon/libFluid/BufferedFluid/Makefile
 +
./Kharon/libFluid/unittests/Makefile
 +
./Kharon/libFluid/doc/latex/Makefile
 +
./Kharon/libFluid/Fortran/Makefile
  
SAL=/share/apps/gcc/6.3.0
+
To compile everything, go to the base directory (Kharon) and execute:
export PATH=${SAL}/bin:${PATH}
 
export INCLUDE=${SAL}/include:${INCLUDE}
 
export LD_LIBRARY_PATH=${SAL}/lib64:${SAL}/lib:${LD_LIBRARY_PATH}
 
</pre>
 
:*Or alternatively
 
module load gcc
 
To compile everything, go to the base directory (Kharon) and command:
 
 
<pre>
 
<pre>
 
make
 
make
Line 30: Line 33:
 
make clean
 
make clean
 
</pre>
 
</pre>
 +
 +
The executable is produced to the main Kharon folder as '''<tt>Kharon/kharon</tt>'''.
  
 
=== Windows ===
 
=== Windows ===

Latest revision as of 11:34, 3 February 2024

Kharon is Kraken's thermal hydraulics solver containing both Fortran and C code.

Build instructions are provided for Linux and Windows.

Linux

The Makefiles are configured to use gnu compilers (gcc and gfortran).

  • On Ubuntu Bionic these compilers can be installed with
    • sudo apt install gcc
    • sudo apt install gfortran

If you want to try a compilation with different compilers the following Makefiles may need to be adjusted

./Kharon/libTable/Makefile
./Kharon/Makefile
./Kharon/src/Makefile
./Kharon/libFluid/Water/Makefile
./Kharon/libFluid/Fluid/Makefile
./Kharon/libFluid/HeavyWater/Makefile
./Kharon/libFluid/Makefile
./Kharon/libFluid/test/Makefile
./Kharon/libFluid/BufferedFluid/Makefile
./Kharon/libFluid/unittests/Makefile
./Kharon/libFluid/doc/latex/Makefile
./Kharon/libFluid/Fortran/Makefile

To compile everything, go to the base directory (Kharon) and execute:

make

To clean the compilation, go to the base directory (Kharon) and command:

make clean

The executable is produced to the main Kharon folder as Kharon/kharon.

Windows

  • Open KharonGit.sln in Visual Studio in either vs2015 or vs2019 folder, depending on Visual Studio version
  • Compile tableMaker project
  • Run tableMaker.exe (not in Kharon/vs201?/libTable folder but in Kharon/libTable), thus writing waterTable.h
  • Compile KharonGit project