#12738: Singular fails to build with LTO
-------------------------+--------------------------------------------------
Reporter: SimonKing | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-5.0
Component: packages | Keywords: singular lto gcc
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-------------------------+--------------------------------------------------
I took sage-5.0.beta9, replaced the ppl package by the one from #12672,
added the cloog-ppl package from #12666, replaced the glpk package by the
one from #12703, added a new libelf spkg, added the mpc and gcc spkgs from
#12369 and modified the gcc spkg such that the gcc is built with support
of loop optimization (graphite) and lto.
Then, I tried to build Sage with rather high optimization:
{{{
king@mpc622:/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/spkg$ echo
$CFLAGS
-O3 -march=native -floop-interchange -floop-strip-mine -floop-block -fno-
strict-aliasing -flto
king@mpc622:/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/spkg$ echo
$CXXFLAGS
-O3 -march=native -floop-interchange -floop-strip-mine -floop-block -fno-
strict-aliasing -flto
king@mpc622:/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/spkg$ echo
$LDFLAGS
-flto
}}}
Moreover, I attempted to build parallely (four threads).
However, Singular failed to build. Note that dropping -flto would enable
to build Singular. Hence, the problem really seems to be -flto, whereas
`make -j4` and `-march=native` and `-floop*` seems to be fine.
It seems to me that LDFLAGS is not correctly passed. Namely, in the
[http://boxen.math.washington.edu/home/SimonKing/SAGE/install_logs/singular-3-1-3-3.p6.log
install log], I read
{{{
g++ -O3 -march=native -floop-interchange -floop-strip-mine -floop-block
-fno-strict-aliasing -flto -O2 -g -fPIC -pipe -fno-implicit-templates -I.
-I.. -I/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.bet
a9/local
-I/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/local/include
-I/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/local/include
-I/mnt/local/king/SAGE/testinggcc/lto/sage-5.0.beta9/local/include
-DNDEBUG -DOM_NDEBUG -Dx86_64_Linux -DHAVE_CONFIG_H -fpic -DPIC
-Dp_Procs_FieldQ -c p_Procs_Lib.cc -o p_Procs_Lib_FieldQ.dl_o
}}}
but
{{{
ld -shared -o p_Procs_FieldQ.sog p_Procs_Lib_FieldQ.dl_og
...
ld -shared -o p_Procs_FieldQ.so p_Procs_Lib_FieldQ.dl_o
}}}
Moreover, I see that libfac/Makefile.dist defines LDFLAGS empty
{{{
LDFLAGS=
}}}
and defines
{{{
LD = g++ $(ALLFLAGS)
}}}
where LDFLAGS does not appear in the definition of ALLFLAGS.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12738>
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.