zezer3 / cmaked2

Automatically exported from code.google.com/p/cmaked2
0 stars 0 forks source link

Compiler support #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello could you add ldc support please
They are a ldc2 branch here: http://bitbucket.org/prokhin_alexey/ldc2

best regards

Original issue reported on code.google.com by bioinfornatics@gmail.com on 2 Nov 2010 at 5:00

GoogleCodeExporter commented 9 years ago
I tried building ldc2 but failed. I installed llvm 2.8 but ldc2 fails at 
building the file gen/arrays.cpp:
build/ldc2/gen/arrays.cpp:445: error: ‘struct Type’ has no member named 
‘mutableOf’

BTW it gives me many warnings when building. How did you build ldc2? I'll guess 
I have a incompatible version. Could check http://www.dsource.org/projects/ldc 
because it's down.

Original comment by jens.k.mueller@gmail.com on 2 Nov 2010 at 8:30

GoogleCodeExporter commented 9 years ago
Debian comes with a packaged ldc.
$ ldc --version
LLVM D Compiler rev. 
based on DMD v1.056 and llvm 2.6 (Fri Feb 26 11:01:51 2010)
...

I made it almost work. I could not find the compiler switch to build a static 
library. What's ldc's equivalent for dmd's -lib?

Original comment by jens.k.mueller@gmail.com on 2 Nov 2010 at 9:19

GoogleCodeExporter commented 9 years ago
I think I found the answer to my last question. To build static libraries one 
has to use ar. I try to add this.

Original comment by jens.k.mueller@gmail.com on 2 Nov 2010 at 9:49

GoogleCodeExporter commented 9 years ago
I can build using ldc1. But we have sample apps in our test suite that require 
phobos. So I'd like to try ldc2 to make sure that works. Can you provide me 
some information on building ldc2?

Original comment by jens.k.mueller@gmail.com on 2 Nov 2010 at 10:02

GoogleCodeExporter commented 9 years ago
i will try call the ldc2 dev, and yes you need ar on object ihave some makefile 
if you want
llvm2.8 is come out is september we fixing some bug

Original comment by bioinfornatics@gmail.com on 2 Nov 2010 at 10:17

GoogleCodeExporter commented 9 years ago
Thanks. We are looking forward to support ldc2.
How did you compile it? I'll guess there is some combination of llvm and ldc2 
that will compile.

Original comment by jens.k.mueller@gmail.com on 3 Nov 2010 at 8:02

GoogleCodeExporter commented 9 years ago

Original comment by jens.k.mueller@gmail.com on 3 Nov 2010 at 8:15

GoogleCodeExporter commented 9 years ago

Original comment by jens.k.mueller@gmail.com on 3 Nov 2010 at 8:15

GoogleCodeExporter commented 9 years ago
at this time ldc dev ork around llvm 2.8 and works for fix it

Original comment by bioinfornatics@gmail.com on 3 Nov 2010 at 11:24

GoogleCodeExporter commented 9 years ago
Sorry. I'm having problems understanding that. Which version of llvm and ldc 
should I use? I did hg clone http://bitbucket.org/prokhin_alexey/ldc2 (tip is 
at 1711:2db59994970e) for ldc and used this llvm 
http://llvm.org/releases/2.8/llvm-2.8.tgz.

Original comment by jens.k.mueller@gmail.com on 3 Nov 2010 at 4:24

GoogleCodeExporter commented 9 years ago
hello, can you retry with latest revioin please, the revision sould compile

Original comment by bioinfornatics@gmail.com on 6 Nov 2010 at 5:50

GoogleCodeExporter commented 9 years ago
My tip is now at 1728:119b166d3fdb. gen/configfile.cpp.o failed with 
gen/configfile.cpp:8:25: error: libconfig.h++: No such file or directory.
I installed libconfig++ and compiling works. Maybe you can add a check for 
libconfig++.

We have a little test program.
testCompiler.d:
int main(char[][] args)
{return args.sizeof-1;}

When I do
$ ldc -offoo -c testDCompiler.d

I get:
Error: failed to auto-select target: No available targets are compatible with 
this triple, see -version for the available targets., please use the -march 
option

Then I did:
$ ldc -march=i486 -offoo -c testDCompiler.d

getting:
Error: you must specify a target triple as well with -mtriple when using the 
-march option

How do I build the testCompiler.d?

Original comment by jens.k.mueller@gmail.com on 6 Nov 2010 at 7:39

GoogleCodeExporter commented 9 years ago
Try to rebuild LDC:
$ cd path_to_ldc_build_dir
$ cmake -DDEFAULT_TARGET=i686-pc-linux-gnu 
-DDEFAULT_ALT_TARGET=x86_64-pc-linux-gnu .
$ make

Original comment by sokolsd@gmail.com on 8 Nov 2010 at 5:51

GoogleCodeExporter commented 9 years ago
Thank you.
$ ldc -offoo -c testDCompiler.d
object.d: Error: module object is in file 'object.d' which cannot be read
import path[0] = /usr/include/d
import path[1] = /usr/include/d/ldc

I tried adding the path from my dmd installation to ldc.conf. Had no effect. 
Where do I need to add the import path?
Adding it manually
$ ldc -I/home/jkm/local/x86_64-linux-gnu/src/druntime/import -offoo -c 
testDCompiler.d

results in
/home/jkm/local/x86_64-linux-gnu/src/druntime/import/object.di(21): found 
'char' when expecting ')'
/home/jkm/local/x86_64-linux-gnu/src/druntime/import/object.di(21): no 
identifier for declarator immutable
/home/jkm/local/x86_64-linux-gnu/src/druntime/import/object.di(21): semicolon 
expected to close alias declaration
/home/jkm/local/x86_64-linux-gnu/src/druntime/import/object.di(21): Declaration 
expected, not ')'
...

Original comment by jens.k.mueller@gmail.com on 8 Nov 2010 at 7:04

GoogleCodeExporter commented 9 years ago
cmake . -DD_VERSION:STRING=2 -DRUNTIME_DIR:PATH=/usr/include/d/tango 
-DPROGRAM_PREFIX:STRING=2

or

cmake . -DD_VERSION:STRING=2 -DRUNTIME_DIR:PATH=/usr/include/d/dmd/phobos 
-DPROGRAM_PREFIX:STRING=2

i add number 2 at ldc because i use too ldc (d1)

Original comment by bioinfornatics@gmail.com on 23 Nov 2010 at 5:15

GoogleCodeExporter commented 9 years ago
Thanks. But not done yet.
$ ldc2 -offoo testDCompiler.d
/usr/bin/ld: cannot find -ldruntime-ldc
collect2: ld returned 1 exit status
Error: linking failed:
status: 1

I have no libdruntime-ldc.so or .a. 

$ make runtime
fails with
../src/druntime/src/core/runtime.d(385): Error: class 
core.runtime.defaultTraceHandler.DefaultTraceInfo interface function 
TraceInfo.toString is not implemented
make[3]: *** [runtime/src/core/runtime.o] Error 1
make[2]: *** [runtime/CMakeFiles/druntime-ldc.dir/all] Error 2
make[1]: *** [runtime/CMakeFiles/runtime.dir/rule] Error 2
make: *** [runtime] Error 2

Which version of dmd are you using. I have v2.050.

Original comment by jens.k.mueller@gmail.com on 23 Nov 2010 at 9:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by jens.k.mueller@gmail.com on 9 Aug 2013 at 9:11