-
Notifications
You must be signed in to change notification settings - Fork 7
2. How to compile?
To install the VM2D program on a computer, you must download the source code of the program. If "Git" is installed on your computer, just execute the command
git clone https://github.com/vortexmethods/VM2D.git VM2D
After that, VM2D subfolder will be created in the current folder and all files from the repository will be loaded into it, including source codes, examples of tasks, scripts, etc.
To prepare the source code for compilation create the “build” folder in the directory with the downloaded source codes and execute the following command from the “build” folder:
cmake ..
If necessary, you must specify the necessary keys for configuring the compilers used, specifying compilation options, etc. You may also need some modification of "CMakeLists.txt" file containing the settings of CMake.
In particular, to prepare the source codes for subsequent compilation in Windows using MS Visual Studio, you should use one of the following commands (the Win64 option is required to use the ability to perform calculations on Nvidia graphics cards, supporting CUDA technology; it is enabled for Visual Studio 2019 by default for 64-bit systems)
cmake -G "Visual Studio 12 2013 Win64" ..
cmake -G "Visual Studio 14 2015 Win64" ..
cmake -G "Visual Studio 15 2017 Win64" ..
cmake -G "Visual Studio 16 2019" -A x64 ..
Further compilation of the code depends on the operating system used. For Windows, as a rule, using CMake, a project will be created for its opening and compilation using MS Visual Studio (see above); for Linux, it is enough to execute from the created folder the following command:
make
If compilation (on Linux) fails with an error due to the lack of necessary MPI libraries, you can try to clear “build” folder, and instead of cmake .. execute the following command from the “build” folder:
CXX = mpiCC cmake ..
and after successful execution, repeat the compilation using the make command.
If you use a compiler different from the default one (for Windows it is usually built-in compiler in MS Visual Studio, for Linux – gcc/g++), for example, Intel C++ compiler, you must specify the key when preparing the source codes for compilation (note that Intel C++ Compiler 19 does not integrate by default in Visual Studio 2019, and its use requires additional “manual” settings)
-T "Intel C ++ Compiler XE 13.0"
-T "Intel C ++ Compiler XE 14.0"
-T "Intel C ++ Compiler XE 15.0"
-T "Intel C ++ Compiler 16.0"
-T "Intel C ++ Compiler 17.0"
-T "Intel C ++ Compiler 18.0"
-T "Intel C ++ Compiler 19.0"