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

Possible to get a windows build? #7

Closed
samuelstjean opened this issue Oct 7, 2016 · 15 comments
Closed

Possible to get a windows build? #7

samuelstjean opened this issue Oct 7, 2016 · 15 comments

Comments

@samuelstjean
Copy link

Just wondering, seems like for example this person got it working without too much workaround https://anaconda.org/pavoljuhas/gsl/files.

I was about to maybe submit a recipe of my own that depends on gsl, so it would simplify my life a bit if inclusion would not be too troublesome.

@ocefpaf
Copy link
Member

ocefpaf commented Oct 7, 2016

That recipe uses seems to be using mingw. I believe that is not advisable, but @mingwandroid can probably say more.

We could try msys2 though. That is available in defaults.

@samuelstjean
Copy link
Author

Oh ok, as a curiosity (as I might consider stealing their precompiled dll for distribution), why is mingw not advisable versus say msys or anything else? Availability of runtime dll or something else with conda forge specifically?

Mostly wondering since if it makes it impossible to use without installing the whole of mingw it kind of defeats the purpose.

@jeromekelleher
Copy link
Member

I'd just like to second this. I'd like to package my application for windows, but I can't get the GSL dependency working. Why does GSL depend on mingw, but things like (e.g) HDF5 seem to compile OK under MSVC? Sorry, I'm sure this is a stupid question, but I'm a windows noob!

@mingwandroid
Copy link

mingwandroid commented Oct 18, 2016

AFAIR GSL uses Autotools. Autotools doesn't work with MSVC (without hacks), partially due to MS using / to pass switches (though nowadays you can use - instead) and partially because Autotools is a GNU project as is GSL and those guys have a preference for open source toolchains, especially their own, GCC.

I doubt Autotools would reject patches that made it support MSVC nicely, but I wouldn't hold my breath on them implementing that themselves.

Also, if C99 is used in GSL then MSVC doesn't support that well.

If you are building C DLLs you can sometimes use ones by either compiler in a program built with the other compiler.

Mostly wondering since if it makes it impossible to use without installing the whole of mingw it kind of defeats the purpose.

I'm not sure what you mean by this. mingw-w64 is a toolchain and hardly any of it needs to be present on an end users machine. To use mingw-w64 built DLLs you typically need one DLL, libgcc. If it's C++ you also need the libstdc++ DLL.

@samuelstjean
Copy link
Author

That should have read possible, not impossible. Just bundling a libgcc.dll is much easier than having people install msys/mingw/etc, which is what I was referring to as being overkill for the purpose of using one (GSL) dll I'd like to distribute.

@jeromekelleher
Copy link
Member

Thanks @mingwandroid, this is really clear and helpful!

It would be great if there was some way of linking to GSL on windows in conda-forge, as this is a really common dependency for scientific software. I don't think having an extra dependency on libgcc is a big deal, but (being a windows noob) I have no idea how to go about doing this. Are there any recipes out there that do something similar?

@mingwandroid
Copy link

Check rpy2 on defaults. It is a Python module which links to python??.dll (obviously) and also R.dll from r-base, which is the core DLL of the R language and is built with mingw-w64. Also of interest, but less so, is theano (on defaults) which is a Python module that calls mingw-w64 GCC at runtime to compile optimized kernels. These kernels are also Python modules that it then loads and executes.

@jeromekelleher
Copy link
Member

Just for my reference, here's the link to the rpy2 recipe. Thanks @mingwandroid!

@mingwandroid
Copy link

No problem. One thing to note with the rpy2 recipe is that it generates mingw-w64 import libraries for the python DLL in bld.bat. This is no longer necessary since I released libpython 2.0 on defaults last week.

@jeromekelleher
Copy link
Member

Just googling around for solutions to compiling GSL and I came across this answer on Stackoverflow. It looks like there is a project with CMake support for GSL that works with Visual Studio.

Here is the GitHub repo for the project: https://github.com/ampl/gsl

The CMake script has been accepted upstream, and is in the contrib directory of the source.

Could provide the basis for a working GSL distribution on Windows? It looks like there is a conda windows package for cmake.

@mingwandroid
Copy link

Sounds good.

@jeromekelleher
Copy link
Member

I tried out the cmake based solution from the Stackoverflow answer on AppVeyor's build machines, and it seems to work fine. All I had to do was

git clone git://github.com/ampl/gsl.git
cd git
cmake .
msbuild GSL.sln

and that was it. There are some executables in the bin/Debug (e.g., randist_test.exe), and these seem to run and succeed (I didn't try them all, just a handful). In the Debug directory there are gsl.lib and gslcblas.lib files, which I think is what we need ultimately.

So, this all seems to work pretty well. I guess for a real recipe we should pull the cmake files in as a patch to the distribution tarball. I'm happy to move this forward, but I could use some help on where to go from here. Any pointers would be much appreciated!

@shadowwalkersb
Copy link
Contributor

Have submitted a PR ( #11) to add Windows build per some suggestions mentioned in this issue. Could use some help over there.

@shadowwalkersb
Copy link
Contributor

There is another recipe, but it may be only for gsl 1.8.

@ocefpaf
Copy link
Member

ocefpaf commented Dec 29, 2016

Closed by #11

@ocefpaf ocefpaf closed this as completed Dec 29, 2016
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

No branches or pull requests

5 participants