Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 10:12:01 +0000



[User Discussion] - How to build ACSIL study on Ubuntu/Linux

View Count: 8753

[2018-02-23 08:07:57]
ganz - Posts: 1048
64 bit version

- add 64 bit wine instance
$ WINEPREFIX=~/sierra64 wine winecfg

- place SC into sierra64
~/sierra64/drive_c/

- run SC
cd ~/sierra64/drive_c/SierraChart/
WINEPREFIX=~/sierra64 wine ./SierraChart_64.exe

- install mingw 64 bit compiler
apt install g++-mingw-w64-x86-64

- compile 64-bit dll
x86_64-w64-mingw32-g++ -march=native -O2 -shared -std=gnu++11 -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -w -c grail.cpp

- build 64-bit dll
x86_64-w64-mingw32-g++ -march=native -O2 -shared -std=gnu++11 -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -w grail.cpp -o grail.dll

Date Time Of Last Edit: 2018-02-23 08:08:18
[2018-02-23 11:01:40]
ganz - Posts: 1048
fyi:

It is possible to run 64 bit SC version atop pure 64 bit linux distro with no any 32 bit libs at all.
This is the definite sign to consider the solution as the well designed one, imo.
[2019-04-07 16:01:51]
User30743 - Posts: 364
is there any possibility to work with sc acil on linux in Visual Studio?

i got used to it when being on Windows, now i switched to linux and would like to stay here use it here in similar way. i am not a programmer so thats why i ask..

is it possible?
[2019-04-07 17:30:36]
ganz - Posts: 1048
User30743

1. SC is the pure winApp
2. VS is the pure winApp
3. you're not a coder

so what are you doing here?

linux is not better then w10 to drive a mouse
linux's X Window subsystem is outdated and slow
don't trust these ignorant and get back to w10
[2019-04-07 21:59:50]
Kiwi - Posts: 374
Being gentler than my friend I believe that there were issues installing VS under Wine on Linux.

Personally I use Visual Studio Code for C and C++ programming on Linux while using PyCharm CE for my Python tasks so perhaps VSC will appeal to you.

When creating dlls for Sierra Chart I generally just uses a text editor & then use Sierra Chart's remote build. It is excellent, pretty fast, and even releases & reloads the dll for you. Vim or VSC plus SC's own tool makes a pleasant coding experience. :)
[2019-04-07 22:32:38]
Kiwi - Posts: 374
You've inspired me Ganz (or I was bored on a Monday morning before the market opens).

Installed sagi g++-mingw-w64-x86-64

Tested it would work with /usr/bin/x86_64-w64-mingw32-g++ -march=x86-64 -mtune=x86-64 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -w kiwZ.cpp -o /home/john/zRamdisk/SierraData/kiwZ_64.dll

Gotta go for a walk & buy the paper then I'll see about integrating it with VS Code along with a command to release & later reload the dll. Will post that later for anyone thinking about VS Code (I liked your Geany post but being a Vim addict its no use to me).

