Jump to page: 1 2
Thread overview
Building a project with CMAKE
Feb 28, 2017
berni
Mar 02, 2017
berni
Mar 02, 2017
Nicholas Wilson
Mar 03, 2017
berni
Mar 03, 2017
Seb
Mar 03, 2017
berni
Mar 03, 2017
Ali Çehreli
Mar 03, 2017
berni
Mar 04, 2017
Johan Engelen
Mar 04, 2017
berni
Mar 05, 2017
Johan Engelen
Mar 02, 2017
Russel Winder
Mar 02, 2017
bauss
February 28, 2017
I'm using CMAKE to build my project. With https://github.com/dcarp/cmake-d this works almost. The only thing I do not manage to get working is running cmake in release mode. When I use -DCMAKE_BUILD_TYPE=Release I get some linker errors, which I do not get, when compiling manually. (In both cases gdc/linux is used.)

I allready could figure out, that it's due to the -O3 compiler flag used in release mode. It looks like cmake compiles all *.d files separately and while doing so, removes some functions when optimizing them. Later, when linking everything together, they are missing. (But I'm not sure on this.)

Here is my project: https://github.com/crocopaw/croco/tree/devel

Anybody here who has experience with CMAKE and D and could help?
March 02, 2017
On Tuesday, 28 February 2017 at 17:09:28 UTC, berni wrote:
> I'm using CMAKE to build my project. [...]

Just a note: I now asked the same question on the cmake mailing list. Maybe, it's the better place to do so...
March 02, 2017
On Thursday, 2 March 2017 at 09:13:40 UTC, berni wrote:
> On Tuesday, 28 February 2017 at 17:09:28 UTC, berni wrote:
>> I'm using CMAKE to build my project. [...]
>
> Just a note: I now asked the same question on the cmake mailing list. Maybe, it's the better place to do so...

I would take a look at what ldc does with their CMakeLists.txt[1] and associated files.

1: https://github.com/ldc-developers/ldc/blob/master/CMakeLists.txt
March 02, 2017
On Tue, 2017-02-28 at 17:09 +0000, berni via Digitalmars-d-learn wrote:
> I'm using CMAKE to build my project. With https://github.com/dcarp/cmake-d this works almost. The only thing I do not manage to get working is running cmake in release mode. When I use -DCMAKE_BUILD_TYPE=Release I get some linker errors, which I do not get, when compiling manually. (In both cases gdc/linux is used.)
> 
> I allready could figure out, that it's due to the -O3 compiler flag used in release mode. It looks like cmake compiles all *.d files separately and while doing so, removes some functions when optimizing them. Later, when linking everything together, they are missing. (But I'm not sure on this.)
> 
> Here is my project: https://github.com/crocopaw/croco/tree/devel
> 
> Anybody here who has experience with CMAKE and D and could help?

I do not have an immediate answer, but…

CLion requires CMake, with CMake-D in a fit state we could use CLion with D – albeit very rough and ready way, at least initially. I am sure the DLanguage IDEA plugin can be made to work with CLion. If this combination can be made to work at all, then it can be improved over time.

Personally I am now at the stage that without an IDE I don't start a project using that language. The important IDEs are JetBrains family and Eclipse. Anything else is niche or an also ran. At least currently.

I am about to not use D for a new project because C++, Rust and Go have good IDEs. And I am an Emacs person. I guess I will have to join Emacs Anonymous as I do not use it any more except for LaTeX and AsciiDoc files. OK I use the Emacs bindings in the IDEs obviously.

Unless the combination I proposed actually works. I will give it a go.


-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

March 02, 2017
On Thursday, 2 March 2017 at 12:42:00 UTC, Russel Winder wrote:
> On Tue, 2017-02-28 at 17:09 +0000, berni via Digitalmars-d-learn wrote:
>> [...]
>
> I do not have an immediate answer, but…
>
> CLion requires CMake, with CMake-D in a fit state we could use CLion with D – albeit very rough and ready way, at least initially. I am sure the DLanguage IDEA plugin can be made to work with CLion. If this combination can be made to work at all, then it can be improved over time.
>
> Personally I am now at the stage that without an IDE I don't start a project using that language. The important IDEs are JetBrains family and Eclipse. Anything else is niche or an also ran. At least currently.
>
> I am about to not use D for a new project because C++, Rust and Go have good IDEs. And I am an Emacs person. I guess I will have to join Emacs Anonymous as I do not use it any more except for LaTeX and AsciiDoc files. OK I use the Emacs bindings in the IDEs obviously.
>
> Unless the combination I proposed actually works. I will give it a go.

While it's true that they have better IDE's, I often find IDE's too bulky so I often end up using Atom or something similar with cmd plugins in which way it kinda acts like an IDE. Only thing that sucks using editors like that is debugging, but generally it's not a big deal to just run the code in an IDE and then debug it.
March 03, 2017
On Thursday, 2 March 2017 at 09:13:40 UTC, berni wrote:
> Just a note: I now asked the same question on the cmake mailing list. Maybe, it's the better place to do so...

After some help of cmake people and a morning of more investigations, I'm quite sure I found a bug in gdc. Meanwhile I've got a small example that compiles with gdc but leads to a linking error when compiled with -O3.
March 03, 2017
On Friday, 3 March 2017 at 10:21:51 UTC, berni wrote:
> On Thursday, 2 March 2017 at 09:13:40 UTC, berni wrote:
>> Just a note: I now asked the same question on the cmake mailing list. Maybe, it's the better place to do so...
>
> After some help of cmake people and a morning of more investigations, I'm quite sure I found a bug in gdc. Meanwhile I've got a small example that compiles with gdc but leads to a linking error when compiled with -O3.

Is there any specific reason why you can't use DMD or LDC? It's easy to install:

curl i.dlang.io | bash -s ldc

(they both have a more recent front-end which might save you a lot of pain)
March 03, 2017
On Friday, 3 March 2017 at 13:21:56 UTC, Seb wrote:
> Is there any specific reason why you can't use DMD or LDC?

gdc produces faster binaries. ;-) I've got installed the other two compilers too and they work.


March 03, 2017
On 03/03/2017 06:58 AM, berni wrote:
> On Friday, 3 March 2017 at 13:21:56 UTC, Seb wrote:
>> Is there any specific reason why you can't use DMD or LDC?
>
> gdc produces faster binaries. ;-) I've got installed the other two
> compilers too and they work.

I haven't compared them myself but I am under the following impression.

- dmd compiles the quickest and ldc compiles the slowest.

- dmd produces the slowest binary and ldc produces the fastest binary.

Which would put gdc in between the two. Is your experience different?

Ali

March 03, 2017
On Friday, 3 March 2017 at 20:10:25 UTC, Ali Çehreli wrote:
> Which would put gdc in between the two. Is your experience different?

Actually, I've got not much experience. A few weeks ago I ran a test where ldc was in between dmd and gdc. But I missed the -release flags then. With that flag it's faster, but still slower than gdc on that one (B below). With an other testcase, where I compared them, gdc and ldc are on equals speed (A below).

A) dmd 52s, gdc 22s, ldc 22s
B) dmd 432s, gdc 280s, ldc 310s

« First   ‹ Prev
1 2