Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mathlink macos wolfram engine #47

Merged
merged 2 commits into from Jun 2, 2021
Merged

Conversation

fgerick
Copy link
Contributor

@fgerick fgerick commented Feb 5, 2021

This took me a while to find when using the free Wolfram Engine. With Mathematica this is automatically linked, so no problem.

This took me a while to find when using the free Wolfram Engine. With Mathematica this is automatically linked, so no problem.
@simonbyrne
Copy link
Member

This should work already. I don't have Wolfram Engine installed, but can you check the logic used here:

# Wolfram Engine
for path in readlines(`mdfind "kMDItemCFBundleIdentifier == 'com.wolfram.engine'"`)
# kernels are located in sub-application
subpath = joinpath(path, "Contents/Resources/Wolfram Player.app")
lib = joinpath(subpath,"Contents/Frameworks/mathlink.framework/mathlink")
ker = joinpath(subpath,"Contents/MacOS/MathKernel")
if isfile(lib) && isfile(ker)
return lib, ker
end
end

@fgerick
Copy link
Contributor Author

fgerick commented Feb 8, 2021

without setting any environment variables I get this :

(@v1.6) pkg> build MathLink
    Building MathLink  `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/456465e96317c706dc2e782f441bff3053ff843e/build.log`
ERROR: Error building `MathLink`:
ERROR: LoadError: Could not find Mathematica or Wolfram Engine installation.
Please set the `JULIA_MATHLINK` and `JULIA_MATHKERNEL` variables.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] find_lib_ker()
   @ Main ~/.julia/packages/MathLink/f5mIR/deps/build.jl:85
 [3] top-level scope
   @ ~/.julia/packages/MathLink/f5mIR/deps/build.jl:88
 [4] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [5] top-level scope
   @ none:5
in expression starting at /Users/felixger/.julia/packages/MathLink/f5mIR/deps/build.jl:88

because

julia> readlines(`mdfind "kMDItemCFBundleIdentifier == 'com.wolfram.engine'"`)
String[]

did I miss something during the installation of the Wolfram Engine? which wolframscript gives /usr/local/bin/wolframscript, which is a softlink /usr/local/bin/wolframscript -> /Applications/WolframScript.app/Contents/MacOS/wolframscript

@simonbyrne
Copy link
Member

what does this give?

readlines(`mdfind "kMDItemCFBundleIdentifier == 'com.wolfram.*'"`)

@fgerick
Copy link
Contributor Author

fgerick commented May 2, 2021

julia> readlines(`mdfind "kMDItemCFBundleIdentifier == 'com.wolfram.*'"`)
3-element Vector{String}:
 "/Applications/Wolfram Player.app"
 "/Applications/Wolfram Engine.app"
 "/Applications/WolframScript.app"

@simonbyrne simonbyrne merged commit 36ae110 into JuliaInterop:master Jun 2, 2021
@simonbyrne
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants