Using MATLAB (Windows) generated Java package in Linux -


as far know, can run .mex files on linux generated on windows installing matlab runtime on linux (correct me if wrong). if want use matlab generated java package, generated on windows, on linux (like ubuntu)?

objective:

i have test feature uses audio processing. if test successful, buy products need. @ moment have requested license on windows, since requested license have machine specific limitation, able generate test java code on windows machine, application deployed on android, learnt google needs matlab runtime run or compiler use converted/generated code. android system has no mcr or simple matlab runtime installation support, moved solution.

use linux host servlet takes input android, processing return answer in terms of json or text. java package generated using windows machine, , lost.

from knowledge code-convert-servlet-deploy-once approach cost effective matlab production server, since have buy license once specific products. remember licensing phase after test if approach giving desired results.

specs:

  • windows 10

  • matlab 2016a (trial)

  • matlab products (compiler/sdk, signal processing/audio processing toolbox)

  • package made using jdk 1.7.x (exactly matching matlab jdk/jre version on windows)

  • ubuntu 16 desktop (with oracle jdk 8_101 installed, matlab runtime installed, can work jdk 7.x (same matlab used on windows when generating package))

questions:

  • how can use java package in linux when create java program?

  • what software + licenses needed make possible?

  • should install matlab on linux machine, generate java package on linux machine , use package in java program on same linux machine? ( think need request license again )

  • are there other methods? missing something?

java packages generated matlab compiler sdk in general cross-platform - however, may call mex files, or other libraries, platform-specific, , if java package whole end being platform-specific.

you aren't entirely clear whether you're calling mex files or not; , may calling platform-specific libraries without realising (for example, signal processing toolbox might call out library of operations).

in addition, comment being "able run mex files on linux generated on windows installing matlab runtime on linux" confused - mex files not cross-platform, , don't use matlab runtime @ all.

so respect platforms - may able use java package generated on windows on linux, long doesn't call windows-specific mex files or libraries. if generate on linux, can rule issue out, easier if use same platform compilation , execution. should easy reassign matlab license linux machine that.

am missing something?

yes: way you're proposing things unlikely scale well. if have java servlet on linux server along java package generated matlab compiler sdk, whenever make call servlet make call java package, start matlab compiler runtime (mcr), run matlab code, return answer servlet, , shut down mcr.

the mcr takes quite long time start (nearly long matlab). each call take rather long time, due mcr startup times.

so can around creating sort of utility tool start mcr , keep there, , pass through requests , return answers servlet.

but you've got 1 mcr - happens if multiple requests @ once? they'll queued (or dropped) , won't scale. you'll need improve utility tool, manages pool of mcrs , passes requests through free one, load-balancing them goes.

but happens if mcr crashes, or runs ouot of memory? utility tool need monitor possibility, , restart crashed ones.

and you'll need stuff enable administer stuff conveniently.

once you've done (which hard), you'll realise have pretty written matlab production server. know it's expensive, might take @ before committing solution you're considering.


Comments