Clear instructions for compiling on Windows #969

Open
szhorvat opened this Issue Nov 2, 2016 · 5 comments

Projects

None yet

2 participants

@szhorvat
Contributor
szhorvat commented Nov 2, 2016 edited

I think there is a need for clear, step-by-step instructions for compiling igraph-c on Windows. I propose a wiki article because that will hopefully be easier to keep up to date than a file in the git repo. This should be specifically for compiling the development version.

There should be separate instructions for msys/MinGW and for different versions of MSVC. Perhaps @janschulz can help with this.

I can contribute to the msys2/mingw guide, as that's how I compile igraph on Windows now.

Currently I find it quite painful to compile igraph on Windows. I never managed to compile it with MSVC, and when I go back to try it with msys2 and MinGW I often find that something got broken (perhaps due to an msys2 update) and have to spend a lot of time to figure out how to get it working again. Having a community guide to which everyone can contribute would save time and effort for all of us.

@janschulz
Contributor
janschulz commented Nov 2, 2016 edited

IMO the best way to document the build of it is by building a appveyor config and then keep tat green: https://github.com/igraph/igraph/blob/master/appveyor.yml

E.g. in this case: simply add another build configuration for mingw alone where this line is "active" again: https://github.com/igraph/igraph/blob/master/appveyor.yml#L79

@janschulz
Contributor
janschulz commented Nov 2, 2016 edited

Ok, I just saw that igraph already has a mys2 build (and the missleading comment should be removed :-) ):

   - TARGET_ARCH: "x64"
      PYTHON_VERSION: "NONE"
      CONDA_INSTALL_LOCN: "C:\\Miniconda-x64"
      MSYSTEM: MINGW64
      PATH: C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\Windows\System32;C:\Windows;%PATH%
[...]
install:
[...]
    - cmd: if %PYTHON_VERSION%==NONE  make
[...]
test_script:
[...]
    - cmd: if [%PYTHON_VERSION%]==[NONE] make check

Compiles with mys2 alone, not the msvc target and does the make test

@janschulz
Contributor
janschulz commented Nov 2, 2016 edited

Unfortunately, it doesn't compile right now due to the mentioned changes in msys2:
49c2429#commitcomment-19609938
https://ci.appveyor.com/project/ntamas/igraph/build/1.0.64

@szhorvat
Contributor
szhorvat commented Nov 2, 2016

Well, not being familiar with appveyor, personally for me it is not clear from that file how to compile with either mingw or msvc. I don't see the solution for the problems I still have with mingw and need to work around. I don't see how to generate the msvc project file. It's also not clear what refers to the C core and what's required only for the python stuff.

I'm not sure if others who try to compile igraph would have the same experience.

@janschulz
Contributor
janschulz commented Nov 3, 2016 edited

I once wrote a text file where I described how to compile it under windows, but it's basically out of date, so I'm skeptical that anything else than tested scripts work (at least as long as the main developers are not on windows):

https://github.com/igraph/igraph/blob/master/INSTALL.WINDOWS

The appveyor config builds 4 versions of the libigraph.so/dll (see the 4 blocks in environment: matrix:): one with mingw, three for different versions of msvc. Just go through the commands from the top (starting at 'install:') to the bottom, each line is basically one command in the windows commandline. appveyor has some preinstalled apps, like a msys2 environment, conda installs for multiple versions and also all msvc packages.

  • if %PYTHON_VERSION%==NONE means that we want to build for the "python_version" "NONE", so the msys2 build.
  • So if [%PYTHON_VERSION%] NEQ [NONE] means the reverse, so any msvc builds
  • if %PYTHON_VERSION%==2.7are all the lines for the old msvc which fits to python2.7 (and so on for 3.4 and 3.5)

Commands which do not have such a if clause are either needed for all builds (pacman calls, bootstrap and configure) or not harmfull (like the conda setup calls, which take no time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment