www.digitalmars.com         C & C++   DMDScript  

D.gnu - Building GDC

reply "Steve Teale" <steve.teale britseyeview.com> writes:
I want to build gtkD. For that I need a version 2 GDC. Ubuntu is 
still on V2.

Are there any clear build instructions available, or even a 
binary ;=)
Oct 29 2013
parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
30.10.2013 11:58, Steve Teale пишет:
 I want to build gtkD. For that I need a version 2 GDC. Ubuntu is still
 on V2.

 Are there any clear build instructions available, or even a binary ;=)
http://gdcproject.org/wiki/Installation/General to build from source. Binary exists, but it's better to build from source.
Oct 29 2013
parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
On Wednesday, 30 October 2013 at 06:18:02 UTC, Alexandr Druzhinin 
wrote:
 30.10.2013 11:58, Steve Teale пишет:
 I want to build gtkD. For that I need a version 2 GDC. Ubuntu 
 is still
 on V2.

 Are there any clear build instructions available, or even a 
 binary ;=)
http://gdcproject.org/wiki/Installation/General to build from source. Binary exists, but it's better to build from source.
OK, got all the tools installed and the build for GDC went on for some time, but eventually bombed out with: checking for suffix of object files... configure: error: in `/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile Help? Out of my depth.
Oct 31 2013
next sibling parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
On 31 October 2013 08:34, Steve Teale <steve.teale britseyeview.com> wrote:

 On Wednesday, 30 October 2013 at 06:18:02 UTC, Alexandr Druzhinin wrote:

 30.10.2013 11:58, Steve Teale =D0=BF=D0=B8=D1=88=D0=B5=D1=82:

 I want to build gtkD. For that I need a version 2 GDC. Ubuntu is still
 on V2.

 Are there any clear build instructions available, or even a binary ;=3D=
)

 http://gdcproject.org/wiki/**Installation/General<http://gdcproject.org/=
wiki/Installation/General>to build from source. Binary exists, but it's bet= ter to build from source.

 OK, got all the tools installed and the build for GDC went on for some
 time, but eventually bombed out with:

 checking for suffix of object files... configure: error: in
 `/home/steve/gdc/objdir/i686-**pc-linux-gnu/libgcc':
 configure: error: cannot compute suffix of object files: cannot compile

 Help? Out of my depth.
Hello Steve, It's been a while since you've poked your head round here. ;-) This error message you are getting is quite misleading and frequently the problem has nothing to do with the message. You have to check the file 'config.log' in the directory where the error occurred. In the error you are getting, you would have to check the 'config.log' file in the directory '/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc'. There might be several test programs that failed during the configuration, but some of these failures are non-critical. Check for the last error entry in the file. However a common cause is that the tequired libraries for the GCC build are missing, specifically MPFR, GMP and MPC. In Ubuntu, even if these packages are installed, they are put into multiarch directories which vanilla GCC isn't aware of. Can you export the following two environment variables, and see if it continues to fail. export CPATH=3D/usr/include/i686-linux-gnu export LIBRARY_PATH=3D/usr/lib/i686-linux-gnu --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';
Oct 31 2013
next sibling parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
 OK, got all the tools installed and the build for GDC went on 
 for some
 time, but eventually bombed out with:

 checking for suffix of object files... configure: error: in
 `/home/steve/gdc/objdir/i686-**pc-linux-gnu/libgcc':
 configure: error: cannot compute suffix of object files: 
 cannot compile

 Help? Out of my depth.
Hello Steve, It's been a while since you've poked your head round here. ;-) This error message you are getting is quite misleading and frequently the problem has nothing to do with the message. You have to check the file 'config.log' in the directory where the error occurred. In the error you are getting, you would have to check the 'config.log' file in the directory '/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc'. There might be several test programs that failed during the configuration, but some of these failures are non-critical. Check for the last error entry in the file. However a common cause is that the tequired libraries for the GCC build are missing, specifically MPFR, GMP and MPC. In Ubuntu, even if these packages are installed, they are put into multiarch directories which vanilla GCC isn't aware of. Can you export the following two environment variables, and see if it continues to fail. export CPATH=/usr/include/i686-linux-gnu export LIBRARY_PATH=/usr/lib/i686-linux-gnu
Ian, It would not start the build at all until I installed the latest versions of GMO, MPFR, and MPC With the export commands I got the same error. The last error in config.log was configure:3605: error: in `/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc': configure:3608: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. However there is an error before that /home/steve/gdc/objdir/./gcc/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory so possibly the MPFR install put it in the wrong place. I will look for it. Where is the right place? Thanks Steve
Oct 31 2013
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 11:31, Steve Teale wrote:
 so possibly the MPFR install put it in the wrong place. I will look for it.
 Where is the right place?
