Login Page - Create Account

Support Board


Date/Time: Thu, 19 Sep 2024 01:13:25 +0000



Post From: cross compile from macos targeting both aarch64 and x86_64

[2024-08-04 20:17:22]
gtaranti - Posts: 63
Thanks for posting this...

I'm using VS 2022 Build tools to compile both x86_64 and aarch64, each one in its own environment.


After installing VS 2022 Build tools my script for aarch64 is :

SET FILENAME=gt_trading

powershell -Command "$client = New-Object System.Net.Sockets.UdpClient; $bytes = [System.Text.Encoding]::ASCII.GetBytes('RELEASE_DLL--C:\SierraChart\Data\%FILENAME%_arm64.dll'); $client.Send($bytes, $bytes.Length, 127.0.0.1, 22093); $client.Close();"


powershell -Command "Start-Sleep -Seconds 1"

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_arm64
cl /I "C:\Program Files\libpqxx\include" /I "C:/Users/gt/src/vcpkg/installed/arm64-windows/include" /JMC /MP /analyze- /Zc:wchar_t /Z7 /Od /GS /W3 /RTC1 /Zc:inline /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /MD /Gd /Gy /GR- /GF /fp:precise /std:c++20 /LD /EHa /WX- /diagnostics:classic /nologo /Fo:"C:\SierraChart\ACS_Source\%FILENAME%.obj" "C:\SierraChart\ACS_Source\%FILENAME%.cpp" /link /NODEFAULTLIB:library "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "libpq.lib" "pqxx.lib" "ws2_32.lib" "wsock32.lib" /DLL /DYNAMICBASE /DEBUG /INCREMENTAL:NO /OPT:REF /MACHINE:ARM64 /LIBPATH:"C:\Program Files\libpqxx\lib" /LIBPATH:"C:\Program Files\PostgreSQL\15\lib" /TLBID:1 /OUT:"C:\SierraChart\Data\%FILENAME%_arm64.dll"


powershell -Command "$client = New-Object System.Net.Sockets.UdpClient; $bytes = [System.Text.Encoding]::ASCII.GetBytes('ALLOW_LOAD_ALL_DLLS'); $client.Send($bytes, $bytes.Length, 127.0.0.1, 22093); $client.Close();"

It's also sending UDP packets to SC to Release DLL and Allow loading DLL, in order to perform an in place change without the need to manually release/allow dlls or restart SC.
I'm using also some external *.lib files ("libpq.lib" "pqxx.lib") for postgresql database integration.

The x86_64 script has different compiler/linker options but is similar in structure.