Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Windows #44

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open

Windows #44

wants to merge 39 commits into from

Conversation

montefra
Copy link
Contributor

Re-Add support from windows executables and libraries.

I have no Window machine to test it.

We probably should enable appveyor to make sure that installation works.

[we should also enable travis CI for linux and mac]

@ericmandel
Copy link
Owner

@wjoye (DS9 author) has Windows capabilities. I'll see if I can test pyds9 on his setup next week.

@montefra
Copy link
Contributor Author

That would be great. Thank you.

@ericmandel
Copy link
Owner

@montefra I can't test this until next week, because Bill Joye is away and I have no access to his machine. But, it looks like #45 is the test we want to make, right?

@montefra
Copy link
Contributor Author

@ericmandel : no problem.

About #45: it's a problem at installation, also reported in #46. They all use anaconda and I don't remember seeing anything like that in standard python on my machine. I'll have to investigate.

@ericmandel
Copy link
Owner

OK, I'll try to help when Bill gets back and we have a Windows machine.

@montefra
Copy link
Contributor Author

@ericmandel : I have enabled appveyor on your repo (been collaborator I can do it). However it is not triggered on PR, which is annoying. Unfortunately I cannot modify the settings of the repo so I'll have to ask you.
Can you please go to settings and then either "webhooks" or "integration & services". Under one of the two you should see a page like this

Make sure that the Push and Pull Request are ticked. Thank you.

ps: I've added the travis logo on the README.

@ericmandel
Copy link
Owner

@montefra I can add a Webhook ... but what's the URL and what data format do you want?

@montefra
Copy link
Contributor Author

The webhook should already be there. I can build using appveyor from your master

@ericmandel
Copy link
Owner

@montefra Hmmm ... here's what I see:

screen shot 2016-10-24 at 9 02 56 am

screen shot 2016-10-24 at 9 03 09 am

@montefra
Copy link
Contributor Author

@ericmandel : ok. Thanks for checking. Then probably is better if you enable appveyor yourself for pyds9:

  • https://ci.appveyor.com
  • log in with github
  • once you are logged in, click on "Projects" (in the bar on top of the page)
  • click on "NEW PROJECT"
  • from the list select pyds9. On the right you should see "ADD" button. Click it, but be careful to select the correct repository. They though that was a good idea to put the button on the opposite side of the page...
  • you should see a page with the repo name and "LATEST BUILD HISTORY DEPLOYMENTS SETTINGS" buttons
  • go back to github and then Settings -> webhooks. Now you should see on entry like: "https://ci.appveyor.com/api/github/webhook (pull_request and push)". If pull_request and push are in the string, then we are settled.

II'll see to get all directed to me with this

Thank you,

Fra

@ericmandel
Copy link
Owner

@montefra You should be all set now ... thanks, as always, for sending such explicit instructions, its very helpful.

@montefra
Copy link
Contributor Author

@ericmandel: it looks like I am getting the the windows build a little step at a time. By default appveyor uses MinGW as environment. I had issues with running configure that I managed to solve using the latest config.guess and config.sub. Using those files did not break the linux and OSX build.

I would like to avoid having a version of xpa different from the official one and I don't know if the update I have done has any drawback for xpa itself. If you want I can make a PR on xpa with the new config.{guess,sub} and then you can decide what to do with it.


That said, now make works, but it fails with:

cextern\xpa\xpap.h(52) : fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

I'll try to figure out how to get it to work. In the meanwhile if you have suggestions, do not restrain yourself 😁.

Are you aware of XPA installation instructions for windows? I did some googling, but I haven't found anything.

@ericmandel
Copy link
Owner

@montefra I'm not quite at work yet but ... on the pyds9 project, I changed the user role permissions so that users can do everything. Please see if that allows you to so what you need to do.

@ericmandel
Copy link
Owner

Also, it looks to me like all builds have completed or were cancelled. Is that correct?

@montefra
Copy link
Contributor Author

I managed to stuck one of the build and appveyor has a timeout of 1hour... So the above request.


