Open kbarbary opened 8 years ago
The C code in ERFA is extremely standards-compliant and should be trivial to build on Windows. It should not need a Unix environment. Someone who knows about windows and has a Microsoft compiler should find it very easy to do. It's more a case of finding a volunteer.
You're right. I was able to cross-compile using
i686-w64-mingw32-gcc -Isrc -o liberfa.dll -O3 -shared -static-libgcc src/*.c # 32-bit
x86_64-w64-mingw32-gcc -Isrc -o liberfa.dll -O3 -shared -static-libgcc src/*.c # 64-bit
Posted the binaries here for the time being: https://bintray.com/kbarbary/generic/erfa/1.2.0/view/files#files/
It might be nice to make this part of the release process. My autotools skills are not currently up to the task.
Am going through old issues to see if they are still relevant. Is this one still an issue given that we have pyerfa
which (I think??) would come with the binary if one pip-installs it?
Hi @timj @kbarbary @mhvk @mdboom @phn
I was able to build successfully ERFA and tests using only Visual Studio 2022. Did not use any cygwin, mingw or similar environments. Of course I had to slightly modify two header (erfa.h, erfaextra.h) and one source (erfaversion.c) file to build successfully everything.
I have two questions:
BR,
Ladislav
@laheller - I thought we had changed/enabled CMake
so that things would work under windows too, but I now see the relevant PR, #75, got stalled. Maybe you can have a look whether that would work for you? If so, all the more reason to actually merge this...
@mhvk I would try it but the PR author's repo/branch does not exist anymore...
Hmm, hadn't realized that! You can still pull the PR with
git fetch upstream pull/75/head:pr-75
git checkout pr-75
(where upstream
points to the liberfa/erfa
repository)
(Not sure it won't need a rebase, though...)
@mhvk
OK, thanks for hint. Using this PR I was able to create a new Visual Studio solution and build library + tests. Everything works.
One note, that it only creates a static library (.lib file) but skips shared library (.dll file) creation. When I manually set the created project properties to produce shared library, it however creates but the result .dll file has no export symbols. This is due to missing __declspec(dllexport) keyword in header files at the function signatures.
Otherwise no issues.
Is there any hope of building and distributing Windows shared library binaries along with the source tarballs for each release? This would make it easier to support Windows in ERFA.jl. Ref: JuliaAstro/ERFA.jl#17