-
Notifications
You must be signed in to change notification settings - Fork 19
How to build STEPS kernel
This is the very first step before using STEPS. It requires only basic knowlege of code complilation.
Colone STEPS from https://github.com/changgang/steps or download the source codes from the following links:
(1) master branch
(2) dev branch
Installation of CB is not compulsory but highly recommended. STEPS is originally developed with CB. It is convinient to compile STEPS with CB.
Please go to CB official website to download the latest version of CB. If you are using Unix-like system, check your OS version and maybe you can directly install CB with package manager (yum or apt-get).
The compiler must support C++14. GCC of verion 4.9 or higher is recommended.
Follow guides of your OS, use package manager to install gcc and g++ with the latest version.
MinGW-64 is suggested on Windows system. Use 64-bit version!
Go to MinGW-64 official website and redirect to MinGW-64 sourceforge page.
Go to files and scroll down to find the installer of the latest version named "x86_64-posix-seh".
Unpack the downloded 7z file to any folder, remember the folder location.
Start CB and configure its toolchain exectuable. If you use Windows system, the location of unpacked MinGW-64 is required here.
- Open csparse.cbp in the code/ folder with CB.
- Go 'Project'-'Properties'-'Build targets'and set type as 'static library'.
- Compile CSparse. You should get a libCSparse.a in folder build/bin/Release/.
- Open cxsparse.cbp in the code/ folder with Code::Blocks
- Go 'Project'-'Properties'-'Build targets'and set type as 'static library'.
- Compile CXSparse. You should get a libCXSparse.a in folder build/bin/Release/.
- Open cpptest.cbp in the code/ folder with Code::Blocks, set build target as 'static library'.
- Compile CppTest. You should get a libCppTest.a in folder build/bin/Release/.
- Open STEPS.cbp in the code/ folder with Code::Blocks.
- Go 'Project'-'Build options'-'Linker settings', and add the libCsparse.a, libCXSparse.a, and libCppTest.a library to 'Link libraries'.
- Go 'Project'-'Properties'-'Build Target', and select build target - If you want to compile STEPS as dynamic library, select 'Dynamic library', and set the output file name as 'libsteps.so' for Unix-like systems or 'libsteps.dll' for Windows systems.
- Compile the STEPS. You should get the output file in folder build/bin/Release/.
- Compile CSparse as static library. You can find CSparse.cbp in the code/ folder.
- Compile CXSparse as static library. You can find CXSparse.cbp in the code/ folder.
- Compile CppTest as static library. You can find CppTest.cbp in the code/ folder.
- Compile STEPS as dynamic library or exectuable file. Include libCSparse.a, libCXSparse.a, and libCpptest.a.
To build in Linux shell mode, you can simply run the code/linux_make.sh script in the STEPS source. Before you run the script, install cbp2make first.
- Download and install the cbp2make from sourceforge page. Remember to add x mode to the cbp2make file to make it executable.
- Add x mode to the linux_make.sh file to make it executable.
- Run linux_make.sh.
- Build STEPS into dynamic library is strongly recommended. But if you do want to build STEPS into console application, here is the procedure
1.1 In the Compile STEPS step, select 'Console application'.
1.2 Enable 'Link' option for only one of Source files with leading name of 'main'. - We strongly recommend compile STEPS as 64-bit version. But if you do want to compile it into 32-bit version, it is Okay. Just remember to use the correct version of Python.
Cite STEPS via: Changgang Li, Yue Wu, Hengxu Zhang, Hua Ye, Yutian Liu and Yilu Liu, "STEPS: A Portable Numerical Simulation Toolkit for Electrical Power System Dynamic Studies," in IEEE Transactions on Power Systems, doi: 10.1109/TPWRS.2020.3045102.