Issue277

Title makefile doesn't work on OS X
Priority wish Status resolved
Superseder Nosy List emilkeyder, malte
Assigned To emilkeyder Keywords
Optional summary

Created on 2011-09-09.20:02:31 by emilkeyder, last changed by malte.

Files
File name Uploaded Type Edit Remove
Makefile emilkeyder, 2011-09-09.20:02:30 application/octet-stream
Messages
msg1900 (view) Author: malte Date: 2011-11-09.21:25:57
Thank you! :-)
msg1899 (view) Author: emilkeyder Date: 2011-11-09.21:10:03
Works for me. Thanks!

On Wed, Nov 9, 2011 at 7:51 PM, Malte Helmert
<downward.issues@googlemail.com> wrote:
>
> Malte Helmert <malte.helmert@unibas.ch> added the comment:
>
> Merged, but I also refactored it a bit, so I may have broken it again. It'd be
> great if you could try out the latest version and let me know if it works now.
>
> ----------
> assignedto:  -> emilkeyder
> status: chatting -> resolved
>
> _______________________________________________________
> Fast Downward issue tracker <downward.issues@gmail.com>
> <http://issues.fast-downward.org/issue277>
> _______________________________________________________
>
msg1898 (view) Author: malte Date: 2011-11-09.19:51:56
Merged, but I also refactored it a bit, so I may have broken it again. It'd be
great if you could try out the latest version and let me know if it works now.
msg1897 (view) Author: emilkeyder Date: 2011-11-08.23:25:33
By the way, COIN doesn't compile on OS X. I got it to compile once, but it 
involved lots and lots of hacks and changes that would be impossible to put in a 
Makefile. Everything else should work normally though.
msg1896 (view) Author: emilkeyder Date: 2011-11-08.23:21:06
I think it's fairly universally true, that is, there's a way to manually compile 
the library that allows static linking (lcrt0) and then do it, but from googling a 
bit it seems that it's a difficult hack and few people, if anyone, actually have it 
working. 

I added a branch to my public repository with the required changes to the makefiles 
in preprocess and search, let me know if you see any problems.
msg1895 (view) Author: malte Date: 2011-11-08.19:46:10
> - OS X doesn't allow for static compilation, so these flags have to removed

Is that universally true? I'm asking because on Linux static compilation usually
doesn't work out of the box either; you usually need to install some extra
packages. If the situation on OS X is similar, I'd be happy to set dynamic
linking as the default but would still allow changing the default via a flag.

> Is there any way of doing platform dependent compilation flags?

You'd need to identify the platform via the shell (maybe with "uname"?) and can
then do something like what is described in issue249.

If you have time to prepare something along those lines, that'd be great. I
could hopefully also look into it eventually, but I'm completely swamped.

Rather than having the logic straightly implement something like "If Mac, don't
pass -static and -static-libgcc", I'd prefer it to be more indirect, like:

LINK_STATICALLY=1

if OS X: LINK_STATICALLY=0

if LINK_STATICALLY: Add flags.

(The reason for that is that there also occasionally good reasons for linking
dynamically on Linux, in which case it'd be nice to just have to change the
initial assignment.)
msg1891 (view) Author: emilkeyder Date: 2011-11-08.09:45:03
Yes, I just did a clean checkout and this is the list of changes
required to compile:

in preprocess/Makefile:
- remove -static and -static-libgcc from LINKOPT_RELEASE

in search/Makefile:
- remove -static and -static-libgcc from LINKOPT_RELEASE
- remove -Wl,-Bstatic and -lrt from POSTLINKOPT_RELEASE

this is just for release mode, -lrt would also have to be removed from
the other option sets for debug mode etc. Is there any way of doing
platform dependent compilation flags?

On Tue, Nov 8, 2011 at 12:55 AM, Malte Helmert
<downward.issues@googlemail.com> wrote:
>
> Malte Helmert <malte.helmert@unibas.ch> added the comment:
>
> Oops -- this somehow got unnoticed.
>
> This is still unresolved, right?
>
> ----------
> nosy: +malte
> status: unread -> chatting
>
> _______________________________________________________
> Fast Downward issue tracker <downward.issues@gmail.com>
> <http://issues.fast-downward.org/issue277>
> _______________________________________________________
>
msg1890 (view) Author: malte Date: 2011-11-08.00:55:41
Oops -- this somehow got unnoticed.

This is still unresolved, right?
msg1755 (view) Author: emilkeyder Date: 2011-09-09.20:02:30
The makefile requires some changes in order to compile on OS X:

- OS X doesn't allow for static compilation, so these flags have to removed
- The -lrt library does not exist and does not need to be included for timing

Fix is to simply get rid of the -static and -lrt arguments to the linker, not sure how to do 
platform dependent flag changes from within a makefile though. 

Things get a lot more complicated when COIN has to be compiled - I had this working at some 
point but it took a lot of playing with settings, so that should probably be left out for now. 
Working makefile attached.
History
Date User Action Args
2011-11-09 21:25:57maltesetstatus: chatting -> resolved
messages: + msg1900
2011-11-09 21:10:03emilkeydersetstatus: resolved -> chatting
messages: + msg1899
2011-11-09 19:51:56maltesetstatus: chatting -> resolved
assignedto: emilkeyder
messages: + msg1898
2011-11-08 23:25:34emilkeydersetmessages: + msg1897
2011-11-08 23:21:07emilkeydersetmessages: + msg1896
2011-11-08 19:46:10maltesetmessages: + msg1895
2011-11-08 09:45:04emilkeydersetmessages: + msg1891
2011-11-08 00:55:41maltesetstatus: unread -> chatting
nosy: + malte
messages: + msg1890
2011-09-09 20:02:31emilkeydercreate