Recent Changes - Search:

PmWiki

pmwiki.org

edit SideBar

Cygwin

Building on Windows with Cygwin

Tip: Windows Defender slows down the configure and build process dramatically. Temporarily turning off "real time protection" helps.

Build on Cygwin 64-bit

Assumptions

  • we are on a machine running 64-bit Windows 10 or similar
  • cygwin is installed
  • we want to build native (cygwin-independent) Windows 64-bit executables

Install the following additional cygwin packages:

  • mingw64-x86_64-binutils
  • mingw64-x86_64-gcc-g++
  • mingw64-x86_64-gmp
  • mingw64-x86_64-tcl
  • mingw64-x86_64-tk

Prepare a directory for third-party software (we'll refer to this as $ECLIPSETHIRDPARTY) with the following structure:

---$ECLIPSETHIRDPARTY
   |
   +---gmp
   |   |
   |   +---x86_64_nt ---> /usr/x86_64-w64-mingw32/sys-root/mingw
   |
   +---tcltk8.6
       |
       +---x86_64_nt ---> /usr/x86_64-w64-mingw32/sys-root/mingw

e.g. using

    $ export ECLIPSETHIRDPARTY=...
    $ mkdir $ECLIPSETHIRDPARTY
    $ mkdir $ECLIPSETHIRDPARTY/gmp
    $ ln -s /usr/x86_64-w64-mingw32/sys-root/mingw $ECLIPSETHIRDPARTY/gmp/x86_64_nt

    $ mkdir $ECLIPSETHIRDPARTY/tcltk8.6
    $ ln -s /usr/x86_64-w64-mingw32/sys-root/mingw $ECLIPSETHIRDPARTY/tcltk8.6/x86_64_nt

Prepare a source directory (we'll refer to this as $ECLIPSEDIR) and unpack the ECLiPSe sources there (or clone a git repository):

    $ ECLIPSEDIR=...
    $ mkdir $ECLIPSEDIR
    $ cd $ECLIPSEDIR
    $ tar xfz eclipse_src.tgz

Configure

    $ ./configure --host=x86_64-w64-mingw32

Make

    $ make -f Makefile.x86_64_nt

Check if you can get an eclipse prompt:

    $ lib/x86_64_nt/eclipse -D .
    ECLiPSe Constraint Logic Programming System [kernel threads]
    ...

Build on Cygwin 32-bit

Similar, replace

  • x86_64-w64-mingw32 with i686-w64-mingw32
  • x86_64_nt with i386_nt

Required packages are

  • mingw64-i686-binutils
  • mingw64-i686-gcc-g++
  • mingw64-i686-gmp
  • mingw64-i686-tcl
  • mingw64-i686-tk

Background Notes

Cygwin tools

There are 4 versions of the gcc toolchain available under Cygwin (assuming we are running on a 64-bit cygwin):

  • 64-bit cygwin (will build applications that depend on cygin.dll): packages binutils, gcc-g++ (tools are just called gcc, ld, etc)
  • 32-bit cyginw (will build 32-bit applications that depend on cygwin.dll): packages cygwin32-binutils, cygwin32-gcc-g++
  • 64-bit MINGW (will build native 64-bit Windows applications): packages mingw64-x86_64-binutils, mingw64-x86_64-gcc-g++ (provides tools called x86_64-w64-mingw32-XXX)
  • 32-bit MINGW (will build native 32-bit Windows applications): packages mingw64-i686-binutils, mingw64-i686-gcc-g++ (provides tools called i686-w64-mingw32-XXX)

Building GMP from sources

Instead of using the cygwin packages for GMP (mingw64-x86_64-gmp,mingw64-i686-gmp), GMP can be built from sources. Download sources from gmplib.org, then

    tar --xz -xf gmp-6.2.1.tar.xz

64-bit version

    % ./configure --host=x86_64-w64-mingw32 --disable-static --enable-shared --prefix=$ECLIPSETHIRDPARTY/gmp/x86_64_nt
    % make install

32-bit version

    % ./configure --host=i686-w64-mingw32 --disable-static --enable-shared --prefix=$ECLIPSETHIRDPARTY/gmp/i386_nt --disable-assembly
    % make install

(omitting --disable-assembly leads to a build error in version 6.2)

GMP 6.2 generates libgmp-10.dll

Edit - History - Print - Recent Changes - Search
Page last modified on October 23, 2021, at 11:35 AM