What OS are you running?
Oct 31 2013
parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
On Thursday, 31 October 2013 at 10:45:05 UTC, Joseph Rushton 
Wakeling wrote:
 On 31/10/13 11:31, Steve Teale wrote:
 so possibly the MPFR install put it in the wrong place. I will 
 look for it.
 Where is the right place?
What OS are you running?
Ubuntu 12.04
Oct 31 2013
next sibling parent reply Alexandr Druzhinin <drug2004 bk.ru> writes:
31.10.2013 18:36, Steve Teale пишет:
 On Thursday, 31 October 2013 at 10:45:05 UTC, Joseph Rushton Wakeling
 wrote:
 On 31/10/13 11:31, Steve Teale wrote:
 so possibly the MPFR install put it in the wrong place. I will look
 for it.
 Where is the right place?
What OS are you running?
Ubuntu 12.04
Ubuntu 12.04 x86_64 user here, I build gdc 4.8.1 following instructions I link above without issues, so I don't know what to do - but I'm sure it's possible :) P.S. I have mpfr in /usr/lib/x86_64-linux-gnu/
Oct 31 2013
next sibling parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 12:46, Alexandr Druzhinin wrote:
 Ubuntu 12.04 x86_64 user here, I build gdc 4.8.1 following instructions I link
 above without issues, so I don't know what to do - but I'm sure it's possible
:)

 P.S. I have mpfr in /usr/lib/x86_64-linux-gnu/
In my case the 12.04 build platform was 64-bit Opteron, but I think that still counts as x86_64, no?
Oct 31 2013
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Thursday, 31 October 2013 at 11:54:14 UTC, Joseph Rushton 
Wakeling wrote:
 On 31/10/13 12:46, Alexandr Druzhinin wrote:
 Ubuntu 12.04 x86_64 user here, I build gdc 4.8.1 following 
 instructions I link
 above without issues, so I don't know what to do - but I'm 
 sure it's possible :)

 P.S. I have mpfr in /usr/lib/x86_64-linux-gnu/
In my case the 12.04 build platform was 64-bit Opteron, but I think that still counts as x86_64, no?
Yup.
Oct 31 2013
prev sibling parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
On Thursday, 31 October 2013 at 11:46:25 UTC, Alexandr Druzhinin 
wrote:
 31.10.2013 18:36, Steve Teale пишет:
 On Thursday, 31 October 2013 at 10:45:05 UTC, Joseph Rushton 
 Wakeling
 wrote:
 On 31/10/13 11:31, Steve Teale wrote:
 so possibly the MPFR install put it in the wrong place. I 
 will look
 for it.
 Where is the right place?
What OS are you running?
Ubuntu 12.04
Ubuntu 12.04 x86_64 user here, I build gdc 4.8.1 following instructions I link above without issues, so I don't know what to do - but I'm sure it's possible :) P.S. I have mpfr in /usr/lib/x86_64-linux-gnu/
My 12.04 is 32 bit. MPFR is in /usr/local/lib and /usr/local/include $CPATH and $LIBRARY_PATH were initially empty, and the build failed as decribed. I set them to the paths above, and the build failed in the same way. Make distclean in between, and deleted all the config.cache files.
Oct 31 2013
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 13:07, Steve Teale wrote:
 $CPATH and $LIBRARY_PATH were initially empty, and the build failed as
decribed.
 I set them to the paths above, and the build failed in the same way.
Did you try my detailed list of instructions for building using GCC 4.8 sources?
Oct 31 2013
parent "Steve Teale" <steve.teale britseyeview.com> writes:
On Thursday, 31 October 2013 at 12:49:38 UTC, Joseph Rushton 
Wakeling wrote:
 On 31/10/13 13:07, Steve Teale wrote:
 $CPATH and $LIBRARY_PATH were initially empty, and the build 
 failed as decribed.
 I set them to the paths above, and the build failed in the 
 same way.
Did you try my detailed list of instructions for building using GCC 4.8 sources?
Yes, for the Nth time just now. Failed as described. It recompiled a lot of C++ files that it had got past before, then failed in the same way.
Oct 31 2013
prev sibling parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 12:36, Steve Teale wrote:
 On Thursday, 31 October 2013 at 10:45:05 UTC, Joseph Rushton Wakeling wrote:
 On 31/10/13 11:31, Steve Teale wrote:
 so possibly the MPFR install put it in the wrong place. I will look for it.
 Where is the right place?
What OS are you running?
Ubuntu 12.04
Ahh, OK. What GCC source are you attempting to build from? I think that 4.7 (which lacks multiarch support) is probably not worth building against any more. I did try building against 4.7 from the deb-src package, ages ago, but I don't think I ever got it working. I _did_ get it working from the source of the gcc-snapshot package, but I'd advise against that. I've built successfully on a 12.04 install (a university cluster) using the 4.8.1 sources (haven't updated it recently as I've been running everything on my local machine), downloaded directly from gcc.gnu.org; now, of course, you'll want 4.8.2, which should also work fine. Supposing that you're using $SOMEDIR/gdc to store everything, a rough description of the procedure would be: * Clone GDC master into gdc/dev * Unzip the GCC source into gdc, which will give you a subdirectory called gcc-$VERSION (currently gcc-4.8.2) * cd into gdc/dev and run ./setup-gcc.sh ../gcc-4.8.2 * cd back into gdc, create gdc/objdir, cd gdc/objdir * Run configure and make. Here's how I like to run configure for a release build: ../gcc-4.8.2/configure --enable-languages=d --disable-multilib --enable-multiarch --enable-checking=release --prefix=/opt/gdc You can miss off the --enable-multiarch -- which will also probably speed up your build time. With this you shouldn't need to custom-set CPATH or LPATH. Does it work for you? Best wishes, -- Joe
Oct 31 2013
parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
 Supposing that you're using $SOMEDIR/gdc to store everything, a 
 rough description of the procedure would be:

     * Clone GDC master into gdc/dev

     * Unzip the GCC source into gdc, which will give you a 
 subdirectory
       called gcc-$VERSION (currently gcc-4.8.2)

     * cd into gdc/dev and run ./setup-gcc.sh ../gcc-4.8.2

     * cd back into gdc, create gdc/objdir, cd gdc/objdir

     * Run configure and make.

 Here's how I like to run configure for a release build:

 ../gcc-4.8.2/configure --enable-languages=d --disable-multilib 
 --enable-multiarch --enable-checking=release --prefix=/opt/gdc

 You can miss off the --enable-multiarch -- which will also 
 probably speed up your build time.

 With this you shouldn't need to custom-set CPATH or LPATH.  
 Does it work for you?
