#6743: cygwin metaticket: port Sage to Microsoft Windows (via Cygwin): stage 1
--
make building Sage automatic
-----------------------------------+----------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-5.9
Component: porting: Cygwin | Resolution:
Keywords: sd31 sd32 | Work issues:
Report Upstream: N/A | Reviewers: Jean-Pierre Flori, Dmitrii
Pasechnik, Karl-Dieter Crisman, Mike Hansen, William Stein, Luis Tabera
Authors: | Merged in:
Dependencies: | Stopgaps:
-----------------------------------+----------------------------------------
Comment (by jpflori):
Replying to [comment:228 leif]:
> Replying to [comment:225 jpflori]:
> > > > ? In both cases (`PATH` as well as `LD_LIBRARY_PATH`), directories
get '''pre'''pended (provided they exist).
> > > It seems PATH is not, in sage-env:
> > > {{{
> > > export PATH="$SAGE_PACKAGES/bin:$SAGE_LOCAL/bin:$PATH"
> > > }}}
> > And I think it's normal.
> > We want Sage binaries to be found first.
> >
> > As far as [LD_]LIBRARY_PATH is concerned, I wouldn't find it so
disturbing to prepend SAGE local dirs as well.
> >
> > But note that PATH is usually set (or the shell used might not be so
useful) whereas [LD]_LIBRARY_PATH is not.
> > So prepending our local values in the first case is really the most
sensible choice, whereas in the second you might think that the user has
added something unusual knowingly and he wants it first, if that breaks
that's his problem.
>
> I still don't understand what you mean. In both cases, we already
prepend ''Sage's'' directories, such that Sage's shared libraries and
binaries come first.
Oh youre right...
I misread the LD_LIBRARY_PATH part.
{{{
PATH="$SAGE_ROOT:$SAGE_LOCAL/bin:$PATH" && export PATH
}}}
{{{
for d in lib/openmpi lib/R/lib lib32 lib64 lib; do
libdir="$SAGE_LOCAL/$d"
# Add only existing directories
if [ -d "$libdir" ]; then
[ -z "$LD_LIBRARY_PATH" ] || LD_LIBRARY_PATH=":${LD_LIBRARY_PATH}"
LD_LIBRARY_PATH="${libdir}$LD_LIBRARY_PATH"
fi
done
export LD_LIBRARY_PATH
}}}
But taht's only true on non Cygwin system.
There we have
{{{
if [ "$UNAME" = "CYGWIN" ]; then
PATH="$PATH:$SAGE_LOCAL/lib:$SAGE_LOCAL/lib/R/lib" && export PATH
fi
}}}
>
> (That's orthogonal to putting DLLs into `*/bin/` or adding DLL dirs to
`PATH` on Cygwin. Note that IIRC we already do the former for some
packages, so if you add `$SAGE_LOCAL/lib/` to `PATH` as well, we IMHO
should no longer copy DLLs into `$SAGE_LOCAL/bin/`.)
We don't really copy anything anymore in */bin/
At least for all the spkg I've taken care of.
The default scheme on Cygwin is to have:
* static archive (.a), import libraries (.dll.a), libtool magic (.la) in
lib
* shared libraries (.dll), executables (.exe) in bin
And you shouldn't have to look in bin for libraries.
Normally (at least from my little experience) when you link (not when you
load at runtime) you either use the static archive (which is in lib) or
the import library (which is in lib), or you want to skip the import
library mess and give full path to the shared library in bin.
And when you end up using the import library, in the end it points you to
the shared library in bin, and in your own library or executable there is
no trace of the import library, only of the shared library itself.
That's what Python does, but dlopen skip all the fun of import libraries
(and it's right, it does not want to link to the library, it just wants to
load it) and wants a real shared library ending in .dll.
And with our current values of LD_LIBRARY_PATH and PATH, it first find the
system wide one because (that's only a guess) there must be some default
search path used between LD_LIBRARY_PATH and PATH.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6743#comment:229>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.