Windows cross compilation

classic Classic list List threaded Threaded
53 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
If there is a known path to compile OpenSCAD to run under Cygwin, I would be very interested.  More specifically, I mean compiled and linked with the cygwin1.dll using the X11 and POSIX file i/o.

Why? because it is much easier to do build scripting under Unix-like environments. I currently make use of the cross-compiled Windows binary, but it is not  deal with file permission very robustly.
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

kintel
Administrator

> On Mar 4, 2017, at 18:14, royasutton <[hidden email]> wrote:
>
> If there is a known path to compile OpenSCAD to run under Cygwin, I would be
> very interested.  More specifically, I mean compiled and linked with the
> cygwin1.dll using the X11 and POSIX file i/o.
>
I don’t know if anyone has attempted that. Most people wanting smth. like this tend to simply just do it under Linux :)

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
At some point a user will want a system-level design approach and suitable design flow. Although I prefer Unix-based platforms for development,  I have no issue with others who, for whatever reason, are using a Windows-based platform. Cygwin allows those users to leverage the mature tool chains of Unix-based platforms. It sounds like a good fit to me...
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

nophead
Does anybody know how to make the .exe built under Cygwin statically link like the official Windows binary? It seems odd to me that the MSYS2 version doesn't build the same result as the cross compiled version. Is it because the MSYS2 packages are dynamically linked?

On 5 March 2017 at 09:32, royasutton <[hidden email]> wrote:
At some point a user will want a system-level design approach and suitable
design flow. Although I prefer Unix-based platforms for development,  I have
no issue with others who, for whatever reason, are using a Windows-based
platform. Cygwin allows those users to leverage the mature tool chains of
Unix-based platforms. It sounds like a good fit to me...



--
View this message in context: http://forum.openscad.org/Windows-cross-compilation-tp20413p20761.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

tp3
On 03/05/2017 10:49 AM, nop head wrote:
> Does anybody know how to make the .exe built under Cygwin statically
> link like the official Windows binary? It seems odd to me that the
> MSYS2 version doesn't build the same result as the cross compiled
> version. Is it because the MSYS2 packages are dynamically linked?
>
MSYS2 pretty much replicates a Unix shell environment so the build
mostly does similar setup as on a Linux system and uses the dynamic
libraries provided by the "Distribution" (= MSYS2).
All that minus some glitches in the OpenSCAD build system caused
by the overlap of both MXE and MSYS2 using MinGW.

Don put a lot of effort into the MXE setup which can support
compiling static libraries when selected. This works as MXE
is more a build environment and not a binary distribution of
applications to run.

> I am building OpenScad on Win7 using the instructions here:
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Microsoft_Windows.
> The resulting .exe runs on Windows via the MSYS2 shell but I
> can't get it to run directly from Windows. So I am not sure
> if it is a real Window's build or not.
>
That's probably due to all the internal path references and such
stuff. Otherwise MinGW should generate a native binary without
any references to a runtime Unix environment like cygwin.

I'm not sure there's a simple way to package the MinGW binary
to run fully standalone.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

buttim
Really glad to see so many people interested by this issue. Anybody volunteering to check if he/she finds the same problems while cross compiling?

Il 05/mar/2017 11:29, "tp3 [via OpenSCAD]" <[hidden email]> ha scritto:
On 03/05/2017 10:49 AM, nop head wrote:
> Does anybody know how to make the .exe built under Cygwin statically
> link like the official Windows binary? It seems odd to me that the
> MSYS2 version doesn't build the same result as the cross compiled
> version. Is it because the MSYS2 packages are dynamically linked?
>
MSYS2 pretty much replicates a Unix shell environment so the build
mostly does similar setup as on a Linux system and uses the dynamic
libraries provided by the "Distribution" (= MSYS2).
All that minus some glitches in the OpenSCAD build system caused
by the overlap of both MXE and MSYS2 using MinGW.

Don put a lot of effort into the MXE setup which can support
compiling static libraries when selected. This works as MXE
is more a build environment and not a binary distribution of
applications to run.

