Re: Debugging D shared libraries

2015-09-22 Thread Johannes Pfau via Digitalmars-d-learn
Am Tue, 22 Sep 2015 14:40:43 + schrieb John Colvin : > On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder > wrote: > > On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via > > Digitalmars-d -learn wrote: > >> [...] > > […] > >> [...] > > > > Debian

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 17:49 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > […] > > Just realized this thread is titled "Debugging D shared libraries" ; > -) > GDC does not yet support shared libraries. Conversely I thought it did due to the GCC toolchain thing

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 07:49 +, rom via Digitalmars-d-learn wrote: > […] > > works entirely fine. However the "parallel" code: > > > > extern(C) > > double parallel(const int n, const double delta) { > > Runtime.initialize(); > > const pi = 4.0 * delta * taskPool.reduce!"a

Re: Debugging D shared libraries

2015-09-22 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 22 September 2015 at 14:37:11 UTC, Russel Winder wrote: On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: [...] […] [...] Debian Jessie is far too out of date to be useful. I'm on Debian Sid (still quite old), and Fedora Rawhide (not quite so

Re: Debugging D shared libraries

2015-09-22 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2015-09-20 at 17:47 +0200, Johannes Pfau via Digitalmars-d -learn wrote: > Am Sat, 19 Sep 2015 17:41:41 +0100 > […] > > Have you tried using a newer GDC version? The debian jessie version > probably uses the 2.064.2 frontend. Debian Jessie is far too out of date to be useful. I'm on

Re: Debugging D shared libraries

2015-09-20 Thread rom via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-20 Thread Martin Krejcirik via Digitalmars-d-learn
Dne 19. 9. 2015 v 18:41 Russel Winder via Digitalmars-d-learn napsal(a): > Indeed, it works well. Well for LDC. DMD and GDC are still broken. My > GDC problems are deeper that this code: Debian packages seem to have > weird problems and Fedora do not package GDC. All I need to do to make your

Re: Debugging D shared libraries

2015-09-20 Thread Johannes Pfau via Digitalmars-d-learn
Am Sat, 19 Sep 2015 17:41:41 +0100 schrieb Russel Winder via Digitalmars-d-learn : > On Sat, 2015-09-19 at 16:33 +, John Colvin via Digitalmars-d-learn > wrote: > > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder > > wrote: > > > Sadly the: >

Re: Debugging D shared libraries

2015-09-20 Thread Johannes Pfau via Digitalmars-d-learn
gt; > > Have you tried using a newer GDC version? The debian jessie version > probably uses the 2.064.2 frontend. > > I wanted to add @attribute(cctor/cdtor) support for some time now, I > even wrote the code some time but didn't push it to the main repo for > some reason. I'll put it on the TODO list but I can't work on this for > the next 2-3 weeks. Just realized this thread is titled "Debugging D shared libraries" ;-) GDC does not yet support shared libraries.

Re: Debugging D shared libraries

2015-09-20 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:02:37 UTC, Russel Winder wrote: English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South Africa,…) it is generally a somewhat derogatory term. In French it means "to rub down with

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 17:41:39 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta) { Runtime.initialize(); const pi = 4.0 * delta * reduce!(

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). [...] I heard it crashed during the talk. Bummer. I should really be there, seeing as I

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code: extern(C) double sequential(const int n, const double delta)

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 12:21 +, ponce via Digitalmars-d-learn wrote: > […] > > Try using an explicit TaskPool and destroying it with scope(exit). > > > Also if using LDC, you can use global ctor/dtor to deal with the > runtime. > > > --->8- > >

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 15:58 +, ponce via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder > wrote: > > > > Hummm… I now do not get a segfault, and the code runs as > > expected : > > -) but the program never terminates. :-( > > Where is it

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 11:07 +, John Colvin via Digitalmars-d-learn wrote: > […] > I heard it crashed during the talk. Bummer. I should really be > there, seeing as I live about 15 mins away. If you get a chance > to talk to Alex Bishop, don't be too harsh on D to him, I'm > trying to

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth.

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 17:15 +0100, Russel Winder wrote: > […] > Sadly the: > > pragma(LDC_global_crt_ctor, 0) > void initRuntime() { > import core.runtime: Runtime; > Runtime.initialize(); >} > > will not compile under DMD :-( On the otherhand using a: version(LDC) {

Re: Debugging D shared libraries

2015-09-19 Thread John Colvin via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder wrote: Sadly the: pragma(LDC_global_crt_ctor, 0) void initRuntime() { import core.runtime: Runtime; Runtime.initialize(); } will not compile under DMD :-( version(LDC){ /* ... */ } not that it helps make

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:33 +, John Colvin via Digitalmars-d-learn wrote: > On Saturday, 19 September 2015 at 16:15:45 UTC, Russel Winder > wrote: > > Sadly the: > > > > pragma(LDC_global_crt_ctor, 0) > > void initRuntime() { > > import core.runtime: Runtime; > >

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:32:18 UTC, Russel Winder wrote: (*) ponce is arguably not the most positive or constructive name to go by. Friend call me like this IRL since forever. It seems to be a swear word in english?

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:34:05 UTC, John Colvin wrote: On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: [...] What is the difference between shared static this and the global constructor ? Russell,

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder wrote: Hummm… I now do not get a segfault, and the code runs as expected : -) but the program never terminates. :-( Where is it stuck? Also, what would I need to cover the DMD and the GDC situations? I don't know. :(

Re: Debugging D shared libraries

2015-09-19 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 19 September 2015 at 12:21:02 UTC, ponce wrote: On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder wrote: Calling D from Python. I have two functions in D, compiled to a shared object on Linux using LDC (but I get same problem using DMD). The sequential code:

Re: Debugging D shared libraries

2015-09-19 Thread ponce via Digitalmars-d-learn
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc wrote: What is the difference between shared static this and the global constructor ? Russell, if you use shared static this for dmd does it work ? Laeeth. Would like to know too. On OSX I've found that shared static this()

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:25 +, Laeeth Isharc via Digitalmars-d -learn wrote: > […] > What is the difference between shared static this and the global > constructor ? Russell, if you use shared static this for dmd > does it work ? Laeeth. I had no idea what to put in a: shared static

Re: Debugging D shared libraries

2015-09-19 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-19 at 16:41 +, ponce via Digitalmars-d-learn wrote: > […] > Friend call me like this IRL since forever. > > It seems to be a swear word in english? English and Spanish meanings of the word are very different. In UK (not sure about Canada, USA, Australia, New Zealand, South