ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Windows take2 #63

Open montefra opened 6 years ago

montefra commented 6 years ago

Let's start from scratch to see if I can build pyds9 on Windows

montefra commented 6 years ago

With CygWin and MinGW, configure runs fine, but the compilation crashes with

cextern\xpa\xpap.h(23): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

trying out commands with commits it's impossible. It seems that it is possible to access the worker with remote desktop. These are the instructions. I will give a try the first evening that I have enough time.

ericmandel commented 6 years ago

Are you saying that cygwin and mingw configure find unistd.h but then cpp cannot??? That would be very unusual.

ericmandel commented 6 years ago

If that is true, we can always change xpap.h to not include unistd for Cygwin and MingW. But I'd like to hear what Bill Joye does in this regard, since he builds XPA under Cygwin all the time.

ericmandel commented 6 years ago

Wait ... is configure being run with the Microsoft Visual Studio compiler? Or are you running it with the cygwin compiler?

montefra commented 6 years ago

Configure runs fine, apparently. cl.exe, whatever that is, doesn't. The difference is that I explicitly run configure, while the xpa is compiled by distutils/Setuptools. I don't know how to connect them. But I want to try to use the old way of installing (i.e. calling configure/make directly). Since xpa compiles in Windows as it is, I need to find a way to compile it within pyds9. XPA should stay as it is.

montefra commented 6 years ago

is configure being run with the Microsoft Visual Studio compiler? Or are you running it with the cygwin compiler?

I run configure with cygwin/mingw and then setuptools compiles with visual studio. I will figure out how to use only cygwin or mingw.

ericmandel commented 6 years ago

Right, I think the problem is that you run configure to check for the presence of unistd.h and configure uses a C compiler, for which unistd.h does indeed exist. It's probably gcc under Cygwin. Then the compile happens using a different C compiler, i.e. the Microsoft Visual Studio compiler. This does not have access to unistd.h and hence the error.

You might be able to run configure using the Microsoft compiler doing something like:

./configure CC='C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' 

or perhaps:

CC='C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' ./configure

or else figure out how to do the actual build with Cygwin gcc. One way or another, you have to use the same compiler for configure and the build ...

ericmandel commented 6 years ago

@montefra I don't think you are waiting for me regarding Windows, but please let me know if you are!

montefra commented 6 years ago

@ericmandel : no, I'm not.

I'm waiting to have one hour free to log into one of the Appveyor virtual machines to debug the package build. At least I figured out how to do it

ericmandel commented 6 years ago

OK, great, I've just re-emerged from an intense month but I am soon going on vacation until January and I wanted to make sure you are not waiting for me when I disappear again!

montefra commented 6 years ago

I'm also going on vacation between the 22nd and the 6th of January, so I won't be very active for a while.

ericmandel commented 6 years ago

Then all that is left is to wish you a very Happy New Year and thank you again for all the work you have done on pyds9!

montefra commented 6 years ago

Merry Christmas and Happy new Year. We'll be back on this next year, I fear :smirk: