www.digitalmars.com         C & C++   DMDScript  

D.gnu - GDC and FreeBSD

reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
Hi,
I built GDC 0.12 from ports on the FreeBSD 5.4 (make install clean).
When I tryed to compile a simple test app (gdc -o test test.d), 
I got following error:
object.d: cannot read file 'object.d'
what's wrong? Does it need some additional configuration?

--
ub
Jun 02 2005
parent reply clayasaurus <clayasaurus gmail.com> writes:
U.Baumanis wrote:
 Hi,
 I built GDC 0.12 from ports on the FreeBSD 5.4 (make install clean).
 When I tryed to compile a simple test app (gdc -o test test.d), 
 I got following error:
 object.d: cannot read file 'object.d'
 what's wrong? Does it need some additional configuration?
 
 --
 ub
 
 

do you have phobos in the right path?
Jun 06 2005
parent reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
In article <d81poi$g0k$2 digitaldaemon.com>, clayasaurus says...
U.Baumanis wrote:
 Hi,
 I built GDC 0.12 from ports on the FreeBSD 5.4 (make install clean).
 When I tryed to compile a simple test app (gdc -o test test.d), 
 I got following error:
 object.d: cannot read file 'object.d'
 what's wrong? Does it need some additional configuration?
 
 --
 ub
 
 

do you have phobos in the right path?

I don't remember exactly now (it is on an another computer), but I think it is in /usr/local/lib and there is also spec file. At least place looked ok, and there was other libs too. -- ub
Jun 06 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
U.Baumanis wrote:

do you have phobos in the right path?

I don't remember exactly now (it is on an another computer), but I think it is in /usr/local/lib and there is also spec file. At least place looked ok, and there was other libs too.

The library is libgphobos.a, in your "lib" folder. Spec file contains additional libraries to link in. You also need "include/d/$GCC_VERS/", with object.d, which has the import modules ("headers") that D needs --anders PS. $GCC_VERS would be your GCC version, 3.3.x or 3.4.y
Jun 07 2005
parent reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
In article <d83glu$1poh$1 digitaldaemon.com>,
=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
The library is libgphobos.a, in your "lib" folder.
Spec file contains additional libraries to link in.

You also need "include/d/$GCC_VERS/", with object.d,
which has the import modules ("headers") that D needs

--anders

PS. $GCC_VERS would be your GCC version, 3.3.x or 3.4.y

Yes, I also have files in include/d/$GCC_VERS/ When I run gcc --version and gdc --version, they have different numbers. gcc is 3.4.2 (system compiler), but gdc is 3.4.5. For gdc compilation I had to use gcc 3.4.5 core libs (make procedure fetched this files for me) Do I have to set up some environment variable to use gdc? -- ub
Jun 07 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
U.Baumanis wrote:

 For gdc compilation I had to use gcc 3.4.5 core libs 
 (make procedure fetched this files for me)
 Do I have to set up some environment variable to use gdc?

Just PATH. I think your versions of GCC should be compatible, but you could also build a new gcc and a g++ too while you're at it ? Like: --enable-languages=c,c++,d You might want to bring the good old "Overbombing" and trace your call to gdc and see what files it really tries to load ? Not sure what the command is on FreeBSD, though. (e.g "strace") You did run the simpler "gdc --verbose nothing.d" first, right ? --anders
Jun 07 2005
parent reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
In article <d83k0v$1tij$1 digitaldaemon.com>,
=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
U.Baumanis wrote:

 For gdc compilation I had to use gcc 3.4.5 core libs 
 (make procedure fetched this files for me)
 Do I have to set up some environment variable to use gdc?

Just PATH. I think your versions of GCC should be compatible, but you could also build a new gcc and a g++ too while you're at it ? Like: --enable-languages=c,c++,d You might want to bring the good old "Overbombing" and trace your call to gdc and see what files it really tries to load ? Not sure what the command is on FreeBSD, though. (e.g "strace") You did run the simpler "gdc --verbose nothing.d" first, right ? --anders

gcc core and g++ 3.4.5 libs was compiled when i built gdc. but when I run gcc --version it is still 3.4.2 (default compiler). Does it mean that I can run gcc 3.4.5 by some configuration also, or it's only libs needed for gdc? What about PATH? gdc is already on the path. I can run it. Looks like it can not find files in include/d/$GCC_VERS Is this $GCC_VERS known env variable for gcc? Do I have to set it to the version of gdc. Do gcc and gdc versions must mach? Do I have to configure default gcc? Or do I have to specify path to include/d/$GCC_VERS somewhere? -- ub
Jun 07 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
U.Baumanis wrote:

 gcc core and g++ 3.4.5 libs was compiled when i built gdc.
 but when I run gcc --version it is still 3.4.2 (default compiler).
 Does it mean that I can run gcc 3.4.5 by some configuration also, 
 or it's only libs needed for gdc?

If the versions of GCC are "compatible" (depends on versions/patches), then you can use the system C/C++ compilers and link to their libs too. I use this with GCC 3.3, on the Mac. (under /usr) If they are "different", then you need to install GDC in an odd location along with the built versions of gcc / g++ (that were compiled with GDC) I use this with GCC 3.4, on the Mac. (in /opt/gdc)
 What about PATH? gdc is already on the path. I can run it.

You only need to set PATH if installed in an odd prefix ? (with --prefix=/opt/gdc, for instance: PATH=/opt/gdc/bin)
 Looks like it can not find files in include/d/$GCC_VERS
 Is this $GCC_VERS known env variable for gcc? Do I have to set it to
 the version of gdc. Do gcc and gdc versions must mach? 

If you have gdc in foo/bin/gdc, then it will automatically search in foo/include/d and foo/include/d/$GCC_VERS dirs. You can add additional search directories with the -I flag. HTH, --anders
Jun 07 2005
parent reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
If the versions of GCC are "compatible" (depends on versions/patches),
then you can use the system C/C++ compilers and link to their libs too.

I use this with GCC 3.3, on the Mac. (under /usr)

If they are "different", then you need to install GDC in an odd location
along with the built versions of gcc / g++ (that were compiled with GDC)

I use this with GCC 3.4, on the Mac. (in /opt/gdc)

 What about PATH? gdc is already on the path. I can run it.

You only need to set PATH if installed in an odd prefix ? (with --prefix=/opt/gdc, for instance: PATH=/opt/gdc/bin)
 Looks like it can not find files in include/d/$GCC_VERS
 Is this $GCC_VERS known env variable for gcc? Do I have to set it to
 the version of gdc. Do gcc and gdc versions must mach? 

If you have gdc in foo/bin/gdc, then it will automatically search in foo/include/d and foo/include/d/$GCC_VERS dirs. You can add additional search directories with the -I flag. HTH, --anders

Ok, thanks! I will play with it in evening again! :-) May be gdc don't look in include/d/3.4.5/ because default gcc is 3.4.2? Do I have to force it with -V 3.4.5 ? -- ub
Jun 07 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
U.Baumanis wrote:
  I will play with it in evening again! :-)
 
 May be gdc don't look in include/d/3.4.5/
 because default gcc is 3.4.2?
 
 Do I have to force it with -V 3.4.5 ?

Nah, the GCC version under include/d is the version of GCC that you patched with GDC in order to build your "gdc" binary ? It doesn't have anything to do with the system/default GCC version, really... --anders
Jun 07 2005
parent reply U.Baumanis <U.Baumanis_member pathlink.com> writes:
In article <d83qvu$22ve$1 digitaldaemon.com>,
=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
U.Baumanis wrote:
  I will play with it in evening again! :-)
 
 May be gdc don't look in include/d/3.4.5/
 because default gcc is 3.4.2?
 
 Do I have to force it with -V 3.4.5 ?

Nah, the GCC version under include/d is the version of GCC that you patched with GDC in order to build your "gdc" binary ? It doesn't have anything to do with the system/default GCC version, really... --anders

Ok, then option is to use gdc with -I flag? Or can I set an include path in some config file for gdc? -- ub
Jun 07 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
U.Baumanis wrote:

 Ok, then option is to use gdc with -I flag?
 Or can I set an include path in some config file for gdc?

I would just set it in the Makefile, but you can add it to the DFLAGS environment variable (for "gdmd") too... Or better yet, install Phobos in the advised location ? :-) You can still keep your own import modules in some odd place. --anders
Jun 09 2005
prev sibling parent tim desert.net writes:
In article <d83t0k$24rc$1 digitaldaemon.com>, U.Baumanis says...
Ok, then option is to use gdc with -I flag?
Or can I set an include path in some config file for gdc?

Hi! I played around with this and got it working; it requires tweaking the ports Makefile, and also modifying a file in the work directory. So, first edit the /usr/ports/lang/gdc/Makefile, and set: # Add -gdc so libstdc++-v3 will install in correct place # Also, see version_string in gcc/version.c __GCC_VERSION=3.4.5-gdc Next, change the do-install target: do-install: cd ${WRKSRC} && ${GMAKE} install (Make sure that's a TAB, not 8 spaces, before the ' '.) Now, run 'make patch', and then edit the work/*/gcc/version.c file, and set version_string="3.4.5-gdc ...". Now, the full install can be done without conflicting with any other gcc port, and you'll no longer need to pass the -I flags to get gdc to find phobos. I've sent this to the port maintainer, and he seemed keen to fix the port. Hopefully when he upgrades to 0.15 he'll be able to fix this as well. Regards, Tim
Jul 23 2005