So, here's the tasks.json for Visual Studio Code that will do it:

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build_DLL",
"type": "shell",
"command": "/usr/bin/x86_64-w64-mingw32-g++",
"args": [
"-march=x86-64",
"-mtune=x86-64",
"-O2",
"-shared",
"-static",
"-static-libgcc",
"-static-libstdc++",
"-s",
"-fno-rtti",
"-fno-exceptions",
"-w",
"${file}",
"-o",
"path to your sierrachart directory/Data/${fileBasenameNoExtension}_64.dll"
],
"options": {
"cwd": "path to your sierrachart directory/ACS_Source"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

Date Time Of Last Edit: 2019-04-08 07:23:29
[2019-04-08 08:44:26]
User30743 - Posts: 364
ganz,
i dont have win10, only win7

the reason why i want to stay on linux is that all my three monitor works only on linux. i have laptop with dock through witch two external monitors are plugged.

when i run win, only two of the monitors works and there is no way to make all the three working.
on linux though, all three works without problem.

so it seems it works better with graphics - also detached charts and times and sales was always messed up on windows OS - on linux it stay on its place correctly..
[2019-04-08 09:37:29]
ganz - Posts: 1048
User30743

so it seems it works better with graphics
the answer is No.

yes, it might be more flexible but performance will be just awful to win7

also detached charts and times and sales was always messed up on windows OS - on linux it stay on its place correctly.
open a support ticket to let SC Team know and to solve an issue

i want to stay on linux
you MUST forget any out of box solutions in this case and should be ready to study a lot

you might want to follow Kiwi's advices to move on step by step

imo.
[2019-04-08 10:42:19]
User30743 - Posts: 364
u mean that on linux the performance is worse?

i mean, i am not going to be attached to linux, but it impressed me to be honnest.

so yes, maybe i will switch back to windows, if the performance will be bad, or if i will find it too complicated to make acsil studies..

btw, what do u mean that i need to study a lot? study what?

and by the way - sc support doesnt help when it comes to messed times/sales windows, they know about it and they claim it is not their business Window Size and Position Not Restored When Opening Chartbook
Date Time Of Last Edit: 2019-04-08 10:45:05
[2019-04-08 10:52:42]
ganz - Posts: 1048
User30743

u mean that on linux the performance is worse?
not worse but awful

study what?
how to get rid of VS, 4exmpl

btw, did you check a state of hw support?

sudo dmesg | grep -ie error
sudo dmesg | grep -ie fail

they know about it and they claim it is not their business
linux/wine is not supported as well
so it will be unstable most likely
[2019-04-08 11:17:07]
User30743 - Posts: 364
well, ok-- u seem knowledgable... so do u have any idea why on linux all the three monitors works easily and on windows only two of them work?
[2019-04-08 11:37:50]
ganz - Posts: 1048
User30743

why on linux all the three monitors works easily
https://wiki.archlinux.org/index.php/multihead

on windows only two of them work
".. it is a problem with either the operating system and/or the video driver being used .." (c) SCteam
[2019-04-09 00:16:11]
Kiwi - Posts: 374
So, just finishing off.

I wrote a Python script to release the dll, compile and reload the new dll. So the Python is in a file I labelled .MinGW_compile.py:

#!/usr/local/bin/python
import sys
import socket
from subprocess import run

source_path = '/home/john/.wine/drive_c/SC64/ACS_Source/'
dest_path = '/home/john/zRamdisk/SierraData/'
win_path = 'Z:' + dest_path.replace('/', '\\')

f_name = sys.argv[1]
print(f"Compiling {f_name}.cpp")
# eliminate extra path elements if present
f_name = f_name if '/' not in f_name else f_name[-f_name[::-1].index('/'):]

# first release existing dll
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print(sock.sendto(f"RELEASE_DLL--{win_path}{f_name}.dll".encode(),
("127.0.0.1", 22903)), end=' ')

# compile to dll
run(f"/usr/bin/x86_64-w64-mingw32-g++ -march=x86-64 -mtune=x86-64 -O2 -shared " +
f"-static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions " +
f"-w {source_path}{f_name}.cpp " +
f"-o {dest_path}{f_name}_64.dll", shell=True)

# finally allow new dll to load
print(sock.sendto(f"ALLOW_LOAD_DLL--{win_path}{f_name}.dll".encode(),
("127.0.0.1", 22903)))

and the VS Code tasks.json becomes:

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build_DLL",
"type": "shell",
"command": "/home/john/.MinGW_compile.py",
"args": [
"${fileBasenameNoExtension}"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

And (thanks ganz) the .vimrc amendments are (I use ctrl m for compile):

nmap <C-m> :execute ':!~/.MinGW_compile.py %:r'<CR>

So now that I can compile with one key press I expect that'll remove my load from Sierra's Compile Server. :)


Note: sagi in the post above is just a zshrc alias for "yes | sudo apt-get install"
Date Time Of Last Edit: 2019-04-09 06:01:20
[2019-04-09 06:36:30]
ganz - Posts: 1048
Kiwi

very cool, as always, sir.

thank you for your time and scripts you've shared .

sagi
I was really scared by that unknown beast. :)
thnx.
[2021-02-12 23:53:47]
homestar - Posts: 21
If I am not mistaken, in the above code the
-static-libgcc
and
-static-libstdc++
flags are redundant given that
-static
is specified.

Thanks for sharing these ideas.
Date Time Of Last Edit: 2021-02-12 23:56:32
[2021-02-13 01:37:58]
ganz - Posts: 1048
homestar

Remote Build - Error SC version 1689 | Post: 141378
[2021-02-13 01:54:00]
homestar - Posts: 21
Very interesting. Thanks, ganz.

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

Login

Login Page - Create Account