2

I'm trying to compile GDC (v2) on Windows 7, using MinGW's MSYS.

When I get to this step:

$ ../configure --enable-languages=d --disable-shared --disable-bootstrap

I get:

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.

Try the --with-gmp and/or --with-mpfr options to specify their locations.

Copies of these libraries' source code can be found at their respective hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also http://gcc.gnu.org/install/prerequisites.html for additional info. If you obtained GMP and/or MPFR from a vendor distribution package, make sure that you have installed both the libraries and the header files. They may be located in separate packages.

This made me look back at the instructions, which noted that it needs these libraries:

  • libgmp3-dev
  • libmpfr-dev
  • libmpc-dev

So now the question is, where do I find these headers and/or libraries? I've searched all over for libgmp3-dev, but I can't find anything for Windows. (I'm still in the learning process for *nix, so I'm not too familiar with anything.)

Thanks!


Update:

So I tried to make MPFR (I don't even know if it was the right version), and I got this error:

$ make install
Making install in tests
[...]
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/sh ./libtool   --mode=install /bin/install -c   libmpfr.la '/usr/local/lib'
libtool: install: /bin/install -c .libs/libmpfr.lai /usr/local/lib/libmpfr.la
libtool: install: /bin/install -c .libs/libmpfr.a /usr/local/lib/libmpfr.a
libtool: install: chmod 644 /usr/local/lib/libmpfr.a
libtool: install: ranlib /usr/local/lib/libmpfr.a
/bin/sh: /home/Home: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 127
make[2]: Leaving directory `/home/Home User/mpfr-2.4.2'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/Home User/mpfr-2.4.2'
make: *** [install-recursive] Error 1

Any ideas?

user541686
  • 205,094
  • 128
  • 528
  • 886
  • Look at the links in the error message for where to get those libraries. You might need to build them from source, but that is easy. It looks like the instruction page you linked is out of date (suggests older versions than the error message requires). – Jeremiah Willcock Mar 02 '11 at 20:17
  • Er... it's not like I missed the links in the error message; it's that the version isn't what I need (version 3 of libgmp). – user541686 Mar 02 '11 at 20:33

4 Answers4

3

From https://bitbucket.org/goshawk/gdc/wiki/MinGWCompile :

ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2

http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.bz2

Andrej Mitrović
  • 3,322
  • 3
  • 20
  • 33
  • @Andrej: OMG that worked!! Thanks a lot!! :D – user541686 Mar 04 '11 at 02:08
  • @Mehrdad: Good luck getting GDC to work on Windows. I've had no luck after numerous attempts. I can build GDC but GDC can't build a simple project for me. – Andrej Mitrović Mar 04 '11 at 16:07
  • @Andrej: Yeah, I think I'll need it... [I can't even get it to build](http://stackoverflow.com/questions/5189085/how-to-apply-a-gcc-patch) yet. – user541686 Mar 04 '11 at 16:34
  • @Mehrdad: I'll try to post a complete instruction on compiling GDC later today. I don't think you need to use TDM patches because the MinGW team has started to work on GCC 4.5.3+ already and they have the modified sources which can compile on Windows. But in any case, to use GNU Patch on Windows, use: patch -p0 < somepatch.patch – Andrej Mitrović Mar 05 '11 at 13:25
  • @Mehrdad: I can post the build instructions, but I can't get GDC to compile a simple .d file. It seems there are some undefined references that should be included in the Phobos lib file, but they're not. I've posted about it in the GDC issue tracker. Do you still want those instructions? – Andrej Mitrović Mar 05 '11 at 21:31
  • @Andrej: Whoa! Hm.. if you've already written the instructions, then sure! But otherwise, don't bother; this has all been really helpful already. =] Thanks for the help!! – user541686 Mar 05 '11 at 23:05
  • Well I've put the instructions here: https://gist.github.com/856901 But GDC currently can't compile anything for D2 because there are missing symbols. We'll see how this plays out in the following days. Patience is a virtue. :) – Andrej Mitrović Mar 06 '11 at 01:03
  • Ok, before you go compiling you'll have to un-comment the commented lines in monitor_.d which is located somewhere in /gdcbuild/gcc-4.5.2/gcc/d . See the following thread for more info and the comment: https://bitbucket.org/goshawk/gdc/issue/49/verify-mingw-build-instructions#comment-393457 I can confirm that gdc can now build simple projects (although stdio doesn't work yet). You have to uncomment before you run the step `./gcc/d/setup-gcc.sh --d-language-version=2` – Andrej Mitrović Mar 06 '11 at 04:16
  • You will need to apply one more patch for stdio to work. I've updated the manual and posted it here: https://gist.github.com/857381 This will be my last comment here, you should follow the GDC Bitbucket repository and issue tracker for anything new. Have fun. – Andrej Mitrović Mar 06 '11 at 16:14
0

http://gmplib.org/

http://www.mpfr.org/

Just download the source tarballs. As for building these, I don't remember the details (the instructions should be clear on this) but I know you can put these GMP and MPFR in the source tree with GCC and the GCC build process will automatically take care of building these. This may be easier than building/installing/setting environment variables for them as a discrete step.

dsimcha
  • 67,514
  • 53
  • 213
  • 334
  • Thanks for the links, but I've already done lots of Googling, and didn't find the versions I needed in any of those standard sites. Do you have the link to libgmp-3 specifically? (Later or earlier versions don't seem to work, that's why I asked the question.) – user541686 Mar 02 '11 at 21:34
0

I always use this for building gdc on Windows: http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php

Trass3r
  • 5,858
  • 2
  • 30
  • 45
-1

The error message you posted has the links to find the libraries. You might need to download their source code and compile them, but they are both easy to build.

Jeremiah Willcock
  • 30,161
  • 7
  • 76
  • 78
  • Er, the trouble is, I looked at the links, but they don't have the right versions of the libraries -- I need libgmp-3-dev, which isn't on those pages. (I'm not *that* dumb to not notice the links in the error message, lol. ;) ) – user541686 Mar 02 '11 at 20:31
  • @Mehrdad: You don't need version 3 of GMP; you need 4.1 or above, which is what is linked. The first link has downloads for the versions of both GMP and MPFR required by the error message. I think the instructions that said you needed GMP 3 are outdated. – Jeremiah Willcock Mar 02 '11 at 20:46
  • I tried this a while back with version 4, and I remember getting some errors. I'll try it again but I don't think it'll work... – user541686 Mar 02 '11 at 20:49
  • I'm a bit confused -- do I need to `make` the library? I don't see any `include` folder in GMP, not sure how to "install" it in MSYS... (right now I just executed `make`) – user541686 Mar 02 '11 at 21:01
  • @Mehrdad: Look at the `INSTALL` file in the tarball. You usually need `./configure; make; make install` for each of those packages, but you will need options to `configure` to set the prefix and such. – Jeremiah Willcock Mar 02 '11 at 21:38