#9397: Resolve corrupted patches to permit Singular to build on Solaris x86/x64
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: GeorgSWeber
Type: defect | Status: new
Priority: major | Milestone: sage-4.5
Component: build | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Singular will not build on Solaris or !OpenSolaris with x86/x64
processors, nor will it build 64-bit Solaris x64 with SPARC processors.
There are two different reasons for the two different problems, but they
are both addressed by this patch.
== Problem No. 1 Poor patching practice prevents Solaris or !OpenSolaris
x86/x64 builds ==
The first only affects x86/x64 hardware. The second affects
One patch added the following few lines to a file
{{{
ifeq ($(SINGUNAME),ix86-SunOS)
SO_SUFFIX = so
LIBSINGULAR_FLAGS = -shared
LIBSINGULAR_LIBS = -lsingfac -lsingcf -lntl -lreadline -lgmp lomalloc
endif
}}}
but those changes subsequently got overwritten by a latter patch. An
inspection of spkg-install in Singular shows the file
{{{src/Singular/Makefile.in}}} being overwritten twice. See below.
{{{
patch()
{
# work-around patches
cp patches/mminit.cc src/kernel/
cp patches/assert.h src/factory/
cp patches/kernel.rmodulon.cc src/kernel/rmodulon.cc
cp patches/src.Singular.Makefile.in src/Singular/Makefile.in # FIRST
cp patches/Singular.libsingular.h src/Singular/libsingular.h
cp patches/factory.GNUmakefile.in src/factory/GNUmakefile.in
cp patches/libfac.charset.alg_factor.cc
src/libfac/charset/alg_factor.cc
cp patches/kernel.Makefile.in src/kernel/Makefile.in
cp patches/Singular.Makefile.in src/Singular/Makefile.in # OVERWRITES
FIRST
cp patches/Singular.tesths.cc src/Singular/tesths.cc
if [ "$UNAME" = "CYGWIN" ]; then
# Fine to make this patch on any system, because it is code that
is only compiled on Windows.
cp patches/sing_win.cc src/Singular/
cp patches/IntegerProgramming-Makefile.in
src/IntegerProgramming/Makefile.in
fi
#cp patches/Singular.configure src/Singular/configure
#cp patches/Singular.configure.in src/Singular/configure.in
}
}}}
Removing the target {{{ix86-SunOS}}} would stop any build on Solaris or
!OpenSolaris with x86/x64 hardware, but would not affect SPARC builds at
all.
== Problem No. 2 Compiler flag -m64 not propagating properly throughout
the Singular build process ==
dding the compiler flag -m64 was not sufficient to permit Singular to
build fully 64-bit, as part of it failed with:
{{{
make[1]: Entering directory
`/export/home/drkirkby/clean/sage-4.5.alpha0/spkg/build/singular-3.1.0.4.p8/src/Singular'
g++ -O2 -g -m64 -fPIC -pipe -I. -I../kernel
-I/export/home/drkirkby/clean/sage-4.5.alpha0/local/include
-I/export/home/drkirkby/clean/sage-4.5.alpha0/local/include
-I/export/home/drkirkby/clean/sage-4.5.alpha0/local/include -O2 -g -m64
-fno-implicit-templates -DNDEBUG -DOM_NDEBUG -Dix86_SunOS -DHAVE_CONFIG_H
-DLIBSINGULAR \
-o libsingular-tesths.o \
-c tesths.cc
g++ -o libsingular.so \
libsingular-tesths.o iparith.o mpsr_Tok.o claptmpl.o \
grammar.o scanner.o attrib.o eigenval_ip.o extra.o fehelp.o
feOpt.o
ipassign.o
ipconv.o ipid.o iplib.o ipprint.o ipshell.o lists.o sdb.o fglm.o
interpolation.o
silink.o subexpr.o janet.o wrapper.o libparse.o sing_win.o gms.o pcv.o
maps_ip.o
walk.o walk_ip.o cntrlc.o misc.o calcSVD.o slInit_Static.o mpsr_Put.o
mpsr_PutPoly.o mpsr_GetPoly.o mpsr_sl.o mpsr_Get.o mpsr_GetMisc.o
mpsr_Error.o
ndbm.o sing_dbm.o -lkernel -L../kernel -L../factory -L../libfac
-L/export/home/drkirkby/clean/sage-4.5.alpha0/local/lib -lsingfac -lsingcf
-
lntl
-lreadline -lgmp -lomalloc
ld: fatal: file libsingular-tesths.o: wrong ELF class: ELFCLASS64
ld: fatal: file processing errors. No output written to libsingular.so
}}}
Note how the first line has the -m64 flag, but the second line does not -
this is despite -m64 being in both CFLAGS and CXXFLAGS. I discovered that
using
{{{
CC="gcc -m64"
CXX="g++ -m64"
export CC
export CXX
}}}
solved the problem. After sending this to the Singular mailing list, I got
a response from Hans Schoenemann, one of the developers saying "That's the
right way."
Hence the patch which will be attached later does two things.
* Resolves the mess created by two patches patching the same file.
* Ensure the compilers really are called with the -m64 flag.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9397>
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.