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

Appveyor #3

Merged
merged 14 commits into from
Apr 5, 2017
Merged

Appveyor #3

merged 14 commits into from
Apr 5, 2017

Conversation

ocefpaf
Copy link
Member

@ocefpaf ocefpaf commented Apr 4, 2017

This builds on top of #2 and add the AppVeyor machinery for testing. You can see the result at: https://ci.appveyor.com/project/ocefpaf/python-gswc/build/1.0.9

The compiler is not happy but maybe those are easy to fix for those with Windows experience.

@gillins if you are not too busy can you give me some advice where I could start?

src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2146: syntax error: missing ';' before identifier 't1'
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2088: '*': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 'r1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 'r20': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 'r21': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2213): error C2065: 'r22': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2086: 'double _complex': redefinition
src/c_gsw/gsw_oceanographic_toolbox.c(2213): note: see declaration of '_complex'
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2146: syntax error: missing ';' before identifier 'r2'
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2215): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2223): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2223): error C2065: 'r20': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2223): error C2065: 'r21': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2223): error C2065: 'r22': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2223): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(2225): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2225): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2225): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(2226): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2226): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2226): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2065: 'r1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(2228): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(2228): error C2088: '+': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(2229): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2229): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2229): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2229): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(2229): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(2229): error C2088: '+': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(2231): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(2231): error C2440: 'function': cannot convert from 'int' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(2231): warning C4024: 'creal': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(3809): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(3921): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2146: syntax error: missing ';' before identifier 't1'
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2088: '*': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 'r1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 'r20': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 'r21': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4463): error C2065: 'r22': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2086: 'double _complex': redefinition
src/c_gsw/gsw_oceanographic_toolbox.c(4463): note: see declaration of '_complex'
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2146: syntax error: missing ';' before identifier 'r2'
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'r2p': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'r2pp': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4465): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4466): error C2065: 'tau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4466): error C2065: 'tau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4469): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4469): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(4475): error C2065: 'tau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4475): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4475): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4476): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4476): error C2065: 'tau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4477): error C2065: 'tau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4477): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4477): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4478): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4478): error C2065: 'tau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4482): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4482): error C2065: 'r20': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4482): error C2065: 'r21': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4482): error C2065: 'r22': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4482): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
src/c_gsw/gsw_oceanographic_toolbox.c(4484): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4484): error C2065: 'r1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4484): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4484): error C2065: 'tau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4484): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(4484): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(4485): error C2088: '*': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(4485): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4485): error C2065: 'sqtau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4485): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(4485): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(4485): error C2088: '-': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(4486): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4486): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4486): error C2065: 'tau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4486): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(4486): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(4487): error C2088: '*': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(4487): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4487): error C2065: 'sqtau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4487): error C2440: 'function': cannot convert from 'double' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(4487): warning C4024: 'clog': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(4487): error C2088: '-': illegal for struct
src/c_gsw/gsw_oceanographic_toolbox.c(4489): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4489): error C2065: 'g': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4489): error C2440: 'function': cannot convert from 'int' to '_Dcomplex'
src/c_gsw/gsw_oceanographic_toolbox.c(4489): warning C4024: 'creal': different types for formal and actual parameter 1
src/c_gsw/gsw_oceanographic_toolbox.c(4493): error C2065: 'tau_t1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4493): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4493): error C2065: 't1': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4494): error C2065: 'tau_t2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4494): error C2065: 'tau': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4494): error C2065: 't2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4496): error C2065: 'r2': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4496): error C2065: 'r20': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4496): error C2065: 'r21': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4496): error C2065: 'r22': undeclared identifier
src/c_gsw/gsw_oceanographic_toolbox.c(4496): fatal error C1003: error count exceeds 100; stopping compilation
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit 

@efiring
Copy link
Member

efiring commented Apr 4, 2017

It's not clear to me how to add appveyor and Travis. I see where they are listed and can be configured with respect to access permissions, but I haven't found a place to activate them.

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 4, 2017

It's not clear to me how to add appveyor and Travis. I see where they are listed and can be configured with respect to access permissions, but I haven't found a place to activate them.

If you already have an account on both, if not you can just login with your GitHub, you can navigate to:

https://travis-ci.org/efiring/python-gsw

and a button to activate it should be there.

For AppVeyor you need to go to: https://ci.appveyor.com/projects/new

and search python-gswc from the GitHub list. Let me know if that helps. If not we can do that another time via a call.

@efiring
Copy link
Member

efiring commented Apr 4, 2017

It should be active now. I triggered a build and got

