dss-extensions / AltDSS-Go

Golang (CGo) bindings for AltDSS/DSS C-API. Tries to mimic the organization of the OpenDSS COM classes, within the scope of Go's language features.
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Building the extensions on MAC M1 #5

Open dougchristie-DukeEnergy opened 4 months ago

dougchristie-DukeEnergy commented 4 months ago

Is there a way to build the extensions for the mac m1 chipset? I tried to do the following wget. Then setting paths and running go build ./altdss and it did not work.

wget -qO- https://github.com/dss-extensions/dss_capi/releases/download/0.14.5/dss_capi_0.14.5_darwin_arm64.tar.gz | tar zxv

PMeira commented 4 months ago

This worked for me (macOS Ventura 13.6.3, most tools from homebrew) -- just updated the path and *.so to *.dylib:

git clone https://github.com/dss-extensions/electricdss-tst # for sample files
git clone https://github.com/dss-extensions/altdss-go
cd altdss-go
wget -qO- https://github.com/dss-extensions/dss_capi/releases/download/0.14.5/dss_capi_0.14.5_darwin_arm64.tar.gz | tar zxv
export CPATH=`pwd`/dss_capi/include/
mv dss_capi/lib/darwin_arm64/*.dylib .
export LIBRARY_PATH=`pwd`
go build ./altdss # this takes some time
go build -o . ./examples/simple.go
./simple