I'm using gcc 4.8.2 - procedure as you describe and as per gdcproject wiki This is on 32bit Ubuntu 12.04 Console output prior to the error is: ... make[2]: Entering directory `/home/steve/gdc/objdir/gcc' make[2]: Leaving directory `/home/steve/gdc/objdir/gcc' Checking multilib configuration for libgcc... Configuring in i686-pc-linux-gnu/libgcc configure: loading cache ./config.cache checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for --enable-version-specific-runtime-libs... no checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... mawk checking for i686-pc-linux-gnu-ar... ar checking for i686-pc-linux-gnu-lipo... lipo checking for i686-pc-linux-gnu-nm... /home/steve/gdc/objdir/./gcc/nm checking for i686-pc-linux-gnu-ranlib... ranlib checking for i686-pc-linux-gnu-strip... strip checking whether ln -s works... yes checking for i686-pc-linux-gnu-gcc... /home/steve/gdc/objdir/./gcc/xgcc -B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ -B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem /opt/gdc/i686-pc-linux-gnu/include -isystem /opt/gdc/i686-pc-linux-gnu/sys-include checking for suffix of object files... configure: error: in `/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/steve/gdc/objdir' make: *** [all] Error 2 The config.log file from .../gdc/objdir/gcc has the following errors I marked with ****: xgcc: error: unrecognized command line option '-V' **** xgcc: fatal error: no input files compilation terminated. configure:3358: $? = 1 configure:3347: /home/steve/gdc/objdir/./gcc/xgcc -B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ -B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem /opt/gdc/i686-pc-linux-gnu/include -isystem /opt/gdc/i686-pc-linux-gnu/sys-include -qversion >&5 **** xgcc: error: unrecognized command line option '-qversion' **** xgcc: fatal error: no input files compilation terminated. configure:3358: $? = 1 configure:3374: /home/steve/gdc/objdir/./gcc/xgcc -B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ -B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem /opt/gdc/i686-pc-linux-gnu/include -isystem /opt/gdc/i686-pc-linux-gnu/sys-include -o conftest -g -O2 conftest.c >&5 **** /home/steve/gdc/objdir/./gcc/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory configure:3377: $? = 1 configure:3565: checking for suffix of object files configure:3587: /home/steve/gdc/objdir/./gcc/xgcc -B/home/steve/gdc/objdir/./gcc/ -B/opt/gdc/i686-pc-linux-gnu/bin/ -B/opt/gdc/i686-pc-linux-gnu/lib/ -isystem /opt/gdc/i686-pc-linux-gnu/include -isystem /opt/gdc/i686-pc-linux-gnu/sys-include -c -g -O2 conftest.c
&5
**** /home/steve/gdc/objdir/./gcc/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory configure:3591: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU C Runtime Library" | #define PACKAGE_TARNAME "libgcc" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU C Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3605: error: in `/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc': configure:3608: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. There are xgcc errors, and a shared library for MPFR that can't be found. The offending file libmpfr.so.1 is in /usr/local/lib, and the corresponding header file in /usr/local/include Setting $LIBRARY_PATH and $CPATH to these values does not effect the outcome - they were initially blank - fails both ways. Where does the build process look for this. Stumbling blindly Steve
Oct 31 2013
parent reply Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 13:45, Steve Teale wrote:
 There are xgcc errors, and a shared library for MPFR that can't be found.
This is a guess, but ... as it looks like the build process might be being incorrectly configured, are there any warnings in the log about needing different versions of automake, etc. from what is actually installed? I have some recollection of (at one time) getting messages telling me that I needed a certain version installed.
Oct 31 2013
parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
Mea Culpa.

In attempting to install the prerequisites

libmpc-dev
libmpfr-dev
libgmp3-dev

I ended up building from the source code for these projects.

Later, back to square one, I simply installed them using apt-get.

Then the build worked.

