rsmenon/MATLink

MacOS linking failure

enitsw opened this issue · 8 comments

Mathematica 10.3.1.0
MATLAB R2016a
MacOS 10.11.3
MacBook Pro (15-inch, Mid 2012)

Received the response below when I executed MATLink. MATLAB and Mathematica are located in /Applications (default installations). Any ideas?

Thanks,
Bill

In[2]:= Needs["MATLink`"]

During evaluation of In[2]:= Get::noopen: Cannot open MATLink`. >>

During evaluation of In[2]:= Needs::nocont: Context MATLink` was not created when Needs was evaluated. >>

Out[2]= $Failed

Get::noopen means that the problem is not with the package itself, but the package is simply not installed (correctly).

You must place the MATLink directory within the directory opened by

SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]

as described in the installation instructions: http://matlink.org/ (click "Download MATLink" under Installation).

If the package is correctly installed, then FindFile["MATLink"]` will return

"/Users/YouUsername/Library/Mathematica/Applications/MATLink/Kernel/init.m"

I get the response below, so my installation must not be correct. However, I have moved the MATLink folder to the Mathematica library, as described, and the SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications”}] opens that folder. The MATLink folder appears as an alias, which should not be a problem. Any further ideas?

Thanks for your help,

Bill

In[1]:= FindFile["MATLink`"]

Out[1]= $Failed

On 8 Mar 2016, at 11:50, Szabolcs Horvát <notifications@github.commailto:notifications@github.com> wrote:

If the package is correctly installed, then FindFile["MATLink`"] will return

"/Users/YouUsername/Library/Mathematica/Applications/MATLink/Kernel/init.m"


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rsmenon_MATLink_issues_88-23issuecomment-2D193860402&d=CwMCaQ&c=c6MrceVCY5m5A_KAUkrdoA&r=1oAgd16xYHyLgFABsvPha9wGgxRMopW841HfjPpujoo&m=cBZ-4cdBgAKSCkL28sChWinIefD85G11nVeoLTmLySY&s=UIE57oBkNccyfi04SNlGOQENVs0Z5fKV5ZgGCT9EY1g&e=.

Wm Wren Stine
Chair, Department of Psychology
Program in Neuroscience & Behavior
McConnell Hall
University of New Hampshire
Durham, NH 03824
USA

+01 (603) 862-2823
bill.stine@unh.edumailto:bill.stine@unh.edu
TTY: 7-1-1 or +01 (800) 735-2964 (Relay NH)

Please quit Mathematica, delete any instances of MATLink in this folder: SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications”}] and then try running this in a new session:

With[{
        url = "http://download.matlink.org/MATLink.zip", 
        file = FileNameJoin[{$UserBaseDirectory, "Applications",  "MATLink.zip"}]
    }, 
    URLSave[url, file];
    RunProcess[{"unzip", file}, ProcessDirectory -> DirectoryName@file]
 ]

Now if you do `<<MATLink``, you shouldn't have any import issues. Please let us know if this worked.

It worked like a charm.

Thank you again,

Bill

On 8 Mar 2016, at 12:19, rsmenon <notifications@github.commailto:notifications@github.com> wrote:

Please quit Mathematica, delete any instances of MATLink in this folder: SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications”}] and then try running this:

With[{
url = "http://download.matlink.org/MATLink.zip",
file = FileNameJoin[{$UserBaseDirectory, "Applications", "MATLink.zip"}]
},
URLSave[url, file];
RunProcess[{"unzip", file}, ProcessDirectory -> DirectoryName@file]
]

Now if you do <<MATLink ``, you shouldn't have any import issues.


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rsmenon_MATLink_issues_88-23issuecomment-2D193875796&d=CwMFaQ&c=c6MrceVCY5m5A_KAUkrdoA&r=1oAgd16xYHyLgFABsvPha9wGgxRMopW841HfjPpujoo&m=ngKHpgIdxzEZTbwtHmkdr6_xh_fDaCpv8Y7CPSko8sY&s=W15dp1K8sDT98Iy_ii-wjXERrKQ96S11Ae_TO8K-q3U&e=.

Wm Wren Stine
Chair, Department of Psychology
Program in Neuroscience & Behavior
McConnell Hall
University of New Hampshire
Durham, NH 03824
USA

+01 (603) 862-2823
bill.stine@unh.edumailto:bill.stine@unh.edu
TTY: 7-1-1 or +01 (800) 735-2964 (Relay NH)

Great! 👍

I think the problem was that it appeared as an alias. I'm not exactly sure how aliases work on OS X, but they seem to be treated equivalently to the file they reference only by the Finder. Other programs (without special support for this) see the alias as an entirely different file, and do not recognize that it is meant to be a reference. This is the case for the Mathematica kernel too. What may be a bit confusing is that the Mathematica front end does recognize them as an alias and follows the reference. But not the kernel.

Very interesting. I will keep that in mind,

Bill

On 8 Mar 2016, at 13:38, Szabolcs Horvát <notifications@github.commailto:notifications@github.com> wrote:

I think the problem was that it appeared as an alias. I'm not exactly sure how aliases work on OS X, but they seem to be treated equivalently to the file they reference only by the Finder. Other programs (without special support for this) see the alias as an entirely different file, and do not recognize that it is meant to be a reference. This is the case for the Mathematica kernel too. What may be a bit confusing is that the Mathematica front end does recognize them as an alias and follows the reference. But not the kernel.


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rsmenon_MATLink_issues_88-23issuecomment-2D193907341&d=CwMCaQ&c=c6MrceVCY5m5A_KAUkrdoA&r=1oAgd16xYHyLgFABsvPha9wGgxRMopW841HfjPpujoo&m=SYQjOi2_oOHjm-2vuAz-hcrg3mfjt6VMJb4_IGqTbDQ&s=hGtfmBx86rC5BSbI9YnI1rqHECunxq-D-vvZT5z5J1E&e=.

Wm Wren Stine
Chair, Department of Psychology
Program in Neuroscience & Behavior
McConnell Hall
University of New Hampshire
Durham, NH 03824
USA

+01 (603) 862-2823
bill.stine@unh.edumailto:bill.stine@unh.edu
TTY: 7-1-1 or +01 (800) 735-2964 (Relay NH)