Project

General

Profile

Windows Development

This is a new instruction for Building PLaSK with Visual Studio and Python 3.

Git client

Please install Git for Windows. You may also install GitExtensions or TortoiseGit, which are powerful Git clients for Windows that integrate with the Explorer.

You can use it to clone the PLaSK repository from https://<user_name>@redmine.phys.p.lodz.pl/plask.git.

After cloning repositories, init and update submodules.

Required tools and libraries

  • Microsoft Visual Studio 2022.

  • Anaconda Python Distribution 3.10 64-bit. You may install either for the current user (just you) or all users. It is recommended to select ‘Add to Path’ checkbox if possible (if you do not this, you will have to add Anaconda to your path manually).

  • Additional libraries (see below)...

  • Optionally:

    • Doxygen. Automatic developer documentation builder. It is not necessary.

Installing additional libraries

In order to install required libraries (Boost, Expat, and Eigen), please download Libraries.zip and extract it into C:\ folder. You should see a new folder C:\Libraries around 400MB large.

Next you must add the folder C:\Libraries\bin to the Path environment variable. In Windows 10 and 11, open the Star menu and start typing variables (or equivalent in your language, e.g. zmienne in Polish Windows version). Then select Edit environment variables four your account (Edytuj zmienne środowiskowe dla konta in Polish). In the dialog window that opens, find Path in the User variables, select it and click Edit.... In the another window, which pop-ups, click New, type C:\Libraries\bin and finally click Ok in all the dialogs.

If you have not selected Add to Path while installing Anaconda you must additionally add the following folders to the PATH (replace C:\ProgramData\Anaconda3 with the folder you installed Anaconda into): C:\ProgramData\Anaconda3, C:\ProgramData\Anaconda3\Library\bin, C:\ProgramData\Anaconda3\Library\usr\bin, C:\ProgramData\Anaconda3\Scripts.

Eventually your Path environment variable must contain the following folders:

  • C:\Libraries\bin (put this in the beginning)
  • C:\ProgramData\Anaconda3
  • C:\ProgramData\Anaconda3\Library\bin
  • C:\ProgramData\Anaconda3\Library\usr\bin
  • C:\ProgramData\Anaconda3\Scripts

You also need to define two new environment variables:

  • CMAKE_PREFIX_PATH — set its value to C:\Libraries
  • MKLROOT — set it to C:\ProgramData\Anaconda3\Library

Next open an Anaconda Prompt as administrator and type two commands:

conda install mkl-devel

The last step is to create the file (or open if it already exists) C:\ProgramData\Anaconda3\Lib\site-packages\sitecustomize.py and to put into it:

import os
os.add_dll_directory('C:\\Libraries\\bin')

Get PLaSK source

You may clone PLaSK Git repository using Visual Studio or Visual Studio Code.

Compile PLaSK under Visual Studio

Start Microsoft Visual Studio. Open the file CMakeLists.txt from PLaSK source folder, by using FileOpenCMake... menu. Select x64-Debug or x64-Release configuration (x86 build will fail). Use the menu CMakeBuild All to build PLaSK.

Debugging

To set up command line arguments for the debugger, refer to https://docs.microsoft.com/en-us/cpp/ide/cmake-tools-for-visual-cpp#configuring-cmake-debugging-sessions. We suggest that you use the target ${buildRoot}\bin\plask.exe for debugging.

Go to top