Comments (6)
No idea here, sorry. You're probably the first person to try it on OS X.
A class and its methods were previously correctly emitted, since the following is a dump of a thunk generated by Calypso:
void* __tmp1800 = void;
, __tmp1800 = cast(void*)this , __tmp1800 += -16L;
return (cast(DCXXclass)__tmp1800).hello(ceres);
so not everything is broken, but I've no idea what goes wrong with the function template instance. The segfaulting line would be helpful to figure out what's happening, could you rebuild Calypso with -DCMAKE_BUILD_TYPE=RelWithDebInfo?
from calypso.
with -DCMAKE_BUILD_TYPE=RelWithDebInfo
I get
[ 21%] Generating src/core/atomic.o
ldc2(31541,0x7fff722e8000) malloc: *** mach_vm_map(size=140621419954176) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Error: out of memory
make[2]: *** [runtime/src/core/atomic.o] Error 1
make[1]: *** [runtime/CMakeFiles/druntime-ldc.dir/all] Error 2
make: *** [all] Error 2
while compiling Calypso.
from calypso.
There's some weird stuff going on OS X..
You may be able to gather more info by debugging the ldc2 command, first by retrieving the command line for the generation of atomic.o with make VERBOSE=1
And then if your debugger is gdb (unlikely but I'm not familiar with LLDB):
gdb build/bin/ldc2 -- [ldc2 args during the compilation of atomic.o]
In gdb:
break malloc_error_break
run
bt
It would be very interesting to know where that malloc call comes from. If LDC 0.15.2 works on OS X then it's probably due to a Calypso modification, but again I'm clueless.
from calypso.
Hello @Syniurge and @John-Colvin,
It looks like your error might be because the build line you used is missing a couple things. Here is my 'build.sh' file:
rm -f calypso_cache* *.o
clang++ -std=c++11 -c showcase.cpp -o showcase.cpp.o
ar rcs libshowcase.a showcase.cpp.o
ldc2 -v -cpp-args -std=c++11 -Llibshowcase.a -L-lstdc++ showcase.d
So really you should just need the '-cpp-args -std=c++11' option to build the showcase demo (and -L-lstdc++ I guess :) ). It builds and works here with Calypso from git today and OS X 10.10.3 with clang/llvm 3.6.2.
from calypso.
Hi Kelly, neat that Calypso is working at least partially for you on OS X!
-std=c++11 hasn't been needed for a while for showcase.d, it just prevents the warnings, so I'm not sure what goes wrong on John's setup, why ldc2 built with -DCMAKE_BUILD_TYPE=RelWithDebInfo
blows a fuse. I don't have access to an OS X machine unfortunately..
from calypso.
out of memory
IIRC
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Error: out of memory
could be caused by building ldc using too much memory, depending on options (eg: release builds use more memory, make -j8
uses more memory, having a VM running on the side (eg parallels with dedicated resources) also reduces available memory. IIRC I was able to fix this with make -j{smaller number}
require -std=c++11
Also, yes, the original error was clearly due to requiring -std=c++11
;
-lstdc++ vs -lc++
see #82
break malloc_error_break
IIRC this doesn't work on OSX, instead use break malloc_printf
worked for me
showcase.cpp doesn't exist in git master; I believe this was moved to Calypso/tests/calypso/basics.d
this works (modulo applying other fixes I mentioned for OSX)
ldc2 -run Calypso/tests/calypso/basics.d
NOTE: adding -cpp-verbosediags (or if the command fails for other reasons), the warnings will be shown: warning: 'override' keyword is a C++11 extension
adding -cpp-args -std=c++11
will suppress these warnings
will close once docs are updated in corresponding files
EDIT: docs were updated in c1cbe1b, closing
from calypso.
Related Issues (20)
- Major blocker: DMD bogus forward and circular reference errors. HOT 1
- Rebase for LLVM 6 support HOT 3
- Please define project status HOT 3
- Linking to opencv issue.
- Windows binaries HOT 2
- Error building clang-7 branch
- Would this work with binderoo?
- Is there a Calypso forum or chatroom?
- Using-declaration in C++ not understood by Calypso HOT 2
- Global operators not working HOT 2
- ICE on string assignment to QSharedMemory HOT 1
- Cannot use D struct/class in QList HOT 3
- Cannot assign to QJsonObject HOT 1
- Cannot compare QStrings for equality HOT 2
- Linking Calypso fails HOT 2
- foreach over C++ iterator HOT 1
- Assertion `int_regs + sse_regs <= 2' failed HOT 1
- Header included multiple times with pragma once HOT 1
- Document compilation from scratch HOT 1
- Running `basics` test fails with "Global is external, but doesn't have external or weak linkage!" and "Alias must point to a definition"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calypso.