Ticket #6579 (closed defect: fixed)
[with spkg; positive review] Error building 'modified sage library code' when including paripriv.h
| Reported by: | drkirkby | Owned by: | drkirkby |
|---|---|---|---|
| Priority: | blocker | Milestone: | sage-4.2 |
| Component: | porting: Solaris | Keywords: | Solaris |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | Mike Hansen | |
| Authors: | David Kirkby | Merged in: | sage-4.2.alpha1 |
| Dependencies: | Stopgaps: |
Description
Although the build of pari goes ok on Solaris, there is an error when building the modified sage library code. It complains about syntax errors - see below.
Time to execute 1 commands: 2.75036501884 seconds Finished compiling Cython code (time = 4.44064807892 seconds) running install running build running build_py copying sage/symbolic/constants.py -> build/lib.solaris-2.10-sun4u-2.6/sage/symbolic running build_ext building 'sage.ext.fast_callable' extension creating build/temp.solaris-2.10-sun4u-2.6/sage/ext gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/export/home/drkirkby/sage/sage-4.1.rc0/local//include -I/export/home/drkirkby/sage/sage-4.1.rc0/local//include/csage -I/export/home/drkirkby/sage/sage-4.1.rc0/devel//sage/sage/ext -I/export/home/drkirkby/sage/sage-4.1.rc0/local/include/python2.6 -c sage/ext/fast_callable.c -o build/temp.solaris-2.10-sun4u-2.6/sage/ext/fast_callable.o -w In file included from sage/ext/fast_callable.c:141: /export/home/drkirkby/sage/sage-4.1.rc0/local//include/pari/paripriv.h:258: error: expected ';', ',' or ')' before numeric constant /export/home/drkirkby/sage/sage-4.1.rc0/local//include/pari/paripriv.h:259: error: expected ';', ',' or ')' before numeric constant In file included from sage/ext/fast_callable.c:141: /export/home/drkirkby/sage/sage-4.1.rc0/local//include/pari/paripriv.h:428: error: expected identifier before numeric constant error: command 'gcc' failed with exit status 1 sage: There was an error installing modified sage library code.
I have developed a patch, and will apply it later, including this tick number.
Dave
Change History
comment:2 Changed 4 years ago by drkirkby
Well, the patch is more of a hack. With manual editing of
$SAGE_HOME/local/include/pari/paripriv.h
(comment out lines 258, 259 and 428)
the 'modified sage library code' will build if /opt/SUNWspro/bin/CC is NOT to be found, but will fail if that can be found. See trac #6595
comment:3 Changed 4 years ago by drkirkby
- Keywords hack removed
- Priority changed from major to blocker
Having disucssed my patch idea, it seems they were not optimal, so I'd like someone else to do this.
I've updated it to blocker, as is the only problem that stops Sage building on Solaris simply by typing 'make'.
comment:4 Changed 4 years ago by drkirkby
- Status changed from new to needs_review
- Summary changed from Error building 'modified sage library code' when including paripriv.h to [with spkg; needs review] Error building 'modified sage library code' when including paripriv.h
Having looked at this more, and the pari package in particular, it was clear similar (but more severe) issues had arisen on OS X with the inclusion of this pari header file. The solution adopted for OS X was to create a specific header file for OS X, and copy that over.
The following package does exactly the same thing, but only for Solaris. The changes needed appeared different from those needed for OS X, so I could not use the OS version of the header file for Solaris too. In the case of OS X, libraries had to be manually copied around too - no such changes were needed on Solaris, just a simple copy of a file. The extra code added to spkg-install was:
if [ `uname` = "SunOS" ]; then
set -e
echo "Patching include/pari/paripriv.h so it works on Solaris"
echo "The changes are much smaller than needed on OS X"
cp "$TOP"/patches/paripriv-Solaris.h $SAGE_LOCAL/include/pari/paripriv.h
set +e
fi
The files can be found at
http://sage.math.washington.edu/home/kirkby/Solaris-fixes/pari-2.3.3.p5/
This is the last remaining issue that prevent Sage building on Solaris with no manual intervention. It requires that gcc is used, and that SAGE64 is not set to 'yes', as this code will only build in 32-bit mode.
Dave
comment:5 Changed 4 years ago by mhansen
- Status changed from needs_review to positive_review
- Reviewers set to Mike Hansen
- Summary changed from [with spkg; needs review] Error building 'modified sage library code' when including paripriv.h to [with spkg; positive review] Error building 'modified sage library code' when including paripriv.h
- Authors set to David Kirkby
Looks good to me.
