Git Product home page Git Product logo

matdaemon.jl's People

Contributors

github-actions[bot] avatar jondeuce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

erasdna

matdaemon.jl's Issues

Extra "shutdown" parameter on JLCallOptions not compatible with published version v0.1.1

Hi I was trying this package out and got into an error of an shutdown being an unrecognized parameter.

I think that the jlcall.m script is out of sync with the published MATDaemon.jl v0.1.1

Reproduction steps:

  1. Download jlcall.m into your machine
  2. load into Matlab
  3. run the simplest command
>> jlcall('')
* Installing MATDaemon...

wait and get an error

>> jlcall('','debug',true)
ERROR: LoadError: MethodError: no method matching MATDaemon.JLCallOptions(; shared=true, threads=24, setup="", debug=true, gc=true, workspace=".../MATDaemon.jl/api/.jlcall", outfile="/tmp/tp12710840444099472.mat", cwd="..../MATDaemon.jl", project="", infile="/tmp/tp12710840441051096.mat", f="(args...; kwargs...) -> nothing", shutdown=false, port=3000.0, nofun=false, modules=Any[], runtime="/home/.../.juliaup/bin/julia", server=true, restart=false)
Stacktrace:
 [1] kwerr at ./error.jl:163
 [2] load_options at /home/.../.julia/packages/MATDaemon/2Z92q/src/MATDaemon.jl:134
 [3] top-level scope at /home/.../.julia/packages/MATDaemon/2Z92q/api/jlcall.jl:11
 [4] include at ./client.jl:451
 [5] top-level scope at /home/...../MATDaemon.jl/api/.jlcall/tmp/0006_mat_tp12710840815091344.jl:5
 [6] eval at ./boot.jl:373

* Sending `DaemonMode.runfile` script to Julia server (status = 0):
*   /home/.../.juliaup/bin/julia --project=/home/..../MATDaemon.jl/api/.jlcall --threads=auto --startup-file=no --optimize=0 --compile=min /home/..../MATDaemon.jl/api/.jlcall/tmp/0007_mat_tp12710840821855416.jl

Error using jlcall>call_julia (line 417)
Julia call failed to produce the expected output file:
/tmp/tp12710840444099472.mat

Error in jlcall (line 245)
    varargout = call_julia(f_args, opts);

Temporary fix: install latest MATDaemon.jl from github

Look into the folder where jlcall.m was downloaded, there should be a new .jlcall folder with the Project.toml file.

>julia --project='[somepath]/.jlcall'
>]
(.jlcall) pkg> add https://github.com/jondeuce/MATDaemon.jl.git
    Cloning git-repo `https://github.com/jondeuce/MATDaemon.jl.git`
    Updating git-repo `https://github.com/jondeuce/MATDaemon.jl.git`
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...
    Updating `~/...../.jlcall/Project.toml`
  [88578114] ~ MATDaemon v0.1.1 ⇒ v0.1.1 `https://github.com/jondeuce/MATDaemon.jl.git#master`
    Updating `~/...../.jlcall/Manifest.toml`
  [88578114] ~ MATDaemon v0.1.1 ⇒ v0.1.1 `https://github.com/jondeuce/MATDaemon.jl.git#master`
Precompiling project...
  1 dependency successfully precompiled in 1 seconds (22 already precompiled)

Restart Matlab and try again.

By the way, thanks for the package!!
Now that I managed to make it run expect some more comments on the way.

zsh:1: command not found: julia [Mac]

I put jcall.m into a folder, opened it, and ran

jlcall('sort', {rand(2,5)}, struct('dims', int64(2)))

Immediately, it returns zsh:1: command not found: julia. This is confusing since which julia in the terminal returns /opt/homebrew/bin/julia. This appears to be related to a general issue with MATLAB with respect to calling system commands.

What worked for me was replacing the function try_find_julia_runtime() with the following

function runtime = try_find_julia_runtime()
    setenv('PATH','/opt/homebrew/bin')
    runtime = 'julia';
end

Obviously that's not a very generic solution but I'm not really a MATLAB expert.

error getting matdaemon to call Julia

I get an error when trying to run the example jlcall('sort', {rand(2,5)}, struct('dims', int64(2))) function from the readme. I have tried adding Julia to the PATH in multiple ways (along with @pdetrempe), including creating an alias and I still get a status = 127 error when using jlcall > try_run

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Segmentation fault