> I am building OpenScad on Win7 using the instructions here:
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Microsoft_Windows.
> The resulting .exe runs on Windows via the MSYS2 shell but I
> can't get it to run directly from Windows. So I am not sure
> if it is a real Window's build or not.
>
That's probably due to all the internal path references and such
stuff. Otherwise MinGW should generate a native binary without
any references to a runtime Unix environment like cygwin.

I'm not sure there's a simple way to package the MinGW binary
to run fully standalone.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten



If you reply to this email, your message will be added to the discussion below:
http://forum.openscad.org/Windows-cross-compilation-tp20413p20763.html
To unsubscribe from Windows cross compilation, click here.
NAML
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

tp3
In reply to this post by royasutton
On 03/05/2017 10:32 AM, royasutton wrote:
> At some point a user will want a system-level design approach and suitable
> design flow. Although I prefer Unix-based platforms for development,  I have
> no issue with others who, for whatever reason, are using a Windows-based
> platform. Cygwin allows those users to leverage the mature tool chains of
> Unix-based platforms. It sounds like a good fit to me...
>
MSYS2 provides all that without the extra runtime emulation layer.
I don't see how that matters much to the user. The only benefit
seems to be at development time as it might be possible to take
Unix code and compile without specific Windows support where MinGW
needs some kind of Windows support in the application itself.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
>> At some point a user will want a system-level design approach and suitable
>> design flow. Although I prefer Unix-based platforms for development,  I have
 
> MSYS2 provides all that without the extra runtime emulation layer.
> I don't see how that matters much to the user. The only benefit
> seems to be at development time as it might be possible to take
> Unix code and compile without specific Windows support where MinGW
> needs some kind of Windows support in the application itself.

The system-level design referred to is regarding using OpenSCAD, not compiling it... IE: now that one has an OpenSCAD executable how to use it as a tool in a design flow on collections of *.scad design files.

...not complaining about the existing windows compilation solution... and kudos to any and all who contributed to that effort! Just checking if anyone had worked on a Cygwin compile as it sounded like someone had.

Cheers,
Roy
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
In reply to this post by nophead
> Does anybody know how to make the .exe built under Cygwin statically link
> like the official Windows binary? It seems odd to me that the MSYS2 version

I am no Cygwin expert, but from what I understand, it is not possible to do so. It appears to be an intentional limitation by design.



tp3
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

tp3
In reply to this post by royasutton
On 03/05/2017 12:25 PM, royasutton wrote:
> The system-level design referred to is regarding *using* OpenSCAD,
> not compiling it... IE: now that one has an OpenSCAD executable
> how to use it as a tool in a design flow on collections of *.scad
> design files.
>
That was my point about. I don't see how it matters to the user
which libraries or compilation environments the OpenSCAD binary
was compiled from.

I'm not aware of any Cygwin work being done, and actually I don't
see much reason for this. It's likely to be a huge effort and
will also require someone who is really committed to also maintain
it in the future.
It might be easier trying to compile and package the MSYS2 binary
so it can run without MSYS2 installed (if that's possible, but I
think it should be).

What might be useful and was worked on by different people in the
past is a Visual Studio based build. That's also not a simple task,
mainly due to the libraries that need to be build and setup.
It's basically a chicken and egg issue.
The MSYS2 build is mainly a workaround to at least be able to
provide a solution for someone who wants to build directly on
Windows.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

nophead
>Just checking if anyone had worked on a Cygwin compile as it sounded like someone had.

I am confused what  you are asking here. MSYS2 builds a Windows .exe in a Cygwin shell running on Windows and the resulting .exe runs from that Cygwin shell. It doesn't run from a DOS shell, or from Explorer because it depends on DLLs in the MSYS2 path, that aren't in the Windows path. Presumably adding mingw64/bin to the Windows path would make it work.

I don't think it uses the Posix API and the Cygwin Linux emulation layer though. But why would that matter to "using it as a tool in a design flow on collections of *.scad design files"? OpenSCAD has a command line interface on all platforms.

On 5 March 2017 at 11:53, Torsten Paul <[hidden email]> wrote:
On 03/05/2017 12:25 PM, royasutton wrote:
> The system-level design referred to is regarding *using* OpenSCAD,
> not compiling it... IE: now that one has an OpenSCAD executable
> how to use it as a tool in a design flow on collections of *.scad
> design files.
>
That was my point about. I don't see how it matters to the user
which libraries or compilation environments the OpenSCAD binary
was compiled from.

