building standalone, with javascript, on windows, for mac

donundeen's icon

Hi all,
I've been working on building a standalone/collective/application that i can run on any computer with the runtime installed.
I do my work on a windows machine, and I'm trying to the standalone to run on a mac.

The standalone runs fine on my other windows machine, but when I try to run run it on a mac (5.1 runtime), I get the error:
"js: curve.function.js: Javascript ReferenceError: EjiesUtils is not defined."

I've tried including the various ejies files in the folder with my standalone and including it when I build the standalone, to no avail.

which suggests that I should be adding some javascript support files into the standalones support/ directory. Is that right?

However, the instructions say :
Macintosh Standalone Format:
To include Javascript components in your standalone application:
• Copy the file /Library/CFMSupport/JSRefThreadsafe.shlb to {Package}/Contents/MacOS/JSRefThreadsafe.shlb
• Copy the file /Library/Application Support/Cycling '74/jsextensions/ to {Package}/Contents/MacOS/support/jsextensions/

Of course, since I'm building this on windows, I don't have a JSRefThreadsafe.shlb file.
Is that something I need to obtain somehow and put in my folder? How can I get it?

Am I on the right track with this? I haven't seen any docs on building cross-platform standalones; is it possible?

Any help, or pointers to the relevant docs, would be greatly appreciated.

Thanks very much!

Don Undeen

Emmanuel Jourdan's icon

Make sure ejies are properly installed (especially the ejies-jsextensions.js, which should be in C74:/jsextensions). It should be copied automatically into {Package}/Contents/support/jsextensions. At least it works here on the mac.

donundeen's icon

thanks for the response Emmanuel.
I'm not sure what you mean by "installed." Installed on the machine running the runtime? or simply in a folder under my standalone, Contents/support/jsextensions.

What I've got is a usb thumbdrive, which has my mxf file (multiMrmrRouter.mxf )
I built that mxf file by opening the original .maxpat file, multimrmrRouter.max,
choosing File->Build Collective/Applictation, and clicking "build." I didn't include any extra file or folders in that step. But then in that same folder as the mxf file, I created a Contents/support folder, and added my entire jsextensions folder.

then I transer the usb thumbdrive to the mac laptop, which has only the runtime installed, and try to run multiMrmrRouter.mxf.

Then I open the max window, and I see:
js: ejies 2.0b1 (04/2008)
js: by Emmanuael Jourdan, Ircam [hey, that's you!]
js: curve.function.js: Javascript ReferenceError: EjiesUtils is not defined, line 17

is there any sort of mac-specific javascript support that needs to be added? I just think I'm introducing some complexity, by trying to build this on a windows machine, and run it on a mac.

thanks for your help!

Don Undeen

Emmanuel Jourdan's icon

I'm a little bit confused. If you are making a standalone on windows, it won't run on mac and vice versa. If you're making collectives, you need to install ejies on both machines. I'm not really sure what curve.function.js is though, maybe that's the original implementation of the curve from Martin?

donundeen's icon

hm, maybe I'm getting my terminology confused. I open my maxpat file, and do
"File->Build Collective/Application". Am I therefore building an "application" and how is that distinct from a "collective" or a "standalone".

I know that SOME of the "for runtime" apps I've built on windows have worked on mac. It's just this javascript thing.

How do I install ejies on a machine that just has the runtime?

I'll have to look this up, so I can use the right terminology.

Emmanuel Jourdan's icon

a collective requires Max or Max runtime to run. A standalone is an executable that is specific to each platform and does not require anything else to be installed.

The read me of ejies explains everything you need to know to install it ;-)

Hans Mittendorf's icon

Is there a way to have cross platform development at all? I am working on a Mac and would like to build a standalone for windows.

donundeen's icon

Hey Hans,
From what I understand of what Emmanuel is saying:
" If you are making a standalone on windows, it won't run on mac and vice versa."
a standalone is something that DOESN'T require the runtime.

From that, I'm inferring that you CAN do cross-platform development, if you DO use the runtime, and build a collective.

In other words, in your case, you build the maxpat on mac, build a "collective" (mxf file) on the mac, install the runtime on windows,, and run the mxf no windows.

This has worked for me for SOME patches I've built; I'm just having trouble with ejies (working on it). So there may be some caveats, but no one's told me yet that it's not possible.

Did I get that right? Can someone clarify this for me?

thanks!

Emmanuel Jourdan's icon

collective are cross platform (there might be some slightly adjustments if you use third party externals or something like that), standalone needs to be compiled on each platform. So just install the ejies properly on the machine, and the collective will work (the jsextension files used in ejies can't be included in the collective).