FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

linux again
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic     Forum Index -> Ares
View previous topic :: View next topic  
Author Message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Feb 22, 2006 12:14 am    Post subject: Reply with quote

Thanks Sean!

Your efforts are much appreciated. I'm looking forward to making use of Ares on Linux exclusively.

-JJR
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Wed Feb 22, 2006 1:46 pm    Post subject: Reply with quote

Sure thing Smile Posix header changes will be filtering in over the next few days.

Finished (theoretically):

inttypes
pthread
sched
semaphore
unistd

In progress:

signal
time
sys/types
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Wed Feb 22, 2006 1:57 pm    Post subject: Reply with quote

By the way. If anyone wants to submit C header patches, please use the "c_long" alias from std.c.config for any "long" or "long int" types, and "c_ulong" for any "unsigned long" or "unsigned long int" types. This should (hopefully) allow for 64-bit OS compatibility without header changes.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Thu Feb 23, 2006 3:07 pm    Post subject: Reply with quote

Okay, I think the POSIX headers are complete for Linux builds. If anyone notices a problem, please let me know.

I need to double-check the diffs Kashia sent me to make sure everything is in for darwin, so if anyone feels inclined to test that in the meantime please let me know if there are any problems (I'd been editing the files so much that an automated merge didn't work so I did it manually).

The last step will be to finish std.thread which should take another day or two. If anyone is incredibly eager to get all this working, it should be sufficient to do whatever is necessary to get std.thread to build and then simply avoid multithreaded programming for now.
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Sat Feb 25, 2006 2:27 am    Post subject: Reply with quote

doing make -f linux.mak here (Kubuntu Breezy) on revision 301, I get

Code:

dmd -c -release -O -inline -version=Posix -I. std/thread.d -ofstd/thread.o
std/thread.d(221): undefined identifier segdelset
std/thread.d(221): undefined identifier SIGUSER2
std/thread.d(221): function expected before (), not segdelset of type int
make[1]: *** [std/thread.o] Error 1
make[1]: Leaving directory `/media/sda5/data/d/ares/trunk/src/ares'
make: *** [all] Error 2
Back to top
View user's profile Send private message
jcomellas



Joined: 30 Jan 2006
Posts: 22
Location: Buenos Aires, Argentina

PostPosted: Sat Feb 25, 2006 10:33 am    Post subject: Reply with quote

larsivi wrote:
doing make -f linux.mak here (Kubuntu Breezy) on revision 301, I get

Code:

dmd -c -release -O -inline -version=Posix -I. std/thread.d -ofstd/thread.o
std/thread.d(221): undefined identifier segdelset
std/thread.d(221): undefined identifier SIGUSER2
std/thread.d(221): function expected before (), not segdelset of type int
make[1]: *** [std/thread.o] Error 1
make[1]: Leaving directory `/media/sda5/data/d/ares/trunk/src/ares'
make: *** [all] Error 2


There are some patches for these problems in the ticket at http://trac.dsource.org/projects/ares/ticket/3, in case you want to try them.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sat Feb 25, 2006 10:49 am    Post subject: Reply with quote

Thanks.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sat Feb 25, 2006 3:58 pm    Post subject: Reply with quote

Okay, Ares should now build on Linux using DMD. Build each of the three libraries individually, then assemble them all into one library via something like this:
Code:
ar -r libphobos.a ares.a dmdgc.a dmdrt.a
Finally, update your include search path to look in the ares directory instead of dmd/include, and link your apps against the newly created libphobos. I'm a bit stuck on the last step as dmd links via "gcc -lphobos blah" and I haven't figured out where to put the new libphobos library to have everything resolve correctly, so if someone could explain that last step I'd be much obliged Smile When I get around to it I'll create a build/install script similar to build.bat for Windows, though doing all this manually is pretty easy anyway.

Next step will be to make sure Ares actually works, that thread support is sorted, etc, then I'll take a look at GDC.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat Feb 25, 2006 5:55 pm    Post subject: Reply with quote

Excellent work!

It builds now. Thanks again, Sean.

I'll have to start testing it soon.

-JJR
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Fri Mar 03, 2006 6:31 pm    Post subject: Reply with quote

Okay, quick update on how to make Ares on Linux. Build each of the libraries as normal, then go up one directory to ares/trunk/src and issue this command:
Quote:
find . -name "*.o" | xargs ar -r libphobos.a

Apparently, assembling libraries from other libraries doesn't actually work--you need to do it from the object files. Then copy this library to /usr/lib so the linker will find it. I'm still seeing link errors, but hopefully those can be resolved shortly.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sat Mar 04, 2006 8:38 pm    Post subject: Reply with quote

One last update. I've improved the 'linux.mak' that lives in trunk/src, so you should now be able to build and install Ares just by using that. Just do:
Quote:
make -flinux.mak
make install -flinux.mak

And trunk/lib will end up with libphobos.a and trunk/doc with the docs. There's still one remaining issue preventing an app from linking against Ares on Linux (the ModuleInfo problem), but I'm holding off on any hacks to fix that for now, as I'm hoping a better solution will present itself.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Fri Mar 31, 2006 5:55 pm    Post subject: Reply with quote

The scripts lightoze supplied have me able to successfully link against Ares on Linux. Here's a quick rundown of the current process (from the top of the Ares SVN tree)):

> cd trunk/src
> ./fix_dfiles.sh
> make clean -flinux.mak
> make -flinux.mak
> make install -flinux.mak
> sudo cp libphobos.a /usr/lib/.

Then copy the Ares source to your include directory.

The makefile for the Ares project itself actually includes a commented-out line which will generate D include (.di) files, but since these include version blocks just as the source files do, there's no substantial advantage to use them. This also means that you need to compile your D apps with "-version=Posix" set for everything to work correctly.

So far, I haven't been able to get a D app to generate any output on Linux. I haven't had a chance to sort out the cause however, so it may be a link order issue, something in dmain2, etc. lightoze doesn't seem to have this problem so I suspect it may be related to link order, though I'm really hoping it isn't. If anyone figured this out before I do, please post here Smile

By the way, the scripts and such mentioned above are checked into SVN but aren't in the latest Ares release, so you'll have to download them via a SVN client. Also, if you want to re-synch with SVN later you'll need to do this (from the top of the Ares SVN tree):

> svn revert -R *
> svn update

Then re-run the script above, re-build, etc.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat May 06, 2006 11:18 pm    Post subject: Reply with quote

So I guess the linux version still isn't working properly? I still get lots of errors. I also noted that there are std.c.* files that shouldn't be compiled into libphobos.a (see Walter's phobos to see what I mean).

I tried changing that and it didn't fix any of the problems. This is becoming a really difficult problem to fix for Ares on linux.

Any progress with anybody else?

I also note that the included scripts just seem to add a unittest {} to the end of all the D files for some reason. Was this the workaround?

One other thing: ares is currently compiled with -release -O -inline flags... some potentially hazardous flags: aren't -inline and -O buggy?

-JJR


Last edited by JJR on Sat May 06, 2006 11:49 pm; edited 2 times in total
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat May 06, 2006 11:45 pm    Post subject: Reply with quote

Before I forget, there's a couple problems with the current build:

- intrinsic.d imports config.d which doesn't exist. I had to comment that line out.

- std/c/posix/ucontext.d imports tries to import std.c.signal. It should be std.c.posix.signal.

The library builds once these are fixed (but naturally still isn't linking).

-JJR
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sun May 07, 2006 12:50 pm    Post subject: Reply with quote

Oops, thanks. The files are now fixed.

As for linking... that should be possible using my instructions. The latest zipfile release contains a linkable library created with this method.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Ares All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group