Babakak
Posts: 3
Joined: Thu Jan 15, 2015 4:47 pm

Use Wolfram language in an external program with low latency

Tue Jun 30, 2015 5:08 am

Hi
Im using Wolfram language on Pi B,and I want to compile a '.m' file (like "test.m" that contains Wolfram functions), in an external program like a C/C++ and then Export the output in an image file type.
I have made these efforts:
1-I used "wolfram -script test.m" to compile test.m and it worked but it was too slow for me.
2-I used Wolfram headers like (libML32i3.a ,libML32i3.so ,libML32i4.a ,libML32i4.so ,mathlink.h) and copied them in "/usr/include" directory then as what here said (WSTP Development in C) I compiled one of the C codes in MathLink for examples by "make", the problem was when I wanted to run any of those codes like "./factor" then I was asked for "Create link:" and then I typed something for example 'a' after that the program asked me "Integer to factor:" and when I typed the number the program couldn't display the output.(for example it takes 5 minutes but the program still doesn't have output).
3-I also used "mkfifo mmpipe","tail -f mmpipe | wolfram",and then "echo Export["test.gif", Plot[Sin[x], {x, 0, 10}]] > mmpipe" and wolfram displayed an error "Export::chtype: First argument test . gif is not a valid file specification."
so what should I do now.
Thanks.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Use Wolfram language in an external program with low lat

Tue Jun 30, 2015 6:30 am

Babakak wrote: 1-I used "wolfram -script test.m" to compile test.m and it worked but it was too slow for me . . .

so what should I do now.
Thanks.
Spend $35 and see if you like it any faster on the RPi 2B. One thing the Raspberry PI is NOT is fast; sorry, its just true... sad but true. On the other hand its credit card sized, does not get hot, has no moving parts, and only costs $35 dollars. If you want Wolfram to run fast... run it on a notebook.
marcus
:ugeek:

Return to “Wolfram Language”