[The CXX compiler identification is unknown
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake:71 (MESSAGE):
Could not find install_name_tool, please check your installation.
Call Stack (most recent call first):
/Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:176 (INCLUDE)
CMakeLists.txt:27 (project)
CMake Error: Could not find cmake module file:/Users/tim-kuhrt/OpenClonkBuild/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: Could not find cmake module file:/Users/tim-kuhrt/OpenClonkBuild/CMakeFiles/CMakeCCompiler.cmake
Configuring incomplete, errors occurred!
I guess that i'm missing something (well obviously the mentioned files).
cmake -G Xcode .
" and build in Xcode.It gets a good deal more complicated if you want universal binaries. Just working on packing the whole process into script form... Stupid SDL_mixer doesn't support cross-compiling properly :/
Opened it with Xcode 4.2.1 - and now?
How do I built it?
- Mac Os X has no
librt
, therefore clock_gettime
is unavailable. Needs a proper check and fallback.- XCode 4.2.1 only comes with SDKs back to 10.6. Building against that would mean limiting ourselves to Macs about one and a half year old and younger.
- Supporting all that C++0x gizmo requires linking against libc++ (which CMake doesn't detect) which again limits us to SDK 10.7. That would mean we can only support Macs about half a year old.
- And yes, GCC chokes on StdBuf without the C++0x gizmo.
Hm, have we ever considered whether it might be easier to just build StdBuf on top of
std::auto_ptr
? After all, that's pretty much where the approach is borrowed from.
> Hm, have we ever considered whether it might be easier to just build StdBuf on top of std::auto_ptr? After all, that's pretty much where the approach is borrowed from.
Isilkor will cheer ^^
std::auto_ptr
, not std::string
. That might help with maintaining the code - the outside behavior on the other hand would remain unchanged. It's essentially the question whether we might be able to leave all the messy rvalue stuff to the standard library.
> Mac Os X has no librt, therefore clock_gettime is unavailable. Needs a proper check and fallback.
Gah, so much for trusting POSIX. See http://hg.openclonk.org/openclonk/rev/ef82a09b3d8f for an explanation and the old code which could be used as fallback, if you don't want to search for a monotonic clock on macosx.
> And yes, GCC chokes on StdBuf without the C++0x gizmo.
So you need to use a really old gcc from when the ALLOW_TEMP_TO_REF hack still worked? Alternatively, perhaps it is finally time to rewrite that stuff to be sane, i.e. not have copy and assignment operators that modify the source, but use functions for that.
> So you need to use a really old gcc from when the ALLOW_TEMP_TO_REF hack still worked?
Yes, that's what I meant. And yes, a "sane" way that still allows using buffers as return values would be nice indeed. I just don't see the alternative to
auto_ptr
-like behavior.
Giant foo() { return Giant(constructedfromthesevalues); } void bar() { Giant g; g = foo(); }
into something like
void foo(Giant * to) { to->Giant(constructedfromthesevalues); } void bar() { Giant g; foo(&g); }
with the only observable difference to the programmer that the copy constructor wasn't called. One can even enforce that by declaring but not implementing the copy constructor, so that accidental copying is caught by the linker, because the optimization affects the ABI so is always active.
FormatString
the way you described?
(Though this is a special case of an optimization required by the calling convention, so even if we depended on it for correctness, we'd be save.)
> And do you really want to call, say, FormatString the way you described?
FormatString is already called the way I described. You can put some printfs in the StdStrBuf copy- and move-constructors and test for yourself.
I'd really prefer if we managed to solve it with
auto_ptr
instead.
Plus note we have code like this - are we sure that this wouldn't cause a copy of the part in question to be created? I mean, we can't rewrite it to
StdBuf IBufPart; IBufPart.Ref(IBuf.getPart(iPos, iIBufUsage - iPos));...
As that would segfault if your optimization doesn't run. I'm really uneasy with this. Do we really have to do this when we have basically exactly what you describe in
StdCopyBuf
already?
> Plus note we have code like this - are we sure that this wouldn't cause a copy of the part in question to be created?
As sure as you can be of anything when C++ is involved. The compiler will only create one copy of getPart, and that one will use the caller-provided chunk of memory to create the returned object. Actually, that example looks even surer than the one I gave, because it elides the copy constructor, not the copy operator. (Or does it? All these little C++ details...)
But that code looks like it would work just as well with a copy, so I'm not going to worry about it.
> Do we really have to do this when we have basically exactly what you describe in StdCopyBuf already?
We at least need to rename the four classes so that the sane ones have the shorter names. I just thought that with the mac build breakage, we'd have enough momentum to do a bigger cleanup, and I wouldn't continue to procrastinate over the new names. Heh, these classes almost have both of the hard problems in computer science ;-) (naming and cache invalidation)
> But that code looks like it would work just as well with a copy, so I'm not going to worry about it.
Well, sorry, I *do* worry about it. That kind of code can run over buffers that are multiple megabytes large (say, downloads). This is the very reason I wrote the
StdBuf
code in the first place... I wanted an interface to work with networking buffers and parts of the networking buffers in uniform ways. Having a reliable mechanism for returning a reference to a buffer is an integral part of that.> We at least need to rename the four classes so that the sane ones have the shorter names
Well, right now the simple and performance-safe ones have the simpler names. That made a lot of sense when refactoring - first you apply the suitable 1:1 transformation to
StdBuf
, then you possibly changed to StdCopyBuf
to automate a few copying operations.We might make a new "
StdString
" derive from "StdCopyStrBuf
" or something, that would make sense.
C4NetworkBuf
sounds wrong as this is in no means specific to C4Network
... If you want, you can go the route and make it "StdSimpleBuf
" or "StdBufPtr
" or similar to document that you're one step closer to the iron than you might expect. That would make sense to me.Or we just rename
StdCopyBuf
into StdIdiotProofBuf
. Ah, just kidding ;)Edit: Trouble is, this still doesn't help the Mac build. Or am I missing something?
> C4NetworkBuf sounds wrong as this is in no means specific to C4Network...
The only other user that might conceivably use multi-megabyte copies is the stdcompiler, and I'll simply switch that one over to the sane buffer and do some performance profiles to confirm that it doesn't hurt.
Getting rid of StdBuf and StdStrBuf entirely would help the Mac build, which is why I brought that up in the first place. But I think the StdCompiler also needs this. Perhaps we could use const_casts for that.
StdCompiler
actually needs a string builder, which is a somewhat different concept. And naming questions are essentially documentation issues - and it doesn't make sense to document that one class is only used by one specific code piece unless it incorporates special logic for it.> which is why I brought that up in the first place
And why I came back to it ;)
Right now this seems like a completely different issue to me. After all, we are just talking about a big renaming pass, followed by replacing
StdStrBuf
by StdCopyStrBuf
and making sure it doesn't break anything? Neither really helps with the rvalue stuff on the "get-the-code-to-compile"-level.
> and it doesn't make sense to document that one class is only used by one specific code piece unless it incorporates special logic for it.
The documentation aspect is that nobody should use that class. Because I don't feel like disproving your argument about multi-megabyte buffers with downloads, we have to grant you an exception for the network code. Hence C4NetworkBuf.
> After all, we are just talking about a big renaming pass, followed by replacing StdStrBuf by StdCopyStrBuf and making sure it doesn't break anything? Neither really helps with the rvalue stuff on the "get-the-code-to-compile"-level.
The only problem is passing temporary values to "foo &" parameters. StdCopy(Str)Buf takes "const foo &", so doesn't have the problem. And it isn't just a problem because ISO C++ doesn't allow this, it's also a problem because no coder expects this. And violating coder expectations leads to bugs.
StdCompiler may get away with simply const_casting the arguments. It's a complete surprise to any C++ writer anyway, and casual users only need to copy&paste some example code.
StdStrBuf -> C4StringBuffer
StdCopyStrBuf -> C4CopyStringBuffer
By the way, do I understand it right that the only difference between
StdStrBuf
and StdCopyStrBuf
is that the data StdCopyStrBuf points to is copied before modification and in StdStrBuf
it is not? In that case StdStrBuf
seems to be the more special class cause it differs from the normal behaviour I would expect from a string class.(Also, if the
StdCopyStrBuf
is copied on modification, how is it a buffer?)
> the data StdCopyStrBuf points to is copied before modification
Not before modification, but at assignment (and initialization). So let's say you do
StdBuf blub = bla; blub = bla;
This will make two copies of "
bla
".And yes, while we're at it, not using abbreviations might make sense as well.
>And yes, while we're at it, not using abbreviations might make sense as well.
In the current state, I don't think that makes sense. All three, Std, Str and Buf are pretty common abbreviations. At least, I never thought about what they could mean.
> Hm, have we ever considered whether it might be easier to just build StdBuf on top of std::auto_ptr?
Which doesn't really work, as the classic
auto_ptr
hack goes over an intermediate auto_ptr_ref
class, which means that it doesn't have an implicit copy constructor. Hm :(
22:36:30 <!Zapper> I guess noone did the summon-produtive-peter-dance yet
22:43:55 <!JCaesar> Teach me.
22:44:06 <!JCaesar> It's more effective if we're doing it together, I guess .
22:47:21 <!Clonkonaut> \o/
22:47:23 <!Clonkonaut> o//
22:47:24 <!Clonkonaut> \\o
22:47:27 <!Clonkonaut> /o/
22:47:30 <!Clonkonaut> \o\
22:49:44 <!Isilkor> oh hey new archer tonight
I'll get back to the Mac build eventually, don't worry.
I tried to build OC again, because I want to test the new features. But my XCode build faild again :(
Here is the code of the one error:
PhaseScriptExecution "CMake Rules" /Users/richard/desktop/Openclonk/openclonk.build/Debug/setup.build/Script-421E558FB4824CB1A726E52C.sh
cd /Users/richard/Desktop/Openclonk
/bin/sh -c /Users/richard/desktop/Openclonk/openclonk.build/Debug/setup.build/Script-421E558FB4824CB1A726E52C.sh
MAKENSIS-NOTFOUND -NOCD -DSRCDIR=/Users/richard/desktop/Openclonk "-DPROGRAMFILES=\$PROGRAMFILES" "-DPRODUCT_NAME=OpenClonk Beyond the Rocks" "-DPRODUCT_COMPANY=OpenClonk Project" "-DCLONK=\\Users\\richard\\desktop\\Openclonk\\Debug\\clonk.app\\Contents\\MacOS\\clonk" "-DC4GROUP=\\Users\\richard\\desktop\\Openclonk\\Debug\\c4group" /Users/richard/desktop/Openclonk/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
/bin/sh: MAKENSIS-NOTFOUND: command not found
make: *** [/Users/richard/desktop/Openclonk/setup_openclonk.exe] Error 127
Command /bin/sh failed with exit code 2
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill