Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 09:55:49 +0000



[User Discussion] - custom studies build

View Count: 2197

[2016-10-04 18:45:13]
User222821 - Posts: 21
hi am using sierra with wine and i would like to build custom study if I press build custom study the following will appear
-- Starting build of Custom Studies Source files: finwin.cpp. -- 20:31:49

The Visual C++ compiler is not installed. Press the 'Install Compiler' button to download and install the compiler.
C:\windows\system32\cmd.exe /C "C:\SierraChart\ACS_Source\VisualCCompile.Bat"


C:\SierraChart\ACS_Source>call "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"

C:\SierraChart\ACS_Source>"C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
Can't recognize '"C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"' as an internal or external command, or batch script.

C:\SierraChart\ACS_Source>cl /GL /W3 /Gm- /O2 /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Oy- /Oi /LD /EHsc /nologo "C:\SierraChart\ACS_Source\finwin.cpp" /link /INCREMENTAL:NO /OPT:REF /OPT:ICF /OUT:"C:\users\crossover\My Documents\forex\mildaf\finwin.dll"
Can't recognize 'cl /GL /W3 /Gm- /O2 /Zc:inline /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /Oy- /Oi /LD /EHsc /nologo "C:\SierraChart\ACS_Source\finwin.cpp" /link /INCREMENTAL:NO /OPT:REF /OPT:ICF /OUT:"C:\users\crossover\My Documents\forex\mildaf\finwin.dll"' as an internal or external command, or batch script.
-- End of Build -- 20:31:50
[2016-10-04 21:39:28]
Sierra Chart Engineering - Posts: 104368
There is definitely no way we can help with this at this time when using WINE. In about a month, we will support remote compiling which will work around this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-05 03:19:07]
User35525 - Posts: 179
I just ran into this too. I've been using SC for years with Wine, on Linux and Mac, but now I'm having snags building custom studies DLL's from within SC because "visualcppbuildtools_full.exe" won't install (don't you hate Microshaft?). It looks like a Wine error:
https://bugs.winehq.org/show_bug.cgi?id=40451

I'm looking forward to the "remote compiling" option with Wine. My current computer is a mac running OS X 10.11.6 (El Capitan), with XCode installed. I also have homebrew , which is able to install gcc.

Does anybody have tips for cross-compiling Windows SC code from OS X?

Thanks.
[2016-10-06 11:15:56]
ganz - Posts: 1048
User35525
i've tested the 'old' options using linux native g++-mingw32 and i see no problems here:

i686-w64-mingw32-g++ -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 file.cpp -o /home/ganz/.wine/drive_c/SierraChart/Data/file.dll

btw it's Debian 8 and wine-staging. looks fine. works well.

fyi: http://crossgcc.rts-software.org/doku.php?id=compiling_for_win32
Date Time Of Last Edit: 2016-10-06 11:21:06
[2016-10-06 17:29:43]
User35525 - Posts: 179
@ganz,
Thank you very much!! It's working with your help, and I'm back in business. :-)

Your mac .dmg link for gcc 4.8 might be best so it "just works", but I first decided to roll the dice with homebrew,
to get something slightly more up-to-date, and that worked!

In case it helps someone, here's the homebrew recipe that worked:

unofficial mingw-w64 Homebrew sub-command and Formulae.
https://github.com/cosmo0920/homebrew-mingw_w64

$ brew tap cosmo0920/mingw_w64
$ brew tap homebrew/versions
$ brew install-mingw-w64
$ brew install i686-w64-mingw32-binutils
$ brew install i686-w64-mingw32-gcc

$ which i686-w64-mingw32-gcc
/usr/local/bin/i686-w64-mingw32-gcc

Now ganz’s cross-compilation line works perfectly, even on macs, but use “i686-w64-mingw32-gcc” instead of
“i686-w64-mingw32-g++”. i.e.

$ i686-w64-mingw32-gcc -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 AdaptiveERI_MA.cpp -o /Users/ted/.wine/drive_c/SierraChart/Data/AdaptiveERI_MA.dll

[2016-10-06 20:34:40]
User222821 - Posts: 21
for this i need more help :-)
is there any manual step by step what to where write?
[2016-10-06 22:40:58]
User35525 - Posts: 179
Hi @User222821,

I'm not an expert at this, but I'd try Ganz's suggestion first (untested by me).
1) Download and install this DMG: http://crossgcc.rts-software.org/doku.php?id=compiling_for_win32

2) Run "i686-w64-mingw32-gcc --help" from the command line. If it says "command not found", try running "/usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/i686-w64-mingw32-gcc --help". You'll want to use whatever cross-compiler it installed in the "/usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/" folder. If that's unsuccessful, then try Homebrew and my directions in post #5; you'll first need to see "http://brew.sh" for instructions to install Homebrew (just a single line you type at the terminal).

3) I'm assuming your'e already running SC using Wine on your Mac. I installed Wine with Homebrew:
https://www.davidbaumgold.com/tutorials/wine-mac/
You could probably also have used WineBottler:
http://winebottler.kronenberg.org/

4) To compile AdaptiveERI_MA.cpp to AdaptiveERI_MA.dll, I first used terminal and this command:
cd ~/.wine/drive_c/SierraChart/ACS_Source

Then I used ganz's command to cross-compile the CPP file, saving the DLL to SC's "Data" folder [post 5 above].

Hope this helps. Now I have to figure out how to cross-compile from my Linux server to 32-bit Windows DLL's. :-)

This should be moot next month when SC releases their Remote Compiler service from within SC. I presume that will simply upload your CPP code to their server, compile it, then download the DLL to your "Data" folder.
Date Time Of Last Edit: 2016-10-06 22:44:27
[2016-10-07 02:59:02]
ganz - Posts: 1048
User35525
I presume that will simply upload your CPP code to their server, compile it, then download the DLL to your "Data" folder.
This is the another non logic step from SC Team: they had asked us to not trust Google but now they are doing the same thing.
they dislike M$ and C# but starting to use VC++ again.
This is the definite way to fail. imo :)
[2016-10-07 05:49:33]
User35525 - Posts: 179
ganz
:-)

Thus I'm keeping my SC code to a minimum, and trying to use Kiwi's idea to feed SC with a custom feed with only entry/exit/mm sigs:
Python for Sierra Chart
http://www.sierrachart.com/index.php?page=doc/IntradayDataFileFormat.html#FeedSierraChartData

But instead of Python, I'm trying to do all my trade logic in nim, which is like Python/Pascal/C all rolled together, so FAST to develop, compile, and execute...perfection. Once DTC has released some Python API examples (maybe just the user contributed ones will be fine), I'll try porting them to nim: http://nim-lang.org/

SC is the best at a) data feeds; b) trade execution; c) maybe charting. Everything else (backtesting, etc) should be doable within your own 3rd-party client. And since SC supports DTC, that could be a reality.

I don't want SC to be a jack of all trades, or try to be the best at everything. I want it to keep being what it is, but let me add-on my own logic on top of everything, in my own 3rd-party app (C++ DLL's as currently provisioned are great, but nim will be better for me). The more powerful and easy DTC and associated API's are, the better things will be for SC and clients.
Date Time Of Last Edit: 2016-10-07 16:42:28
[2016-10-14 09:12:13]
bjohnson777 (Brett Johnson) - Posts: 284
Thanks to ganz for posting the i686-w64-mingw32-gcc command. I took notes on your previous post... some years ago it was... I think. I may turn this into a small script since I have so many source files.

I got M$VC++ installed on my win7 dual boot that I also beat into submission into a VM. I may try copying out the dir tree into wine to see if it works sometime in the near future. I remember seeing this mentioned in a web search somewhere, but I don't know if it worked or not.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account