You need to make me part of your team. Go to the team page and add me (franz.bergesund at gmail.com) as collaborator with admin role.

BTW: I think that you don't want to make all users as admin. I'll revert them as soon as you grant me access.

@ericmandel
Copy link
Owner

OK, you are now a collaborator with admin role. I reverted the user permissions back to inherit. Let me know what else you need.

@montefra
Copy link
Contributor Author

montefra commented Oct 25, 2016

Perfect! that's it. Thank you.

I might need support with the compilation. I have no idea of how Windows and Cygwin work and I'm blindly testing options. I think that the setuptools is still got getting the Cygwin compiler.

@ericmandel
Copy link
Owner

@montefra Thinking more about this, you might want to use mingw instead of cygwin. Mingw is meant to be linked against windows programs ... I don't know how this is done with cygwin. So assuming the Python executable is a Windows executable (i.e. not built with cygwin), mingw probably is the correct choice.

@ericmandel
Copy link
Owner

The other thing that we might consider for Windows is supplying pre-built xpa.dll and xpans.exe files. That is, you build them once with mingw and supply them for Windows. This might be easier then trying to figure out how to build Windows binaries (dll and executable) dynamically withing the python environment.

@montefra
Copy link
Contributor Author

montefra commented Oct 26, 2016

@montefra Thinking more about this, you might want to use mingw instead of cygwin. Mingw is meant to be linked against windows programs ... I don't know how this is done with cygwin. So assuming the Python executable is a Windows executable (i.e. not built with cygwin), mingw probably is the correct choice.

I think that this is what happens already, but I am not that sure. Now I am tempted to ditch the current appveyor.yml file and see if this tutorial helps.

The other thing that we might consider for Windows is supplying pre-built xpa.dll and xpans.exe files. That is, you build them once with mingw and supply them for Windows. This might be easier then trying to figure out how to build Windows binaries (dll and executable) dynamically withing the python environment.

Even better: we can use appveyor to build wheels for windows: they are precompiled binaries with the whole package.
But first I need to build it...

@ericmandel
Copy link
Owner

@montefra Bill Joye and I just built an xpans.dll and xpans.exe under cygwin on Windows10. We did this in the XPA directory by executing these commands:

./configure CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar --build=x86_64-unknown-mingw32 --without-tcl --prefix /home/joye/saods9 --exec-prefix /home/joye/saods9 --enable-shared --enable-symbols --with-x=disabled

make mingw-dll
make xpans

Obviously you'll want to change the prefix directory.

We then ran the xpans program under Windows, and took the generated dll and did this without error using Anaconda Python 2.7:

python
>>> import ctypes
>>> foo = ctypes.WinDLL("C:\\Users\\joye\\libxpa.dll")

Don't exactly know what to do after that ...

I put the xpans.exe and DLL files in:
http://hea-www.cfa.harvard.edu/~eric/xpa_win10.tar.gz
in case you want to try to use them. They are compiled for 32-bit Python.

Let me know if this helps.

@montefra
Copy link
Contributor Author

@ericmandel : thank you for the test. Now I'm going on vacation for a few days. When I'll be back we'll think about how to proceed.

@montefra
Copy link
Contributor Author

@ericmandel : This branch brought me more frustration than good.
Since I should take care of the latest reports I am thinking to do the followin:

  • create a new branch out of the current master
  • cherry-pick the important commits of this branch (the first two should be the ones that I want )
  • for windows only revert the installation mode to the old way (what you implemented)
  • close this branch

If all go smoothly I can then fix the bugs reported recently and release a new version of pyds9.

@ericmandel
Copy link
Owner

@montefra Yes, you should do whatever helps you makes the most stable and easy-to-support version of pyds9. Once you have things settled, it might be worthwhile re-considering the use of Bill Joye's Windows DLL files for XPA. Although supplying binary files is not perfect, it will allow people to use pyds9 without having to install cygwin.

But for now, do what makes things easy and stable!

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

Successfully merging this pull request may close these issues.

2 participants