Support Board
Date/Time: Tue, 22 Apr 2025 10:56:49 +0000
Post From: Problem: Remote Build in SierraChart_ARM64.exe is creating x64 (Intel) DLLs
[2025-01-04 07:05:10] |
User719512 - Posts: 309 |
I believe it's not just the target architecture; it's also the host architecture that needs to be known. If you look in C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat you can see several lines that set this:... if /I "%1"=="x64" ( set __VCVARSALL_TARGET_ARCH=x64 set __VCVARSALL_HOST_ARCH=x64 set __local_ARG_FOUND=1 ) ... if /I "%1"=="x64_arm64" ( set __VCVARSALL_TARGET_ARCH=arm64 set __VCVARSALL_HOST_ARCH=x64 set __local_ARG_FOUND=1 ) if /I "%1"=="arm64" ( set __VCVARSALL_TARGET_ARCH=arm64 set __VCVARSALL_HOST_ARCH=arm64 set __local_ARG_FOUND=1 ) ... If you are building on a Mac in parallels, I am not certain which option you'd want from the many (probably "arm64"), but on my AMD x64 Windows machine, I can build an ARM binary with: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat
which can also be called like:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64_arm64
And then instead of doing what Sierra build does when it generates/creates/uses D:\SierraChart\ACS_Source\VisualCCompile.Bat: cl /Zc:wchar_t /GS /GL /W3 /O2 /Zc:inline /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Oy /Gd /Gy /Oi /GR- /GF /Ot /fp:precise /MT /std:c++17 /LD /EHa /WX- /nologo "D:\SierraChart\ACS_Source\GDIExample.cpp" /link "Gdi32.lib" "User32.lib" /DLL /DYNAMICBASE /INCREMENTAL:NO /OPT:REF /OPT:ICF /MACHINE:X64 /OUT:"D:\SierraChart\Data\GDIExample_64.dll" Do this instead: cl /Zc:wchar_t /GS /GL /W3 /O2 /Zc:inline /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Oy /Gd /Gy /Oi /GR- /GF /Ot /fp:precise /MT /std:c++17 /LD /EHa /WX- /nologo "D:\SierraChart\ACS_Source\GDIExample.cpp" /link "Gdi32.lib" "User32.lib" /DLL /DYNAMICBASE /INCREMENTAL:NO /OPT:REF /OPT:ICF /MACHINE:ARM64 /OUT:"D:\SierraChart\Data\GDIExample_ARM64.dll" For the local build from within Sierra, Sierra would know what host is running based on whether SierraChart.exe (?), or SierraChart_64.exe, or SierraChart_ARM64.exe is the Sierra process and could build accordingly. Another option is to build locally outside of Sierra with the command line, or Visual Studio. |