I'm running julia version 1.10.0 on fedora core 38. After running the example code

>> jlcall('sort', {rand(2,5)}, struct('dims', int64(2)))

I obtain the following

Installing MATDaemon environment...
/home/maikel/.juliaup/bin/julia --project=/home/maikel/Documents/Papers/PNDDE/Demos/.jlcall --threads=auto --startup-f
ile=no --quiet --optimize=3 /home/maikel/Documents/Papers/PNDDE/Demos/.jlcall/tmp/0000_mat_tp4e940703_653a_4fbd_a470_1
1efb95cb486.jl: Segmentation fault

cannot get local project working

After the installation in Matlab with the jlcall.m script built in julia function calls and installed package calls are working. However calling my own functions inside a julia projects always yields a cryptic error message. For the moment I am trying this with the TestProject from the repository which is lied inside the current matlab directory together with the jlcall file.
The following Matlab code is used to call a function from the julia project:

jlcall('TestProject.dot','project', 'C:\Users\<Username>\Documents\MATLAB\TestProject','modules', {'TestProject'},'restart',true,'debug',false)

Within the Test Project the only change is the exclusion of StaticArrays:

module TestProject
#using StaticArrays

function dot(x)
    return 3+x
end

end # module

When activating and executing the project from the julia terminal everything works as expected.

However calling it from the Matlab script yields the following error message:

