digitalmars.D.learn - Is DMD breaking BigInt?
- Russel Winder via Digitalmars-d-learn (77/77) Apr 07 2017 Simple Dub build of a Factorial example using Unit-Threaded for
- Jack Stouffer (2/4) Apr 07 2017 Can you post the code your using?
- Russel Winder via Digitalmars-d-learn (15/20) Apr 08 2017 I thought I had given a URL to the code on GitHub, maybe not, so here
- ag0aep6g (24/26) Apr 08 2017 So, factorial.d:71 is this:
- David Nadlinger (3/6) Apr 07 2017 You might want to check with LDC from Git master first to see
- Russel Winder via Digitalmars-d-learn (15/19) Apr 08 2017 Rats, I thought I'd got away from manually building LDC.
- Johan Engelen (3/5) Apr 08 2017 Of course not! ;-)
- Meta (2/74) Apr 07 2017 Do you have the -dip1000 switch enabled?
- Russel Winder via Digitalmars-d-learn (12/15) Apr 08 2017 Not as far as I know. Why would I want to do that?
- Meta (2/8) Apr 08 2017 You wouldn't as the std lib doesn't work with it yet.
Simple Dub build of a Factorial example using Unit-Threaded for
testing. Works fine with ldc2 breaks with dmd. This is on Debian Sid
fully up to date.=C2=A0
|> ldc2 --version
LDC - the LLVM D compiler (1.1.1):
=C2=A0 based on DMD v2.071.2 and LLVM 3.9.1
=C2=A0 built with LDC - the LLVM D compiler (1.1.0)
=C2=A0 Default target: x86_64-pc-linux-gnu
=C2=A0 Host CPU: broadwell
=C2=A0 http://dlang.org - http://wiki.dlang.org/LDC
|> dmd --version
DMD64 D Compiler v2.073.2
|> dub test --compiler=3Dldc2
Package factorial (configuration "unittest") defines no import paths, use {=
"importPaths": [...]} or the default package directory structure to fix thi=
s.
Running custom 'unittest' configuration.
Performing "unittest" build using ldc2 for x86_64.
unit-threaded 0.7.11: target for configuration "library" is up to date.
factorial ~master: building configuration "unittest"...
Running pre-build commands...
Building package unit-threaded in /home/users/russel/.dub/packages/unit-thr=
eaded-0.7.11/unit-threaded/
Performing "$DFLAGS" build using dmd for x86_64.
unit-threaded 0.7.11: building configuration "gen_ut_main"...
Linking...
Running ../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut=
_main -f ut_main.d
To force a rebuild of up-to-date targets, run again with --force.
Running ./factorial-test=20
Automatically generated file ut_main.d
Running unit tests from dirs ["."]
factorial.Check the base case for all algorithms.:
factorial.Check the property for all algorithms.:
factorial.Traditional example-based testing.:
Time taken: 34 ms, 363 =CE=BCs, and 2 hnsecs
3 test(s) run, 0 failed.
OK!
|> dub test
Package factorial (configuration "unittest") defines no import paths, use {=
"importPaths": [...]} or the default package directory structure to fix thi=
s.
Running custom 'unittest' configuration.
Performing "unittest" build using dmd for x86_64.
unit-threaded 0.7.11: target for configuration "library" is up to date.
factorial ~master: building configuration "unittest"...
Running pre-build commands...
Building package unit-threaded in /home/users/russel/.dub/packages/unit-thr=
eaded-0.7.11/unit-threaded/
Performing "$DFLAGS" build using dmd for x86_64.
unit-threaded 0.7.11: building configuration "gen_ut_main"...
Linking...
Running ../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut=
_main -f ut_main.d
factorial.d(71,15): Error: template std.bigint.BigInt.__ctor cannot deduce =
function from argument types !()(string) immutable, candidates are:
/usr/include/dmd/phobos/std/bigint.d(64,5): std.bigint.BigInt.__ctor=
(Range)(Range s) if (isBidirectionalRange!Range && isSomeChar!(ElementType!=
Range) && !isInfinite!Range)
/usr/include/dmd/phobos/std/bigint.d(146,5): std.bigint.BigInt.__cto=
r(T)(T x) if (isIntegral!T)
/usr/include/dmd/phobos/std/bigint.d(162,5): std.bigint.BigInt.__cto=
r(T)(T x) if (is(Unqual!T =3D=3D BigInt))
dmd failed with exit code 1.
If anyone has any useful intelligence as to what happening and how I
can workaround it, I'd be a grateful bunny.
=20
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n=
et
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
Apr 07 2017
On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote:Simple Dub build of a Factorial example using Unit-Threaded for testing. Works fine with ldc2 breaks with dmd.Can you post the code your using?
Apr 07 2017
On Fri, 2017-04-07 at 20:29 +0000, Jack Stouffer via Digitalmars-d- learn wrote:On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote:I thought I had given a URL to the code on GitHub, maybe not, so here it is: https://github.com/russel/Factorial/tree/master/D --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winderSimple Dub build of a Factorial example using Unit-Threaded for=C2=A0 testing. Works fine with ldc2 breaks with dmd.=20 Can you post the code your using?
Apr 08 2017
On 04/07/2017 07:06 PM, Russel Winder via Digitalmars-d-learn wrote:factorial.d(71,15): Error: template std.bigint.BigInt.__ctor cannot deduce function from argument types !()(string) immutableOn 04/08/2017 02:18 PM, Russel Winder via Digitalmars-d-learn wrote:https://github.com/russel/Factorial/tree/master/DSo, factorial.d:71 is this: ---- tuple(30, immutable BigInt("265252859812191058636308480000000")), ---- And the BigInt constructor you're trying to use there is this one [1]: ---- this(Range)(Range s) if ( isBidirectionalRange!Range && isSomeChar!(ElementType!Range) && !isInfinite!Range) ---- In order to construct an immutable object, the constructor must either have the `immutable` attribute, or it must be `pure` so that the object is known to be unique. The constructor being templated, I think `pure` should be inferred when possible. But when I add it explicitly, your code compiles, so the attribute is apparently not inferred. Looks like a compiler bug to me. I've filed an issue: https://issues.dlang.org/show_bug.cgi?id=17309 It works with LDC because their BigInt doesn't have the templated constructor (yet, I guess). [1] https://github.com/dlang/phobos/blob/df82dea9caf4a01f00734001fae62cee38ee4f4e/std/bigint.d#L64-L67
Apr 08 2017
On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote:If anyone has any useful intelligence as to what happening and how I can workaround it, I'd be a grateful bunny.You might want to check with LDC from Git master first to see whether it is in fact a 2.073-related problem. — David
Apr 07 2017
On Fri, 2017-04-07 at 20:38 +0000, David Nadlinger via Digitalmars-d- learn wrote:[=E2=80=A6] =20 You might want to check with LDC from Git master first to see=C2=A0 whether it is in fact a 2.073-related problem. =E2=80=94 DavidRats, I thought I'd got away from manually building LDC. Fedora Rawhide is now on LLVM 4.0 is that going to be a problem building LDC? --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 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
Apr 08 2017
On Saturday, 8 April 2017 at 12:16:10 UTC, Russel Winder wrote:Fedora Rawhide is now on LLVM 4.0 is that going to be a problem building LDC?Of course not! ;-) -Johan
Apr 08 2017
On Friday, 7 April 2017 at 17:06:31 UTC, Russel Winder wrote:
Simple Dub build of a Factorial example using Unit-Threaded for
testing. Works fine with ldc2 breaks with dmd. This is on
Debian Sid fully up to date.
|> ldc2 --version
LDC - the LLVM D compiler (1.1.1):
based on DMD v2.071.2 and LLVM 3.9.1
built with LDC - the LLVM D compiler (1.1.0)
Default target: x86_64-pc-linux-gnu
Host CPU: broadwell
http://dlang.org - http://wiki.dlang.org/LDC
|> dmd --version
DMD64 D Compiler v2.073.2
|> dub test --compiler=ldc2
Package factorial (configuration "unittest") defines no import
paths, use {"importPaths": [...]} or the default package
directory structure to fix this.
Running custom 'unittest' configuration.
Performing "unittest" build using ldc2 for x86_64.
unit-threaded 0.7.11: target for configuration "library" is up
to date.
factorial ~master: building configuration "unittest"...
Running pre-build commands...
Building package unit-threaded in
/home/users/russel/.dub/packages/unit-threaded-0.7.11/unit-threaded/
Performing "$DFLAGS" build using dmd for x86_64.
unit-threaded 0.7.11: building configuration "gen_ut_main"...
Linking...
Running
../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut_main -f
ut_main.d
To force a rebuild of up-to-date targets, run again with
--force.
Running ./factorial-test
Automatically generated file ut_main.d
Running unit tests from dirs ["."]
factorial.Check the base case for all algorithms.:
factorial.Check the property for all algorithms.:
factorial.Traditional example-based testing.:
Time taken: 34 ms, 363 μs, and 2 hnsecs
3 test(s) run, 0 failed.
OK!
|> dub test
Package factorial (configuration "unittest") defines no import
paths, use {"importPaths": [...]} or the default package
directory structure to fix this.
Running custom 'unittest' configuration.
Performing "unittest" build using dmd for x86_64.
unit-threaded 0.7.11: target for configuration "library" is up
to date.
factorial ~master: building configuration "unittest"...
Running pre-build commands...
Building package unit-threaded in
/home/users/russel/.dub/packages/unit-threaded-0.7.11/unit-threaded/
Performing "$DFLAGS" build using dmd for x86_64.
unit-threaded 0.7.11: building configuration "gen_ut_main"...
Linking...
Running
../../../../.dub/packages/unit-threaded-0.7.11/unit-threaded/gen_ut_main -f
ut_main.d
factorial.d(71,15): Error: template std.bigint.BigInt.__ctor
cannot deduce function from argument types !()(string)
immutable, candidates are:
/usr/include/dmd/phobos/std/bigint.d(64,5):
std.bigint.BigInt.__ctor(Range)(Range s) if
(isBidirectionalRange!Range && isSomeChar!(ElementType!Range)
&& !isInfinite!Range)
/usr/include/dmd/phobos/std/bigint.d(146,5):
std.bigint.BigInt.__ctor(T)(T x) if (isIntegral!T)
/usr/include/dmd/phobos/std/bigint.d(162,5):
std.bigint.BigInt.__ctor(T)(T x) if (is(Unqual!T == BigInt))
dmd failed with exit code 1.
If anyone has any useful intelligence as to what happening and
how I
can workaround it, I'd be a grateful bunny.
Do you have the -dip1000 switch enabled?
Apr 07 2017
On Fri, 2017-04-07 at 22:47 +0000, Meta via Digitalmars-d-learn wrote:[=E2=80=A6] =20 Do you have the -dip1000 switch enabled?Not as far as I know. Why would I want to do that? --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 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
Apr 08 2017
On Saturday, 8 April 2017 at 12:14:31 UTC, Russel Winder wrote:On Fri, 2017-04-07 at 22:47 +0000, Meta via Digitalmars-d-learn wrote:You wouldn't as the std lib doesn't work with it yet.[…] Do you have the -dip1000 switch enabled?Not as far as I know. Why would I want to do that?
Apr 08 2017









ag0aep6g <anonymous example.com> 