Grovel, grovel, my apologies to those whose time I wasted ;=(

Steve
Oct 31 2013
next sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 18:33, Steve Teale wrote:
 Mea Culpa.
Don't worry about it. It's always good to know how builds can go wrong for people, because that helps the next person who runs into difficulty. Glad you finally got it built! :-)
Oct 31 2013
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Oct 31, 2013 at 06:33:50PM +0100, Steve Teale wrote:
 Mea Culpa.
 
 In attempting to install the prerequisites
 
 libmpc-dev
 libmpfr-dev
 libgmp3-dev
 
 I ended up building from the source code for these projects.
 
 Later, back to square one, I simply installed them using apt-get.
 
 Then the build worked.
 
 Grovel, grovel, my apologies to those whose time I wasted ;=(
[...] No worries, the gcc build system is a sensitive, fragile beast that requires lots of TLC. I had a hard time getting the build to work until Joseph kindly provided detailed steps on how to do it. It might be good if you write up in detail all the steps you took (starting from a blank slate) to get the build working, and compare that with the current instructions on the wiki, and add any missing details. This stuff needs to be documented in a detailed way so that people can reliably produce a working compiler; I conjecture that many people simply gave up when their first attempt failed, and thus got turned away from GDC. :-/ T -- Nobody is perfect. I am Nobody. -- pepoluan, GKC forum
Oct 31 2013
prev sibling parent reply "Steve Teale" <steve.teale britseyeview.com> writes:
On Thursday, 31 October 2013 at 17:33:52 UTC, Steve Teale wrote:
 Mea Culpa.

 In attempting to install the prerequisites

 libmpc-dev
 libmpfr-dev
 libgmp3-dev

 I ended up building from the source code for these projects.

 Later, back to square one, I simply installed them using 
 apt-get.

 Then the build worked.

 Grovel, grovel, my apologies to those whose time I wasted ;=(

 Steve
My recipe can be found at britseyeview.com/software/buildGDC.txt I hope this will save others some grief.
Oct 31 2013
next sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 19:38, Steve Teale wrote:
 My recipe can be found at britseyeview.com/software/buildGDC.txt

 I hope this will save others some grief.
Nice writeup! :-) One thing -- about tweaking the PATH variable -- I find it useful to have a little script for this, /etc/profile.d/opt.sh : for d in /opt/*/bin; do test -d "$d" || continue case :$PATH:$ in *:"$d":*);; *) PATH=${PATH:+$PATH:}$d;; esac done Should be generally POSIX-compatible, not just working with bash or Linux. N.B. I can't take credit for this. I'd written a simpler version which didn't check if a directory was already in the PATH; some nice person on the Ubuntu Forums suggested the above as an alternative.
Nov 01 2013
prev sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 31 October 2013 18:38, Steve Teale <steve.teale britseyeview.com> wrote:

 On Thursday, 31 October 2013 at 17:33:52 UTC, Steve Teale wrote:

 Mea Culpa.

 In attempting to install the prerequisites

 libmpc-dev
 libmpfr-dev
 libgmp3-dev

 I ended up building from the source code for these projects.

 Later, back to square one, I simply installed them using apt-get.

 Then the build worked.

 Grovel, grovel, my apologies to those whose time I wasted ;=(

 Steve
My recipe can be found at britseyeview.com/software/**buildGDC.txt<http://britseyeview.com/software/buildGDC.txt> I hope this will save others some grief.
Feel free to take some time improving this documentation: http://wiki.dlang.org/GDC/Installation/Generic Thanks -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Nov 01 2013
prev sibling parent "Steve Teale" <steve.teale britseyeview.com> writes:
 Hello Steve,

 It's been a while since you've poked your head round here.  ;-)

 This error message you are getting is quite misleading and 
 frequently the
 problem has nothing to do with the message.  You have to check 
 the file
 'config.log' in the directory where the error occurred.  In the 
 error you
 are getting, you would have to check the 'config.log' file in 
 the directory
 '/home/steve/gdc/objdir/i686-pc-linux-gnu/libgcc'.  There might 
 be several
 test programs that failed during the configuration, but some of 
 these
 failures are non-critical.  Check for the last error entry in 
 the file.

 However a common cause is that the tequired libraries for the 
 GCC build are
 missing, specifically MPFR, GMP and MPC.

 In Ubuntu, even if these packages are installed, they are put 
 into
 multiarch directories which vanilla GCC isn't aware of.

 Can you export the following two environment variables, and see 
 if it
 continues to fail.

 export CPATH=/usr/include/i686-linux-gnu
 export LIBRARY_PATH=/usr/lib/i686-linux-gnu
I have libmpfr.so.4, so what do I need to change to make the build look for that instead - shall I just rename the link?
Oct 31 2013
prev sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On 31/10/13 09:59, Iain Buclaw wrote:
 In Ubuntu, even if these packages are installed, they are put into multiarch
 directories which vanilla GCC isn't aware of.
Has not been my experience for GCC 4.8+. I don't think I have any custom CPATH or LPATH settings on my Ubuntu 13.10 system.
Oct 31 2013