Build started
git clone -q --branch=master https://github.com/efiring/python-gswc.git C:\projects\python-gswc
git checkout -qf 94a70f51ad06a5555596425a6fc0f364e7829c10
Specify a project or solution file. The directory does not contain a project or solution file.

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 4, 2017

It should be active now. I triggered a build and got

AppVeyor just staeted, see above, here but Travis-CI did not.

@efiring
Copy link
Member

efiring commented Apr 4, 2017 via email

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 4, 2017

I have to run now, and won't have much time until late afternoon.

There is no rush. I am working on the docs next and hopefully I'll have some news on the Windows front too.

@gillins
Copy link

gillins commented Apr 4, 2017

I think the double complex declaration is the problem here (https://github.com/efiring/python-gswc/blob/master/src/c_gsw/gsw_internal_const.h#L410). Seems MSVC doesn't support it in C code. I've seen a couple of links suggesting compiling in C++ mode (https://groups.google.com/forum/#!topic/cython-users/c3URYWf2AFQ, https://social.msdn.microsoft.com/Forums/vstudio/en-US/6c61000d-f6c8-45eb-9438-0223b587365c/no-complexh?forum=vclanguage) not sure if this might cause other problems though...

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 5, 2017

Awesome! Thanks @gillins! I will try the c++ route.

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 5, 2017

I tried setting the language in the Extension kwarg but I guess that is not what is needed to compile in C++.

commit: ocefpaf@6fb5c31
results: https://ci.appveyor.com/project/ocefpaf/python-gswc/build/1.0.32/job/13djdr5iwi3jc9kx

mingwpy works but limits us to Python 3.4and numpy 1.11, the combination where mingwpy is available, which is not ideal.

commit: ocefpaf@6a4c264
results: https://ci.appveyor.com/project/ocefpaf/python-gswc/build/1.0.31

I tried a few combinations of AppVeyor's cygwin, msys2, and conda's msys2. All of them fail in a way. Here is the last one:

commit: ocefpaf@a7346e2
results: https://ci.appveyor.com/project/ocefpaf/python-gswc/build/1.0.34

@efiring
Copy link
Member

efiring commented Apr 5, 2017

What a mess! MSVC is hopeless for C99 including complex. It looks like the complex numbers are used only in the ice functions, so one option would be to patch the C with preprocessor commands that disable the ice functions and the complex declarations when MSVC is being used. That is not an appealing prospect. An even less-appealing option would be to reimplement all of the things presently using complex.

What we really want is revitalization of mingwpy, which seems to have stalled a year ago.

I don't know what to do; I will ponder this some more.

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 5, 2017

What we really want is revitalization of mingwpy, which seems to have stalled a year ago.

That would be ideal.

I don't know what to do; I will ponder this some more.

My two cents would be to remove those functions for now with a patch.

@efiring
Copy link
Member

efiring commented Apr 5, 2017

I would like to try a patch that simply changes the complex declarations and initializations in the MSVC case, as suggested in the answer here: http://stackoverflow.com/questions/22991409/compiling-c-code-in-visual-studio-2013-with-complex-h-library. It seems like this has a reasonable chance of working on Python 3.5 and 3.6.

What is the simplest way for me to be able to try this?

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 5, 2017

What is the simplest way for me to be able to try this?

I just resolved the conflicts. I guess that you can merge this and use the AppVeyor results in a PR to guide you with the patching. Painful... But that is what I do without a Windows machine.

@efiring efiring merged commit e1610f8 into TEOS-10:master Apr 5, 2017
@ocefpaf ocefpaf deleted the appveyor branch April 5, 2017 21:02
@efiring
Copy link
Member

efiring commented Apr 5, 2017

I have made the commit locally, on a new branch, but I can't push that branch to the repo:

(test) efiring@manini2:~/work/programs/TEOS-10/github/gswc/src/c_gsw$ git push origin msvc_complex:msvc_complex
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 6.21 KiB | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote: fatal error in commit_refs
To github.com:efiring/python-gswc.git
 ! [remote rejected] msvc_complex -> msvc_complex (failure)
error: failed to push some refs to 'git@github.com:efiring/python-gswc.git'

I'm baffled. I was assuming I would be able to push it, and that this would trigger the Appveyor and Travis builds.

@ocefpaf
Copy link
Member Author

ocefpaf commented Apr 5, 2017

Can you do git push --set-upstream origin msvc_complex? I am a bit lost there...

@efiring
Copy link
Member

efiring commented Apr 5, 2017 via email

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

Successfully merging this pull request may close these issues.

3 participants