-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
> Hi,
>
> On Wed, May 27, 2015 at 10:08:34PM +0200, Jerome BENOIT wrote:
>> > Yes, because I noticed that the code I pasted needs to be compiled like
>> > this in Debian:
>> >
>> > gcc -o test test.c -lecm -lgmp
>> >
>> > (when run: "No factor found")
>>
>> On my box:
>>
>> ldd /usr/lib/libecm.so
>> linux-vdso.so.1 => (0x00007fff1adff000)
>> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f86edf38000)
>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f86edbad000)
>> /lib64/ld-linux-x86-64.so.2 (0x00007f86ee44a000)
>>
>> So my understanding/guessing is that libecm brings the math library with it
>> (or something).
>
> Definitely ; but in one case I need to be explicit about it.
>
>> Can you compare the config.log files ?
>
> Uh... I'm typing the compilation lines directly, so which config.log do you
> want me to check?
>
I would compare the config.log as produced by the currently available gmp-ecm
pacakge
and config.log related to Sage: the idea is to detect some differences as the
one reported
you reported at tehn end of your last email: your working Sage builts against a
static version
of the ECM library.
>> >
>> > while within sage, it's:
>> >
>> > gcc -o test test.c -I<cut> -L<cut> -lecl -lgmp -lm
>>
>> ^^^^
>> is it a typo ?
>
> Yes it is.
ok
>
>> >
>> > (when run: "1")
>> >
>> > You'll notice that the -I and -L switch are normal, since I link against
>> > non-system things. But why the -lm switch?
>> >
>> > Snark on #debian-science
>> >
>> > PS: here is a more complete version of my sample code (justifies there is
>> > no error):
>> > #include <ecm.h>
>> >
>> > int
>> > main(int argc, char *argv[])
>> > {
>> > mpz_t n, f;
>> > int res;
>> >
>> > mpz_init(n);
>> > mpz_set_d(n, 1);
>> > mpz_init(f);
>> > res = ecm_factor (f, n, 100, NULL);
>> > if (res == ECM_NO_FACTOR_FOUND)
>> > gmp_printf("No factor found\n");
>> > else if (res == ECM_ERROR)
>> > gmp_printf("ECM_ERROR\n");
>> > else
>> > /* factor.c says ECM_FACTOR_FOUND can be returned...
>> > * but it doesn't exist!
>> > */
>> > gmp_printf("%Zd\n", f);
>> > return 0;
>> > }
>> > ECM_NO_FACTOR_FOUND
>>
>> You can complicate it by printing errno: I get 22 when (res ==
>> ECM_NO_FACTOR_FOUND)
>
> What is the point of printing an error number if there is no error ? I'm not
> sure errno means anything in that case.
I was half serious half kidding: the issue looks so weird.
>
> Since yesterday, I noticed that sage doesn't compile a dynamic version of ECM
> : it only has a static version!
Is it the static material provided by Debian ?
I also saw that the debian
> libecm0 package only depends on libc6, while I need -lgmp on the command line.
I have noticed it too: it will be fixed in the coming package.
And ldd libecm0.so doesn't link to gmp either.
This is related to the previous issue.
I don't know if
> it's annoying :-/
Same in this side.
>
> It doesn't really explain the difference yet...
What is not clear at this point: is your Sage use the ECM material from Debian
or the one from Sage ?
I do not like the static story.
>
> Snark on #debian-science
Thanks,
Jerome
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQEcBAEBAgAGBQJVcN1DAAoJEIC/w4IMSybjGYAH/2Es8ugJ6m1kHDrAtNgGRKQn
1RprMRpHrD0rM3LubnCh7fVTvcNzcfVoR9yl72HIuiYJBrYfsPyQCHdZjvIcWH41
pmDE1j90XV2d9m/v1lLmh0YIlhcvbp+pc2OqGhNGtb1PYbW9Gjf8yVKq2XeJxUq2
H3F9cfaO2NpfGacF97pIG8drO1KEM/Oinlny/TDD17D1AkPRVXvDIrg8pHlaergr
6ngpn8X31o5OF3lUl4KrXz5UMvjOiPqsm8l7ozL/vT9vdDHfRyAKyXRUnZ2cEiIc
Avy6k+NeglLeMcot8alS8a/tgOcfF5Uf8GsLbsHmZ+k3oIg6jFPI9ro/rDqxwJQ=
=R56F
-----END PGP SIGNATURE-----
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]