Changes between Version 1 and Version 2 of user-windows


Ignore:
Timestamp:
Feb 27, 2011 10:51:31 AM (11 years ago)
Author:
stefan
Comment:

extend and revise windows build notes

Legend:

Unmodified
Added
Removed
Modified
  • user-windows

    v1 v2  
    1 = Windows Specific Installation Notes =
     1= Notes on Building COIN-OR projects under Windows =
    22
    3 This page is being set up.  Below just a first draft of the information (Lou's email message to the TLC mailing list)
     3There are ways to build COIN-OR projects even under Windows.
     4However, one should keep in mind that this platform is only ''sporadically maintained''.
     5Most '''COIN-OR projects are developed on a Unix-like system''' and do not focus primarily on supporting many other platforms.
     6The platform of the developer, which is Linux in many cases, is usually the one where most of the testing is done.
     7There is some effort to [https://projects.coin-or.org/TestTools automatically test] also other platforms, however, build or execution problems with Windows are discovered often only with much delay - if at all. Performance is usually never checked.
    48
    5 {{{
     9After these motivating words, this page tries to give a short overview on the possible tracks to build COIN-OR projects under Windows.
     10It will be far from complete, a message that as usual comes with the reminder that this page is a wiki.
    611
    7  1) True MSVS, using the MSVS IDE.  No autotools or unix anywhere in the
    8     vicinity.  Now available (MSVS8) as a free download.  The usual source of
    9     MS cl, MS link, and other MS build tools.  No free Fortran compiler.
     12== Abandon Windows ==
    1013
    11  2) Full cygwin, which tries to be linux running on top of Windows.  From the
    12     buildtools point of view, the important things are that the GCC compilers
    13     are available and cygwin.dll (or some such name) will be needed when code
    14     is run, hence binaries will not run in the native Windows environment.
    15    
    16     Config.guess will show *-cygwin* as the build type.
    17    
    18     Requires no command line help when configuring. Configure is run in a
    19     cygwin shell.
     14Before thinking on how to build a COIN-OR project under Windows, you should convince yourself whether you really need to run this project under Windows.
     15There exist [http://en.wikipedia.org/wiki/Linux_distribution user-friendly Linux distributions] that are easy to install and use.
    2016
    21  3) Cygwin, but built with the -mno-cygwin flag.  Still uses GCC compilers,
    22     but avoids using anything that needs cygwin.dll.  The resulting binaries
    23     will run in the native Windows environment.
    24    
    25     Config.guess will show *-cygwin* as the build type.
    26    
    27     Specified with the --enable-doscompile=mingw command line flag when
    28     configuring.  Configure is run in a cygwin shell.
     17Next to a usual installation that replaces Windows or exists parallel to a Windows installation, you could also consider an installation a Linux system in a '''virtual machine''', thus allowing to run Linux "inside" Windows. Setting up virtual machines is easy nowadays.
    2918
    30  4) Cygwin, but Coin configuration will assume Microsoft cl/link used for
    31     compilation and linking.  The resulting binaries will run in the native
    32     Windows environment.  No free Fortran compiler, but you can try Andreas'
    33     compile_f2c.
     19== Use precompiled binaries ==
    3420
    35     Config.guess will show *-cygwin* as the build type.
    36    
    37     Specified with the --enable-doscompile=msvc command line flag when
    38     configuring.  Configure is run in a cygwin shell.  The user is responsible
    39     for making sure that PATH is properly set to include the relevant MSVS
    40     directories.
     21The people behind COIN-OR put some effort in providing binary versions of executables and libraries, especially for Windows.
    4122
    42  5) MinGW, a sort of minimalist cygwin.  I know it exists, but I have yet to
    43     try configuring in this environment.  My impression is that you get GCC
    44     plus all the utilities needed for build and configuration.  Autotools?
    45     Extras?
     23The binaries are available at the [http://www.coin-or.org/download/binary COIN-OR binaries download page].
     24If binaries for the particular project you are interested in are not available, have a look if it is included in the [http://www.coin-or.org/download/binary/CoinAll archives for the CoinAll project]. [https://projects.coin-or.org/CoinBinary CoinAll] is a selection of COIN-OR projects that are known to work together.
    4625
    47     Config.guess will show *-mingw* as the build type.
    48    
    49     Should require no command line help? Configure is run in a mingw shell.
     26== Using MS Visual Studio ==
    5027
    51  6) Msys, a sort of minimalist MinGW.  Does not include GCC.  Coin
    52     configuration will assume MS cl/link.  Just enough unix support to allow
    53     configure scripts to run.  No autotools.  No free Fortran compiler, but
    54     you can try compile_f2c.  At install, will helpfully ask if you want to
    55     synchronise with an existing mingw (and cygwin?)  installation, which
    56     hopelessly confuses the issue of what's actually available.
     28The developer of the Windows system, Microsoft, also provides a tool for developing applications under Windows, called Microsoft Visual Studio (MSVS).
     29Of course, it comes with its own system of how to build libraries and binaries from a bunch of source files, so that the default build system (based on shell, {{{autotools}}}, and {{{make}}}) of COIN-OR projects cannot be reused.
    5730
    58     Config.guess will show *-mingw* as the build type.
    59    
    60     Now specified with the --enable-doscompile=mingw option.  Previously no
    61     option, but if we decide to support 5), may indeed by necessary.
    62     Configure is run in an msys shell.  The user is responsible for making
    63     sure that PATH is properly set to include the relevant MSVS directories.
     31Instead, a group of fearless COIN-OR maintainers took up the task to '''provide MSVS project files''' for some projects. The [https://projects.coin-or.org/MSVisualStudio COIN-OR Visual Studio wiki] describes the organization and use of these files and for which projects they are available.
    6432
    65 }}}
     33== Using Cygwin ==
     34
     35[http://www.cygwin.com Cygwin] is a project that tries to emulate a Linux running on top of Windows.
     36I.e., it provides a Unix shell and standard Linux tools, thus allowing one to work as under a real Linux system.
     37Thus, it makes it possible to use the default COIN-OR build system under Cygwin.
     38
     39=== Building with GNU compilers ===
     40
     41Cygwin also includes the GNU compiler collection, including {{{gcc}}}, {{{g++}}}, and {{{gfortran}}}.
     42The strong emulation of Linux by Cygwin allows to build most COIN-OR projects that also build under Linux with GNU compilers.
     43
     44'''Note''', that by default the binaries produced by a Cygwin/GNU build '''require the library {{{cygwin.dll}}} (or some such name) at runtime''', hence binaries will not run without this library in the native Windows environment.[[BR]]
     45However, adding {{{-mno-cygwin}}} to the compiler flags allows to build in a way that everything that needs {{{cygwin.dll}}} is avoided. The resulting binaries then also run in a native Windows environment.
     46This compiler flag can be added by using the configure option {{{--enable-doscompile=mingw}}}.
     47
     48Note further, that some Cygwin distributions include a '''buggy make''' binary, which may result in failing builds.
     49Regarding this issue and '''other issues''' with Cygwin builds, please consult the [wiki:current-issues current issues page].
     50
     51=== Building with MS or Intel compilers ===
     52
     53It is also possible to use MS or Intel compilers while still using COIN-OR build system under Cygwin.
     54The way it works is that Unix-paths are translated into Windows-paths using the {{{cygpath}}} tool at the time the compiler is called.
     55The whole system is a bit fragile, so don't be surprised if some things don't work.
     56
     57Note that setting up the '''{{{$PATH}}} variable''' under Cygwin in a way that it finds the MS or Intel compilers is important.
     58
     59The Intel compilers have the advantage that they also bring a Fortran compiler that compiles both Fortran77 and Fortran90 code. MSVS usually contains only C/C++ compilers.
     60
     61However, the !BuildTools include a script '''{{{compile_f2c}}}''' that '''emulates a Fortran compiler''' by translating Fortran77 code into C code via {{{f2c}}} and compiles this code via a C compiler.
     62This does not work for Fortran90.[[BR]]
     63See the [source:stable/0.7/compile_f2c/INSTALL INSTALL file] on instructions on how to install {{{compile_f2c}}}.
     64If configure is called with {{{--enable-doscompile=msvc}}} and no other Fortran compiler is available, compile_f2c will be chosen automatically.
     65
     66== Using MinGW / MSYS ==
     67
     68[http://www.mingw.org MinGW] is a sort of minimal version of Cygwin.
     69It brings a shell and a set of standard Unix tools, but does not try to emulate a full Linux system.
     70
     71However, it includes enough tools to use the COIN-OR build system, i.e., to run configure and co.
     72
     73The difference between MinGW and MSYS seem to be that MinGW includes the GNU compiler collection.
     74Thus, it can be used to build COIN-OR projects mostly as under Linux.
     75
     76Further, using MS or Intel compilers and the {{{compile_f2c}}} script should be possible, see the corresponding notes in the Cygwin section.
     77
     78Note, that it is important that the '''{{{$PATH}}} variable''' is setup such that the '''MS/Intel compiler paths come first''' (to find the correct {{{link.exe}}}), if used, the '''MinGW/MSYS paths come second''' (to find the correct {{{sort.exe}}}, {{{find.exe}}}), and the Windows system paths come last.
     79See also the note on the [wiki:current-issues#MinGWPath current issues page].