Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-20 Thread Dima Pasechnik
On Fri, Mar 19, 2021 at 10:38 PM Michael Orlitzky  wrote:
>
> On Fri, 2021-03-19 at 09:57 -0700, Matthias Koeppe wrote:
> >
> >
> > FWIW, latte_int 1.7.6 has eliminated these bad tests (for presence of
> > header files)
> > in 
> > https://github.com/latte-int/latte/commit/2011c2ec0bda70b6f7e02bdd3ed02176d427927b
> >
>
> The "with" options that allow you to specify a path actually go against
> the GNU coding standards,
>
>   https://www.gnu.org/prep/standards/html_node/Configuration.html
>
> Those standards aren't gospel, but the authors of autoconf can probably
> believed when they say that using --with to specify a path is out-of-
> scope. Instead, the correct locations should be appended to the
> compiler/linker search paths with -I or -L before building the software
> "normally."
>
> Build systems are one place where you'll never figure out the right
> thing to do by looking at lots of examples.

using --with...= to specify paths might be a GNU federal crime, but
GNU feds are too busy --with=other
things to pursue these gross standard violations.


>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/bd0e8e16662e7d8e3aa06c15831ed1064c49ba40.camel%40orlitzky.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1A%3DFGwcfR0yfSZ%3D9uwb6yuL%3DzXL3bq7i25KsnuYH1uqw%40mail.gmail.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread Matthias Koeppe
On Friday, March 19, 2021 at 3:38:26 PM UTC-7 Michael Orlitzky wrote:

> The "with" options that allow you to specify a path actually go against 
> the GNU coding standards, 
>
> https://www.gnu.org/prep/standards/html_node/Configuration.html 
>
> Those standards aren't gospel, but the authors of autoconf can probably 
> believed when they say that using --with to specify a path is out-of- 
> scope. 
>

Nice find. For additional amusement, I tracked down the version of the GNU 
Coding Standards in which this paragraph was added: Apparently between 1992 
and 1994. 
https://cvs.savannah.gnu.org/viewvc/gnustandards/gnustandards/standards.texi?r1=1.2&r2=1.3


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/e98c6b97-12a5-4b2e-a050-3ca694c1c3b5n%40googlegroups.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread Michael Orlitzky
On Fri, 2021-03-19 at 09:57 -0700, Matthias Koeppe wrote:
> 
> 
> FWIW, latte_int 1.7.6 has eliminated these bad tests (for presence of 
> header files) 
> in 
> https://github.com/latte-int/latte/commit/2011c2ec0bda70b6f7e02bdd3ed02176d427927b
> 

The "with" options that allow you to specify a path actually go against
the GNU coding standards,

  https://www.gnu.org/prep/standards/html_node/Configuration.html

Those standards aren't gospel, but the authors of autoconf can probably
believed when they say that using --with to specify a path is out-of-
scope. Instead, the correct locations should be appended to the
compiler/linker search paths with -I or -L before building the software
"normally."

Build systems are one place where you'll never figure out the right
thing to do by looking at lots of examples.



-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/bd0e8e16662e7d8e3aa06c15831ed1064c49ba40.camel%40orlitzky.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread Matthias Koeppe
On Friday, March 19, 2021 at 3:13:46 AM UTC-7 François Bissey wrote:

>
> > On 19/03/2021, at 23:05, 'jonatha...@googlemail.com' via sage-devel <
> sage-...@googlegroups.com> wrote: 
> > 
> > We configure libaries with e.g. `--with-zlib="$SAGE_LOCAL"` 
> unconditionally. Why would this succeed, if we use the systems `zlib`? 
>
> It depends a bit on whether you use a properly written configure script or 
> not. 
> Autotools tests and finds things by trying to compile things. If there is 
> no 
> lib in SAGE_LOCAL it will not prevent a compilation against a system zlib 
> to fail. 
> gcc -o test -I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib test.c -lz 
> will look first in the SAGE_LOCAL locations but will still use the 
> standard location 
> if nothing is found in the custom ones. 
>
> Where it will fail, is with custom scripts that work by trying to find a 
> file explicitly. 
> Like checking whether $SAGE_LOCAL/lib/libz.so exists. Those are bad tests 
> in the first 
> place. 
>

FWIW, latte_int 1.7.6 has eliminated these bad tests (for presence of 
header files) 
in 
https://github.com/latte-int/latte/commit/2011c2ec0bda70b6f7e02bdd3ed02176d427927b

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5d3a8440-05fb-4bf1-9bfc-c03664b3e39en%40googlegroups.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread 'jonatha...@googlemail.com' via sage-devel
Actually, the code I wrote for latte is better than I remembered. At some 
point I wanted to hardcode the location of the libraries.

But I guess, I abandoned this (maybe because someone told me, this was a 
bad idea).
jonatha...@googlemail.com schrieb am Freitag, 19. März 2021 um 11:38:46 
UTC+1:

> On 19.03.21 11:13, François Bissey wrote:
>
> >
> >> On 19/03/2021, at 23:05, 'jonatha...@googlemail.com' via sage-devel <
> sage-...@googlegroups.com> wrote:
> >>
> >> We configure libaries with e.g. `--with-zlib="$SAGE_LOCAL"` 
> unconditionally. Why would this succeed, if we use the systems `zlib`?
> >>
> > It depends a bit on whether you use a properly written configure script 
> or not.
> > Autotools tests and finds things by trying to compile things. If there 
> is no
> > lib in SAGE_LOCAL it will not prevent a compilation against a system 
> zlib to fail.
> > gcc -o test -I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib test.c -lz
> > will look first in the SAGE_LOCAL locations but will still use the 
> standard location
> > if nothing is found in the custom ones.
> >
> > Where it will fail, is with custom scripts that work by trying to find a 
> file explicitly.
> > Like checking whether $SAGE_LOCAL/lib/libz.so exists. Those are bad 
> tests in the first
> > place.
> >
> > François
> >
> I see. What we do is definitely against the instructions of libgd's 
> configure ("where to find the zlib library"). But checking the actual 
> code, $SAGE_LOCAL is completely ignored in this specific case.
>
> So this really is a cdd specific problem (because I want to set the 
> preference according to the path and not according to which of 
> `setoper.h`, `cdd/setoper.h`, `cddlib/setoper.h` works).
>
> And I guess we usually just wait until this leads to problems somewhere 
> (e.g. for iml we specify `-with-gmp-include="$SAGE_GMP_INCLUDE").
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/4eadab4f-e717-4b66-a23d-ddb21c6d595bn%40googlegroups.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread 'Jonathan Kliem' via sage-devel

On 19.03.21 11:13, François Bissey wrote:




On 19/03/2021, at 23:05, 'jonatha...@googlemail.com' via sage-devel 
 wrote:

We configure libaries with e.g. `--with-zlib="$SAGE_LOCAL"` unconditionally. 
Why would this succeed, if we use the systems `zlib`?


It depends a bit on whether you use a properly written configure script or not.
Autotools tests and finds things by trying to compile things. If there is no
lib in SAGE_LOCAL it will not prevent a compilation against a system zlib to 
fail.
gcc -o test -I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib test.c -lz
will look first in the SAGE_LOCAL locations but will still use the standard 
location
if nothing is found in the custom ones.

Where it will fail, is with custom scripts that work by trying to find a file 
explicitly.
Like checking whether $SAGE_LOCAL/lib/libz.so exists. Those are bad tests in 
the first
place.

François

I see. What we do is definitely against the instructions of libgd's 
configure ("where to find the zlib library"). But checking the actual 
code, $SAGE_LOCAL is completely ignored in this specific case.


So this really is a cdd specific problem (because I want to set the 
preference according to the path and not according to which of 
`setoper.h`, `cdd/setoper.h`, `cddlib/setoper.h` works).


And I guess we usually just wait until this leads to problems somewhere 
(e.g. for iml we specify `-with-gmp-include="$SAGE_GMP_INCLUDE").


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5ca25fcb-24c4-a3f0-4e48-616c61d480f2%40gmail.com.


Re: [sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread François Bissey



> On 19/03/2021, at 23:05, 'jonatha...@googlemail.com' via sage-devel 
>  wrote:
> 
> We configure libaries with e.g. `--with-zlib="$SAGE_LOCAL"` unconditionally. 
> Why would this succeed, if we use the systems `zlib`?
> 

It depends a bit on whether you use a properly written configure script or not.
Autotools tests and finds things by trying to compile things. If there is no
lib in SAGE_LOCAL it will not prevent a compilation against a system zlib to 
fail.
gcc -o test -I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib test.c -lz
will look first in the SAGE_LOCAL locations but will still use the standard 
location
if nothing is found in the custom ones.

Where it will fail, is with custom scripts that work by trying to find a file 
explicitly.
Like checking whether $SAGE_LOCAL/lib/libz.so exists. Those are bad tests in 
the first 
place.

François

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/2BAF2668-6CD0-4849-8293-F3D2523DDE8A%40gmail.com.


[sage-devel] Linking libraries with spkg-install.in

2021-03-19 Thread 'jonatha...@googlemail.com' via sage-devel

Hi, I think I made a mistake in https://trac.sagemath.org/ticket/31482, 
which might cause latte_int to fail building, if you use your systems cdd 
(which almost no one does, because the headers in cdd/ and cddlib/ are 
rejected currently).

However, it appears that we make this mistake all over spkg-install.in's?
We configure libaries with e.g. `--with-zlib="$SAGE_LOCAL"` 
unconditionally. Why would this succeed, if we use the systems `zlib`?

It appears to me that this only works, because people either use all the 
system packages possible or no packages at all. The above example seems to 
not come up, because people usually have libgd installed if they have zlib 
installed.

Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/40139c6b-d765-4e75-9739-30f8079ab599n%40googlegroups.com.