Re: Getting error in dmd testsuite
On Thursday, 28 December 2017 at 14:45:54 UTC, Thomas Mader wrote: gcc does not create the symbol at all on NixOS. I already created an issue for NixOS: https://github.com/NixOS/nixpkgs/issues/28896 I am not supposed to ask here but maybe someone knows about problems with gcc? I finally found out why the symbols are missing. See https://issues.dlang.org/show_bug.cgi?id=19553#c3
Re: Getting error in dmd testsuite
On Sunday, 27 August 2017 at 14:04:18 UTC, Joakim wrote: That module tests linking with C++ files, looks like you have some symbols that don't match up. That's weird, because those normally work with gcc. For each of them, use the readelf command from binutils to compare the symbols generated and see how they differ. For example, readelf -sW /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppb.cpp.o |grep foo15372 Then run the same command on the D side, ie for cppa_0.o, and compare the symbols. File a bug on the ldc github if you can't figure it out: https://github.com/ldc-developers/ldc/issues gcc does not create the symbol at all on NixOS. I already created an issue for NixOS: https://github.com/NixOS/nixpkgs/issues/28896 I am not supposed to ask here but maybe someone knows about problems with gcc?
Re: druntime memory unittest fails
On Thursday, 28 December 2017 at 10:25:01 UTC, Seb wrote: On Thursday, 28 December 2017 at 10:23:38 UTC, Thomas Mader wrote: Hello, on NixOS the druntime memory unittest fails at 'assert(z is null);' (https://github.com/dlang/druntime/blob/v2.075.1/src/core/memory.d#L899) Does anyone have a clue how that can happen? Thomas Use master: https://github.com/dlang/druntime/pull/1991 Perfect, thanks. I already tested building with 2.078.0-beta1 but don't remember if I reactivated the test or not. Nevertheless I will just wait for the final release.
druntime memory unittest fails
Hello, on NixOS the druntime memory unittest fails at 'assert(z is null);' (https://github.com/dlang/druntime/blob/v2.075.1/src/core/memory.d#L899) Does anyone have a clue how that can happen? Thomas
Re: Define enum value at compile time via compiler argument?
On Monday, 25 December 2017 at 17:46:05 UTC, aliak wrote: On Monday, 25 December 2017 at 16:38:32 UTC, Thomas Mader wrote: On Monday, 25 December 2017 at 16:22:11 UTC, Mengu wrote: is it a relative path? if so: pragma(msg, __FILE_FULL_PATH__.split("/")[0..$-1].join("/")); https://run.dlang.io/is/gRUAD6 Nice idea but it is an absolute path. :-/ Can you use the -J compiler flag to define a string import file? Then you can: string data = import("file.txt"); A little complicated but it works. Thank you guys for your help.
Re: Define enum value at compile time via compiler argument?
On Monday, 25 December 2017 at 16:22:11 UTC, Mengu wrote: is it a relative path? if so: pragma(msg, __FILE_FULL_PATH__.split("/")[0..$-1].join("/")); https://run.dlang.io/is/gRUAD6 Nice idea but it is an absolute path. :-/
Define enum value at compile time via compiler argument?
Hello, I would like to set the path to a directory at compile time but it doesn't seem to be possible yet. I tried it with a -version=CustomPath argument and inside the version statement in the code I tried to read the value from the environment. Sadly this doesn't work because getenv can not be interpreted at compile time because it has no available source. Now my question is if this is somehow possible and I just don't see it or would it be possible to add that somehow? Thanks in advance. Thomas
Getting error in dmd testsuite
Hello, I am building ldc on Nix (https://nixos.org/nix/) but keep getting an error while running the cppa.d test from the dmd testsuite (https://github.com/ldc-developers/dmd-testsuite). 1588: ... runnable/cppa.d -L-lstdc++ (-g) -O 1588: Test failed. The logged output: 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/bin/ldmd2 -conf= -m64 -Irunnable -L-lstdc++ -od/tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable -of/tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0 runnable/cppa.d /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppb.cpp.o 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0.o: In function `_Dmain': 1588: runnable/cppa.d:(.text._Dmain[_Dmain]+0x49f): undefined reference to `int foo15372(int)' 1588: runnable/cppa.d:(.text._Dmain[_Dmain]+0x4b2): undefined reference to `Foo15802::boo(int)' 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0.o:(.data.rel.ro._D4cppa6C131616__vtblZ[_D4cppa6C131616__vtblZ]+0x0): undefined reference to `C13161::dummyfunc()' 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0.o:(.data.rel.ro._D4cppa4Test6__vtblZ[_D4cppa4Test6__vtblZ]+0x0): undefined reference to `C13161::dummyfunc()' 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0.o:(.data.rel.ro._D4cppa7C13161a6__vtblZ[_D4cppa7C13161a6__vtblZ]+0x0): undefined reference to `C13161a::dummyfunc()' 1588: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa_0.o:(.data.rel.ro._D4cppa5Testa6__vtblZ[_D4cppa5Testa6__vtblZ]+0x0): undefined reference to `C13161a::dummyfunc()' 1588: collect2: error: ld returned 1 exit status 1588: Error: /nix/store/df84hkmhrhx1c2zpvrhmk6aprhlzkasx-gcc-wrapper-6.4.0/bin/gcc failed with status: 1 1588: 1588: 1588: == 1588: Test failed: expected rc == 0, exited with rc == 1 1588: 1588: make[2]: *** [Makefile:335: /tmp/nix-build-ldc-1.3.0.drv-0/build/dmd-testsuite/runnable/cppa.d.out] Error 1 Apart from that all other tests pass. Any ideas? It's running on Linux with gcc 6.4.0.
Has anyone created a D wrapper for wbemuuid.lib
I looked at some of the windows API wrapper projects for D on github [1][2], but none of them seems to have wrapped wbemuuid.lib right now. Do I miss something? Does anyone have wrapped this lib? Thomas [1] http://code.dlang.org/packages/windows-headers [2] https://github.com/smjgordon/bindings/tree/master/win32
Re: Has anyone created a D wrapper for wbemuuid.lib
On Tuesday, 22 September 2015 at 10:03:52 UTC, Thomas Mader wrote: Do I miss something? Does anyone have wrapped this lib? This was also asked on stackoverflow some time ago. [1] Wonder if something happend since then. [1] http://stackoverflow.com/questions/24051606/can-i-use-routines-from-comdef-h-wbemidl-h-etc-in-d
Re: Faster ways to redirect stdout of child process to file
I found out that the redirect was not responsible for the CPU time, it was some other code part which was responsible for it and totally unrelated to the redirect. I also saw that a redirect in my case is much simpler by using spawnProcess: auto logFile = File(errors.log, w); auto pid = spawnProcess([dmd, myprog.d], std.stdio.stdin, std.stdio.stdout, logFile);
Faster ways to redirect stdout of child process to file
I use auto pipes = pipeProcess( cmd, Redirect.stdout | Redirect.stderr ); to redirect stdout of the newly created subprocess via pipes to a file. The redirect itself happens in a newly created thread (because I need to wait for the subprocess to finish to take the exact elapsed time) doing basically: pipes.stdout.byChunk( 1024 * 1024 ).copy( cof.lockingTextWriter() ); This happens to use much of my CPU time (~25%). I wonder if there is no faster way to do this. I use this method because I want to be platform independent. Thomas
Re: Something like Python's psutils for D?
On Sunday, 13 July 2014 at 01:01:16 UTC, Ellery Newcomer wrote: would psutils itself be acceptable? https://bitbucket.org/ariovistus/pyd I haven't thought about this possibility, thanks.
Something like Python's psutils for D?
The Subject says it all, is something like psutils available in D? [1] I need it to measure memory usage of a process. [1] https://github.com/giampaolo/psutil thank you Thomas
Re: Something like Python's psutils for D?
I also need to get the user and system time of a process, doesn't seem to be available in Phobos. (e.g. getrusage in Linux but platform independent)