Skip to content

Commit

Permalink
File to build OpenDSS Linux version
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloRadatz committed Oct 10, 2024
1 parent 18c21a0 commit d627400
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions OpenDSSLinuxCPPForRepo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Print the full path of this script
# echo "The full path of this script is: $(realpath "$0")"

# Remove the existing py_dss_interface directory if it exists

chmod +rwx py_dss_interface
# Change directory to the cloned repository
cd py_dss_interface

# Create build directory
mkdir buildlinux

# Remove the existing 'linux' directory (if it exists) and create a new one
rm -rf ./src/py_dss_interface/opendss_official/linux
mkdir -p ./src/py_dss_interface/opendss_official/linux/cpp

# Run CMake to configure the project (set Release and output type as shared library)
cmake -DCMAKE_BUILD_TYPE=Release -DMyOutputType:STRING=SHARED -S ./OpenDSSC -B ./buildlinux

# Build the project using 12 cores (adjust depending on your system's available cores)
cmake --build ./buildlinux -j 1
cd buildlinux
# Copy the built files from buildlinux to the target directory
cp -r . ../src/py_dss_interface/opendss_official/linux/cpp/
cd klusolve
cp -r libklusolve_all.so ../../src/py_dss_interface/opendss_official/linux/cpp
cp -r libklusolve_all.so.0 ../../src/py_dss_interface/opendss_official/linux/cpp
cp -r libklusolve_all.so.0.0.0 ../../src/py_dss_interface/opendss_official/linux/cpp
cd ..
# Clean up the build directory

rm -rf buildlinux
cd ..


0 comments on commit d627400

Please sign in to comment.