coneill-math / m2r

Macaulay2 interface for R
5 stars 5 forks source link

Add support for Windows #24

Closed coneill-math closed 7 years ago

coneill-math commented 8 years ago

Code to update: Locating M2 path Launching M2 just before socket creation

coneill-math commented 7 years ago

@dkahle can you still look into this? I am not familiar with how M2 works on Windows.

coneill-math commented 7 years ago

Do we still want to do this for the first release? If it's too much work, I have no problem pushing it to a future version (unless, of course, CRAN won't accept it without complete cross-platform-ness).

dkahle commented 7 years ago

This is now very close, but I can't get M2 to run from DOS through Cygwin. Installing Cygwin and M2 through the instructions on their website is easy, and opening Cygwin and running M2 is just as easy. The problem I'm having is starting the M2 process from DOS.

cmd.exe /K C:/cygwin/bin/env.exe C:/cygwin/bin/M2.exe

I get the error that it can't find lapack DLL, which is actually in C:/cygwin/lib. Thoughts?

coneill-math commented 7 years ago

Is there a command line parameter to env.exe to specify library locations?

Also, how do you run M2 in Cygwin successfully?

dkahle commented 7 years ago

Hm, good question about env.exe. I'll check.

When you run Cygwin (even from DOS), it essentially opens a bash shell. From there, just open M2 with M2 and carry on.

coneill-math commented 7 years ago

That's what I thought. My guess is env.exe does some initialization when run from the command prompt, which is being bypassed when running a command directly.

At worst, we could handle the process a bit differently on Windows, essentially piping in the M2 code to STDIN for the command prompt. Avoiding this would be nice, but at least it would still work as expected, since once the M2 server is running everything functions normally.

dkahle commented 7 years ago

So I've got it running, but it crashes on startup. I think it'll just take tinkering. Do you have a Windows machine available?

sommars commented 7 years ago

I have a Windows machine I can test on.

dkahle commented 7 years ago

Ok, pull down and test on Windows. I've documented some comments in do_start_m2(). My recommendation is to create a new RStudio project on your Windows machine checking out the repo here, pull that down, load it, then try to run that function...

sommars commented 7 years ago

Gosh, I'm struggling just to get M2 to run on a Windows machine

dkahle commented 7 years ago

Just follow the directions explicitly. Use the 32-bit version, you should be fine. We can Skype later if need be. (Unfortunately, if you're struggling... that doesn't bode well for the average user.)

sommars commented 7 years ago

It's probably my fault. I've never used cygwin before.

coneill-math commented 7 years ago

Robert and I have tried several things with m2r on Windows. We have confirmed the following.

One possible (though clearly cheating) workaround: launch a telnet session to act as a "middle man" of sorts. I really dislike this solution, but we do what we have to, I guess.

coneill-math commented 7 years ago

Cygwin version is too difficult to support.

Windows support will be possible with the server, issue #107.