#7782: cliquer build fails on HP-UX
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: drkirkby
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.1
Component: porting | Keywords:
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
------------------------+---------------------------------------------------
Comment(by drkirkby):
There appears to be around 5 issues when building with gcc, all of which
look solvable without too much difficulty. I've not got this to build, but
believe it will not be rocket science to do so with gcc.
If anyone wants an account on an HP-UX machine to fix these, I'll give you
one, as I personally own an HP C3600. Otherwise, I'll sort the package out
at some time. While doing so, it is wise to consider other platforms at
the same time. The issues I'm aware of are:
* spkg-install calls 'uname' then tests for Linux, Darwin (OS X) and
SunOS (Solaris), but exits with anything else. We should at last consider
the possibility of other Unix platforms. The most likely ones for which a
port of Sage could take place would be Cygwin (some are working on that),
HP-UX and AIX. Cygwin is actively maintain (last release is December
2009). Both HP-UX and AIX are current operating systems, actively
maintained. Less likely, but worth considering are Tru64 and IRIX. Tru64
is still maintained by HP, but HP are trying to move customers to HP-UX.
Rather than exit on these rarer platforms, we should just assume the same
flags as gcc and issue a warning. The variable SAGE_PORT needs to be
exported to build on any of these rarer platforms, so anyone building will
be aware they might need to fix things.
* spkg-install has code which checks for the Sun compiler and otherwise
assumes GCC. On other platforms like AIX, HP-UX, IRIX and Tru64, the
possibility exists of the compiler being something other than gcc or Sun
Studio. #7505 (currently awaiting review), is a very easy and robust means
of determining the compiler. It actually checks what the compiler defines,
and totally ignores the operating system it is running on. So even if Sun
Studio is run on Linux, it works (Sun Studio exists for Linux).
* The code:
{{{
# Enable long options for cl (eg. "cl --help"), comment out to disable.
# Requires getopt_long(3) (a GNU extension)
LONGOPTS = -DENABLE_LONG_OPTIONS
}}}
in the Makefile is causing a failure, as HP-UX does not have the GNU
extension. François Bissey has said cliquer is only used as a library. In
which case, that LONGOPT can simply be commented out.
* The extension for shared libraries on HP-UX is .sl, not the more common
.so. One way to possibly handle that would be to set a variable like
SHARED_LIB_EXTENSION in spkg-install, then use that in the Makefile.
I've personally been guilty of assuming operating systems other than OS X,
Linux and Solaris simply do not exist. In practice, in many cases things
simply work on HP-UX and I believe would work on other platforms too if
gcc is used.
Using native compilers on other platforms would no doubt present more
problems, but building Sage on HP-UX with gcc does not look to be very
difficult.
'''Portability notes'''
It is safer to use $UNAME rather than 'uname' as the output on Cywin from
uname is a bit complex. Sage's sage-env has this:
{{{
UNAME=`uname`
if [ `uname | sed -e 's/WIN.\+/WIN/'` = "CYGWIN" ]; then
UNAME="CYGWIN"
fi
}}}
so if $UNAME is used, it will not break on Cygwin. The output of the
'uname' command are on rarer platforms are:
* AIX: AIX
* HP-UX: HP-UX
* Tru64: Tru64
* Cywgin: A bit complex, but $UNAME is set to CYGWIN and so can be used
on '''any''' platform
* IRIX: Can be either IRIX or IRIX64, the latter obviously for a 64-bit
build.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7782#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.