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

any guidance how to make it work for windows? #20

Closed
antonkulaga opened this issue Sep 25, 2015 · 16 comments
Closed

any guidance how to make it work for windows? #20

antonkulaga opened this issue Sep 25, 2015 · 16 comments

Comments

@antonkulaga
Copy link

A friend of mine has to demostrate spectophotometer gui for windows but I am not sure what exactly I should do to make it work for windows. I can try to install windows32 to VM and try to build native libs inside VM but it will be very time consuming for me. Maybe you already have prebuild binaries for windows 32 and windows 64 to download/install?

@jodersky
Copy link
Owner

Unfortunately windows' "low-level" API is very different to Linux/Mac (so called POSIX). This makes it impossible to simply compile the existing source for Windows. Nevertheless, there are ways in which you should be able to get flow to work on windows, they however aren't "easy fixes" and require considerable time and skills in C development.

Here are two ways that I can think of:

  1. Port the native part of flow to windows. There is already a file flow-native/src/platform/windows/flow.c.disabled that contains interesting code for windows that uses serial ports. It is however only potential resource, not a draft or working implementation.
  2. Compile the existing library on Cygwin (Cygwin is basically POSIX for windows). This might even work out of the box!

Should you decide to build for windows please share your results, having flow on windows would be a very useful feature!

@jodersky
Copy link
Owner

Answering you got me intrigued with the cygwin way. I might have a solution coming really soon.

@xl0
Copy link

xl0 commented Sep 26, 2015

Hey,

tried with cygwin on 32-bit XP (in kvm). Seems to build fine, just had to pass LDFLAGS=-no-undefined to make. Anton should be able to test tomorrow (as I'm completely clueless about java).

@jodersky
Copy link
Owner

Cool! I just tried on windows 7 64 bit with cygwin, it also works fine just
needed to add another flag "-D __int64=int64_t" to the compiler.

Now I'll update autotools to add said settings and bundle cygwin dll with
the fat jar. A windows version should be ready soon
On Sep 26, 2015 3:56 AM, "Alexey Zaytsev" [email protected] wrote:

Hey,

tried with cygwin on 32-bit XP (in kvm). Seems to build fine, just had to
pass LDFLAGS=-no-undefined to make. Anton should be able to test tomorrow
(as I'm completely clueless about java).


Reply to this email directly or view it on GitHub
#20 (comment).

@jodersky
Copy link
Owner

A quick update
I managed to get everything compiled under cygwin and was able to load cygwin1.dll and the resulting cygflow.dll native libraries from the jvm. However I did not have a serial device close to test when I implemented the cygwin support.

Also, the current status is pretty dirty, the native loader and library initialization code has to be fixed.
All work is available under the wip-cygwin branch (see the diff 0cb2a4a). I won't have much time in the next days to get this implemented properly. Any help is welcome.

@antonkulaga
Copy link
Author

Any progress on this issue?

@jodersky
Copy link
Owner

Hey, the progress is still as it stands on the previous message. Personally, I don't have windows and I will not have time to look into it in the foreseeable future.
Anyone is welcome to take on the issue though.

@antonkulaga
Copy link
Author

@jodersky actually @xl0 needs a lot, but @xl0 is mostly C++ developer so he does not understand Scala (I can help a bit but the problem is I do not have free time and I do not understand how you work with native libs). If @xl0 will manage to compile native part for windows, will you put it to the default list of native libs?

@jodersky
Copy link
Owner

@xl0 is mostly C++ developer so he does not understand Scala

That's no problem at all, in fact knowing C or C++ is very useful for implementing a new backend for windows.
Also, you shouldn't need to change any scala code. The interface between the jvm and native code happens in the following two files:
NativeSerial.java and NativeSerial.h

To implement a new backend, essentially all that is required is to implement the functions defined in flow.h

If @xl0 will manage to compile native part for windows, will you put it to the default list of native libs?

yes, that would be awesome!

@xl0
Copy link

xl0 commented Oct 28, 2015

Hey,

unfortunately I won't have time to port the backend natively. It compiles with cygwin, and for us, this would be a viable solution.

@jodersky
Copy link
Owner

It compiles under cygwin so in theory it should work, however you will have
to launch flow through cygwin as well.

I can include a native binary for cygwin in an experimental release, if you
can confirm that it works I'll ship it in the main native jar
On Oct 28, 2015 6:29 AM, "Alexey Zaytsev" [email protected] wrote:

Hey,

unfortunately I won't have time to port the backend natively. It compiles
with cygwin, and for us, this would be a viable solution.


Reply to this email directly or view it on GitHub
#20 (comment).

@rjumko
Copy link

rjumko commented Dec 9, 2015

Hello. How can I get experimental release with native binary for cygwin?

@jodersky
Copy link
Owner

jodersky commented Dec 9, 2015

I never made one that worked. In flow 2.4 the library loading mechanism will be changed, making it possible to support a wider range of systems, including potentially windows.

What version of windows do you have? I can build something under Cygwin, windows 10, no guarantee about backwards-compatibility though

@rjumko
Copy link

rjumko commented Dec 10, 2015

I have 64 and 32-bit windows 10. And can check for both systems.

@dsutic
Copy link

dsutic commented Jan 11, 2016

+1 for windows version, I can check for windows 8.1

@jodersky
Copy link
Owner

Closing this as the build system has changed and no considerable progress has yet been made on the issue. Please see #32 for follow-up.

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

No branches or pull requests

5 participants