I'm not aware of any Cygwin work being done, and actually I don't
see much reason for this. It's likely to be a huge effort and
will also require someone who is really committed to also maintain
it in the future.
It might be easier trying to compile and package the MSYS2 binary
so it can run without MSYS2 installed (if that's possible, but I
think it should be).

What might be useful and was worked on by different people in the
past is a Visual Studio based build. That's also not a simple task,
mainly due to the libraries that need to be build and setup.
It's basically a chicken and egg issue.
The MSYS2 build is mainly a workaround to at least be able to
provide a solution for someone who wants to build directly on
Windows.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
> I am confused what  you are asking here. MSYS2 builds a Windows .exe in a
> Cygwin shell running on Windows and the resulting .exe runs from that

I was just asking had anyone worked on a Cygwin compile...

> I don't think it uses the Posix API and the Cygwin Linux emulation layer
> though. But why would that matter to "using it as a tool in a design flow
> on collections of *.scad design files"? OpenSCAD has a command line
> interface on all platforms.

Applications compiled for Cygwin make attempts to honor file permissions when running under Cygwin. It is not perfect, but it is usable. When a design flow brings together multiple tools that communicated via the file system. File permissions can be important.

Maybe a good question is if there is a way to compile OpenSCAD using MSYS2 etal to create files with emulated POSIX file permissions?

Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

nophead
I don't know but in my experience native Windows programs work better on Windows than Unix programs made to run with Cygwin.

On 5 March 2017 at 16:47, royasutton <[hidden email]> wrote:
> I am confused what  you are asking here. MSYS2 builds a Windows .exe in a
> Cygwin shell running on Windows and the resulting .exe runs from that

I was just asking had anyone worked on a Cygwin compile...

> I don't think it uses the Posix API and the Cygwin Linux emulation layer
> though. But why would that matter to "using it as a tool in a design flow
> on collections of *.scad design files"? OpenSCAD has a command line
> interface on all platforms.

Applications compiled for Cygwin make attempts to honor  file permissions
<https://cygwin.com/cygwin-ug-net/using-filemodes.html>   when running under
Cygwin. It is not perfect, but it is usable. When a design flow brings
together multiple tools that communicated via the file system. File
permissions can be important.

Maybe a good question is if there is a way to compile OpenSCAD using MSYS2
etal to create files with emulated POSIX file permissions?





--
View this message in context: http://forum.openscad.org/Windows-cross-compilation-tp20413p20772.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

royasutton
> I don't know but in my experience native Windows programs work better on
> Windows than Unix programs made to run with Cygwin.

Agreed. Not having to deal with multiple/hybrid platforms simplifies things greatly. And maybe someday all of the applications that are useful for putting together design flows will be available natively under Windows.  Until then, there will be hybrid development environments like Cygwin, etc. for Windows... for better or worse...

Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

buttim
In reply to this post by tp3
Some problems in the checkout phase:

> git checkout editor-enhancements master

error: pathspec 'editor-enhancements' did not match any file(s) known to git.
error: pathspec 'master' did not match any file(s) known to git.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

tp3
On 03/06/2017 06:10 PM, buttim wrote:
> Some problems in the checkout phase:
>
>> git checkout editor-enhancements master
>
> error: pathspec 'editor-enhancements' did not match any file(s) known to
> git.
> error: pathspec 'master' did not match any file(s) known to git.
>
Whoops, sorry that meant to say:

git checkout -b editor-enhancements master

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

buttim
I should have understood it. I'll give it a try in a few hours
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

buttim
Ok. I created the pull request !
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

buttim
What's next? I mean, what's the normal course of the events I should expect after the pull request?
Reply | Threaded
Open this post in threaded view
|

Re: Windows cross compilation

kintel
Administrator
> On Mar 7, 2017, at 20:13, buttim <[hidden email]> wrote:
>
> What's next? I mean, what's the normal course of the events I should expect
> after the pull request?
>
I cannot find any open pull requests from you. Did you go yo github and actually submit the request in their web interface?

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
123