�[31m�[1mERROR: �[97;22mLoadError:�[31;22m IOError: could not spawn setenv(`'C:\Users\<Username>\AppData\Local\Programs\Julia-1.9.2\libexec\julia\7z.exe' x 'C:\Users\<Username>\.julia\registries\General.tar.gz' -so`,["WINDIR=C:\\Windows", "PATH=C:\\Users\\<Username>\\AppData\\Local\\Programs\\Julia-1.9.2\\bin\\..\\lib\\julia;C:\\Users\\<Username>\\AppData\\Local\\Programs\\Julia-1.9.2\\bin\\..\\lib;C:\\Program Files\\MATLAB\\R2023a\\bin\\win64;C:\\Program Files\\Python39\\Scripts\\;C:\\Program Files\\Python39\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\MATLAB\\R2023a\\bin;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\<Username>\\AppData\\Local\\Programs\\Git\\cmd;C:\\Users\\<Username>\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\;C:\\Users\\<Username>\\AppData\\Local\\Programs\\Julia-1.9.2\\bin", "USERDOMAIN_ROAMINGPROFILE=---", "ZES_ENABLE_SYSMAN=1", "LOCALAPPDATA=C:\\Users\\<Username>\\AppData\\Local", "HOMEPATH=\\Users\\<Username>", "PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 141 Stepping 1, GenuineIntel", "NUMBER_OF_PROCESSORS=16", "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW", "SESSIONNAME=Console", "SYSTEMROOT=C:\\Windows", "APPDATA=C:\\Users\\<Username>\\AppData\\Roaming", "=::=::\\", "PSMODULEPATH=C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules", "COMMONPROGRAMW6432=C:\\Program Files\\Common Files", "PROGRAMDATA=C:\\ProgramData", "PROMPT=\$P\$G", "PUBLIC=C:\\Users\\Public", "USERDOMAIN=---", "OS=Windows_NT", "PROCESSOR_REVISION=8d01", "ICU_TIMEZONE_FILES_DIR=C:\\Program Files\\MATLAB\\R2023a/bin/icutzdata", "TMP=C:\\Users\\<Username>\\AppData\\Local\\Temp", "COMMONPROGRAMFILES(X86)=C:\\Program Files (x86)\\Common Files", "COMSPEC=C:\\Windows\\system32\\cmd.exe", "KMP_HANDLE_SIGNALS=0", "OPENBLAS_DEFAULT_NUM_THREADS=1", "KMP_BLOCKTIME=1", "ALLUSERSPROFILE=C:\\ProgramData", "COMMONPROGRAMFILES=C:\\Program Files\\Common Files", "COMPUTERNAME=DPC0137", "MATDAEMON_WORKSPACE=C:\\Users\\<Username>\\Documents\\MATLAB\\.jlcall", "ONEDRIVE=C:\\Users\\<Username>\\OneDrive", "MATLAB_ARCH=win64", "USERNAME=<Username>", "PROGRAMFILES(X86)=C:\\Program Files (x86)", "PROGRAMFILES=C:\\Program Files", "KMP_STACKSIZE=512k", "LOGONSERVER=\\\\DEVDC1", "USERPROFILE=C:\\Users\\<Username>", "DRIVERDATA=C:\\Windows\\System32\\Drivers\\DriverData", "FPS_BROWSER_USER_PROFILE_STRING=Default", "PROCESSOR_LEVEL=6", "SYSTEMDRIVE=C:", "USERDNSDOMAIN=---.LOCAL", "=C:=C:\\Users\\<Username>\\Documents\\MATLAB", "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer", "__KMP_REGISTERED_LIB_3764=00007FFD87C44D04-cafe2ab4-libiomp5md.dll", "PROGRAMW6432=C:\\Program Files", "TEMP=C:\\Users\\<Username>\\AppData\\Local\\Temp", "HOMEDRIVE=C:", "OPENBLAS_MAIN_FREE=1", "PROCESSOR_ARCHITECTURE=AMD64", "QT_QPA_PLATFORM=windows:fontengine=freetype"]): operation not supported on socket (ENOTSUP)�[0m
Stacktrace:
 [1] �[1m_spawn_primitive�[0m at �[1m.\process.jl:128�[0m
 [2] �[1m#760�[0m at �[1m.\process.jl:139�[0m
 [3] �[1msetup_stdios�[0m at �[1m.\process.jl:223�[0m
 [4] �[1m_spawn�[0m at �[1m.\process.jl:138�[0m
 [5] �[1m#open#769�[0m at �[1m.\process.jl:393�[0m
 [6] �[1mopen�[0m at �[1m.\process.jl:383�[0m
 [7] �[1m#open#770�[0m at �[1m.\process.jl:415�[0m
 [8] �[1mopen�[0m at �[1m.\process.jl:414�[0m
 [9] �[1muncompress_registry�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\Registry\registry_instance.jl:256�[0m
 [10] �[1mRegistryInstance�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\Registry\registry_instance.jl:323�[0m
 [11] �[1m#reachable_registries#25�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\Registry\registry_instance.jl:429�[0m
 [12] �[1mreachable_registries�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\Registry\registry_instance.jl:399�[0m
 [13] �[1mContext�[0m at �[1m.\util.jl:567�[0m
 [14] �[1m_activate_dep�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\API.jl:1799�[0m [15] �[1m#activate#296�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\API.jl:1822�[0m
 [16] �[1mactivate�[0m at �[1mC:\workdir\usr\share\julia\stdlib\v1.9\Pkg\src\API.jl:1812�[0m
 [17] �[1minit_environment�[0m at �[1mC:\Users\<Username>\.julia\packages\MATDaemon\UjPSQ\src\MATDaemon.jl:179�[0m
 [18] �[1mtop-level scope�[0m at �[1mC:\Users\<Username>\.julia\packages\MATDaemon\UjPSQ\api\jlcall.jl:14�[0m
 [19] �[1minclude�[0m at �[1m.\client.jl:478�[0m
 [20] �[1mtop-level scope�[0m at �[1mC:\Users\<Username>\Documents\MATLAB\.jlcall\tmp\0093_mat_tpa1669f30_3f4b_4d54_aa57_871144592938.jl:5�[0m
 [21] �[1meval�[0m at �[1m.\boot.jl:370�[0m

How do I install this?

I'll see if doing pkg> add MATDaemon from Julia works, but it would be great if the readme explicitly said that this would install the necessary Matlab files and add them to Matlab's path.

Running with project not working on latest version

Hi there,

Since updating from here to the latest version, I'm now getting a breaking error when running with 0 arguments:

jlcall('', ...
        'restart', true,...
        'project', matlab_wrappers_dir, ...               % activate a local Julia Project
        'setup', which('setup.jl'), ...                                      % run a setup script to load some custom Julia code        
        'modules', {'LinearAlgebra', 'MATLABGuidanceWrappers', 'StaticArrays'}, ...  % load a custom module and some modules from Base Julia
        'threads', 'auto', ... % use the default number of Julia threads
        'debug', true,...
        'server', false)

Output error message from the julia script here:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.