Differences between revisions 1 and 2
Revision 1 as of 2009-10-26 19:05:06
Size: 28516
Editor: PeterJeremy
Comment:
Revision 2 as of 2009-10-30 20:55:31
Size: 31414
Editor: PeterJeremy
Comment: Initial block of updates. Still an incomplete WIP
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Note that this is a work-in-progress and not currently valid
{{{#!wiki comment
In general, commented-out sections are direct copies of my sage-3.4 and sage-4.1 porting efforts and are not required for sage-4.2. They have been left in case they are found to be required during testing.
Note that this is a work-in-progress and not currently complete
{{{#!wiki comment
In general, commented-out sections are direct copies of my sage-3.4 and sage-4.1 porting efforts and may not be required for sage-4.2. They have been left in case they are found to be required during testing.
Line 27: Line 27:
=== On FreeBSD 7.x ===
 * Unpack sage-4.1.tar or sage-4.1.1.tar
 * `cd sage-4.1` or `cd sage-4.1.1
`
 * Unpack [[attachment:sage-4.1.patch]] or [[attachment:sage-4.1.1.patch]] which includes the following:
=== On FreeBSD 8.x ===

FreeBSD
7.x hasn't been tested with Sage 4.2 but is expected to work.

 * Unpack sage-4.2.tar
 * `cd
sage-4.2`
 * Unpack [[attachment:sage-4.2.patch]] which includes the following:
Line 39: Line 42:
  . `SAGE_FORTRAN=/usr/local/bin/gfortran43 SAGE_FORTRAN_LIB=/usr/local/lib/gcc43/libgfortran.so gmake`

{{{#!wiki comment
=== On FreeBSD 8.x ===
 * Unpack sage-3.4.tar
 * `cd sage-3.4`
 * `mkdir -p local/bin spkg/patches`
 * Create symlinks to mask name differences.
  . `ln -s /usr/local/bin/gmake local/bin/make`
  . `ln -s /usr/local/bin/bash local/bin/sh`
  . `ln -s /usr/local/bin/gcc43 local/bin/gcc`
  . `ln -s /usr/local/bin/g++43 local/bin/g++`
  . `ln -s /usr/local/bin/gfortran43 local/bin/gfortran` # specifying SAGE_FORTRAN isn't sufficient
 * Unpack the attached shar archive: [[attachment:sage-3.4.shar]]
 * Apply patches to base build system
  . `patch < spkg/patches/base.patch`
 * Build Sage
  . `CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib gmake`
}}}
  . `SAGE_PORT=yes SAGE_FORTRAN=/usr/local/bin/gfortran43 SAGE_FORTRAN_LIB=/usr/local/lib/gcc43/libgfortran.so gmake`
Line 60: Line 46:
Currently, the following tests fail on FreeBSD 7.2/i386 (the same tests fail on both versions of sage). Full logs at [[attachment:sage-4.1.freebsd32.test.log]] and [[attachment:sage-4.1.1.rc2.freebsd32.test.log]].
{{{
        sage -t "4.1/devel/sage/sage/ext/fast_callable.pyx"
        sage -t "4.1/devel/sage/sage/rings/number_field/number_field.py"
        sage -t "4.1/devel/sage/sage/rings/tests.py"
        sage -t "4.1/devel/sage/sage/rings/integer.pyx"
        sage -t "4.1/devel/sage/sage/schemes/elliptic_curves/period_lattice.py"
        sage -t "4.1/devel/sage/sage/misc/getusage.py"
        sage -t "4.1/devel/sage/sage/libs/pari/gen.pyx"
}}}
The actual failures are a mixture of:
Currently, the following tests fail on FreeBSD 8.0-rc1/amd64. Full logs at [[attachment:sage-4.2.freebsd8.0-amd64.test.log]].
{{{
        sage -t "devel/sage/doc/en/reference/coercion.rst"
        sage -t "devel/sage/sage/crypto/boolean_function.pyx"
        sage -t "devel/sage/sage/crypto/mq/sbox.py"
        sage -t "devel/sage/sage/crypto/mq/mpolynomialsystem.py"
        sage -t "devel/sage/sage/crypto/mq/sr.py"
        sage -t "devel/sage/sage/modules/free_module_element.pyx"
        sage -t "devel/sage/sage/quadratic_forms/binary_qf.py"
        sage -t "devel/sage/sage/quadratic_forms/constructions.py"
        sage -t "devel/sage/sage/schemes/plane_curves/projective_curve.py"
        sage -t "devel/sage/sage/schemes/generic/scheme.py"
        sage -t "devel/sage/sage/schemes/generic/projective_space.py"
        sage -t "devel/sage/sage/schemes/generic/affine_space.py"
        sage -t "devel/sage/sage/schemes/generic/algebraic_scheme.py"
        sage -t "devel/sage/sage/schemes/elliptic_curves/ell_field.py"
        sage -t "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
        sage -t "devel/sage/sage/schemes/elliptic_curves/ell_generic.py"
        sage -t "devel/sage/sage/schemes/elliptic_curves/ell_curve_isogeny.py"
        sage -t "devel/sage/sage/schemes/hyperelliptic_curves/jacobian_generic.py"
        sage -t "devel/sage/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py"
        sage -t "devel/sage/sage/schemes/hyperelliptic_curves/hyperelliptic_g2_generic.py"
        sage -t "devel/sage/sage/schemes/hyperelliptic_curves/invariants.py"
        sage -t "devel/sage/sage/symbolic/expression.pyx"
        sage -t "devel/sage/sage/symbolic/relation.py"
        sage -t "devel/sage/sage/symbolic/ring.pyx"
        sage -t "devel/sage/sage/libs/pari/gen.pyx"
        sage -t "devel/sage/sage/libs/symmetrica/sb.pxi"
        sage -t "devel/sage/sage/misc/getusage.py"
        sage -t "devel/sage/sage/modular/overconvergent/genus0.py"
        sage -t "devel/sage/sage/coding/linear_code.py"
        sage -t "devel/sage/sage/rings/qqbar.py"
        sage -t "devel/sage/sage/rings/integer.pyx"
        sage -t "devel/sage/sage/rings/tests.py"
        sage -t "devel/sage/sage/rings/fraction_field_element.pyx"
        sage -t "devel/sage/sage/rings/fraction_field.py"
        sage -t "devel/sage/sage/rings/polynomial/symmetric_reduction.pyx"
        sage -t "devel/sage/sage/rings/polynomial/multi_polynomial_ring.py"
        sage -t "devel/sage/sage/rings/polynomial/symmetric_ideal.py"
        sage -t "devel/sage/sage/rings/polynomial/pbori.pyx"
        sage -t "devel/sage/sage/rings/polynomial/infinite_polynomial_ring.py"
        sage -t "devel/sage/sage/rings/polynomial/laurent_polynomial.pyx"
        sage -t "devel/sage/sage/rings/polynomial/multi_polynomial_ring_generic.pyx"
        sage -t "devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pyx"
        sage -t "devel/sage/sage/rings/polynomial/laurent_polynomial_ring.py"
        sage -t "devel/sage/sage/rings/polynomial/infinite_polynomial_element.py"
        sage -t "devel/sage/sage/rings/polynomial/groebner_fan.py"
        sage -t "devel/sage/sage/rings/polynomial/multi_polynomial_ideal.py"
        sage -t "devel/sage/sage/rings/polynomial/polynomial_singular_interface.py"
        sage -t "devel/sage/sage/rings/polynomial/toy_d_basis.py"
        sage -t "devel/sage/sage/rings/polynomial/multi_polynomial.pyx"
        sage -t "devel/sage/sage/rings/polynomial/polynomial_ring_constructor.py"
        sage -t "devel/sage/sage/ext/fast_eval.pyx"
        sage -t "devel/sage/sage/ext/fast_callable.pyx"
        sage -t "devel/sage/sage/categories/pushout.py"
        sage -t "devel/sage/sage/categories/map.pyx"
        sage -t "devel/sage/sage/matrix/matrix_space.py"
        sage -t "devel/sage/sage/matrix/constructor.py"
        sage -t "devel/sage/sage/matrix/matrix_sparse.pyx"
        sage -t "devel/sage/sage/matrix/matrix2.pyx"
        sage -t "devel/sage/sage/matrix/matrix_mpolynomial_dense.pyx"
        sage -t "devel/sage/sage/structure/parent.pyx"
        sage -t "devel/sage/sage/structure/coerce_actions.pyx"
        sage -t "devel/sage/sage/structure/element.pyx"
        sage -t "devel/sage/sage/structure/sage_object.pyx"
        sage -t "devel/sage/sage/structure/coerce.pyx"
        sage -t "devel/sage/sage/interfaces/sage0.py"
        sage -t "devel/sage/sage/lfunctions/sympow.py"
        sage -t "devel/sage/sage/combinat/sf/sfa.py"
        sage -t "devel/sage/sage/combinat/sf/schur.py"
        sage -t "devel/sage/sage/combinat/sf/dual.py"
        sage -t "devel/sage/sage/combinat/sf/powersum.py"
        sage -t "devel/sage/sage/combinat/sf/ns_macdonald.py"
        sage -t "devel/sage/sage/combinat/sf/homogeneous.py"
        sage -t "devel/sage/sage/combinat/sf/monomial.py"
        sage -t "devel/sage/sage/combinat/sf/elementary.py"
        sage -t "devel/sage/sage/combinat/sf/macdonald.py"
        sage -t "devel/sage/sage/combinat/q_analogues.py"
        sage -t "devel/sage/sage/combinat/combinat.py"
        sage -t "devel/sage/sage/combinat/partition.py"
        sage -t "devel/sage/sage/combinat/tableau.py"
        sage -t "devel/sage/sage/combinat/schubert_polynomial.py"
        sage -t "devel/sage/sage/plot/complex_plot.pyx"
}}}
The actual failures indicate that the port still needs significant work and include:
 * Failed coercions in coercion.rst
 * python/site-packages/sage/rings/polynomial/pbori.so runtime linking against the wrong C++ library.
 * Invalid polymonials reported by scheme.py
 * FreeBSD memory usage patch is incomplete

{{{#!wiki comment
Line 76: Line 142:

{{{#!wiki comment
Currently, the following tests fail on FreeBSD 8-current/amd64. Two run out of swap (process exceeds 9GB) and 5 are numeric noise. There are also a number of core dumps. Full details [[freebsd/sage-3.4/8.xErrs|here]].
{{{
        sage -t "devel/sage/sage/schemes/elliptic_curves/lseries_ell.py"
        sage -t "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
        sage -t "devel/sage/sage/modules/free_module_element.pyx"
        sage -t "devel/sage/sage/libs/pari/gen.pyx"
        sage -t "devel/sage/sage/misc/getusage.py"
        sage -t "devel/sage/sage/calculus/calculus.py"
        sage -t "devel/sage/sage/combinat/partition.py"
        sage -t "devel/sage/sage/lfunctions/sympow.py"
        sage -t "devel/sage/sage/ext/fast_eval.pyx"
        sage -t "devel/sage/sage/parallel/multiprocessing.py"
        sage -t "devel/sage/sage/parallel/decorate.py"
        sage -t "devel/sage/sage/rings/real_double.pyx"
        sage -t "devel/sage/sage/rings/polynomial/polynomial_integer_dense_flint.pyx"
        sage -t "devel/sage/sage/rings/polynomial/polynomial_quotient_ring_element.py"
        sage -t "devel/sage/sage/rings/polynomial/pbori.pyx"
        sage -t "devel/sage/sage/rings/tests.py"
        sage -t "devel/sage/sage/rings/integer.pyx"
}#}}
}}}
}}}
Line 101: Line 144:

The following lists versions for sage-4.1. The actual patch content remains the same for sage-4.1.1.rc2, though some patch names (as well as internal pathnames) change.
Line 106: Line 147:
/* * The patch to standard/deps ensures that bash is used. */

=== atlas-3.8.3.p5 ===
 * The patch to standard/deps ensures that bash is used. By default, gmake will use /bin/sh to execute commands and the patched line sources local/bin/sage-env - which includes the bash'ism 'source' instead of '.'. Whilst that file begins with a #! line invoking basg, because it must be sourced, it will actually execute in the invoking shell.

=== atlas-3.8.3.p9 ===
Line 147: Line 188:
{{{#!wiki comment
=== clisp-2.46.p7 ===
The FreeBSD/amd64 process memory map is incompatible with the memory mapping done by clisp. The patch moves the memory map down 8 bits. An alternative (used by the FreeBSD clisp port) is to pass `--disable-mmap` to configure.
}}}
=== cliquer-1.2.p2 ===
FreeBSD uses the same invocation as Linux to build shared libraries.
Line 167: Line 207:
{{{#!wiki comment
=== gap-4.4.12.p1 ===
Patches (mostly taken from the FreeBSD port) to make gap compile on FreeBSD.
}}}

=== gap-4.4.10.p12 ===
Patches (mostly taken from the FreeBSD port) to make gap compile on FreeBSD 8.x. These patches should be optional on FreeBSD/7.x.
Line 192: Line 232:
=== gmp-mpir-0.9 ===
Various 'make' fixes - see above.
}}}
{{{#!wiki comment
Line 199: Line 235:
{{{#!wiki comment
=== libgcrypt-1.4.3.p0 ===
Chase shared library name difference on FreeBSD. Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5868|#5868]]. Otherwise the gnutls build fails:

=== libgcrypt-1.4.4.p0 ===
Chase shared library name difference on FreeBSD. Sage local patch. Otherwise the gnutls build fails similar to:
Line 210: Line 246:
}#}}
}}}
}}}
Line 237: Line 273:
=== matplotlib-0.98.5.3rc0-svn6910.p4 === === matplotlib-0.99.1.p2 ===

Sage FreeBSD 7.x and 8.x build notes for Sage 4.2

Note that this is a work-in-progress and not currently complete

Contents

Overall build environment differences

  • sh and /bin/sh are a POSIX shell, rather than bash.

  • make is the BSD make, not GNU make

Preparatory work

  • Install ports/shells/bash or ports/shells/bash3 (I used 4.0.24)
  • Install ports/devel/gmake
  • Install ports/lang/gcc43 - FreeBSD no longer ships with a Fortran compiler by default.
  • Install ports/devel/autoconf262
  • Install ports/converters/libiconv
  • Ensure POSIX semaphores are available. This is required for ecl (at least). These are not available by default before FreeBSD 7.3 or 8.0 and should be enabled by either kldload sem or building a kernel with options P1003_1B_SEMAPHORES. If they are not available, building ecl will fail with Bad system call.

It's possible there are other dependencies, I haven't tried building sage in a clean (tinderbox) environment.

Building Sage

On FreeBSD 8.x

FreeBSD 7.x hasn't been tested with Sage 4.2 but is expected to work.

  • Unpack sage-4.2.tar
  • cd sage-4.2

  • Unpack sage-4.2.patch which includes the following:

    • Create symlinks to mask name differences.
    • ln -s /usr/local/bin/gmake local/bin/make

    • ln -s /usr/local/bin/bash local/bin/sh

    • ln -s /usr/local/bin/gcc43 local/bin/gcc

    • ln -s /usr/local/bin/g++43 local/bin/g++

    • ln -s /usr/local/bin/gfortran43 local/bin/gfortran

    • Various patches as described below into spkg/patches

  • Build Sage
    • SAGE_PORT=yes SAGE_FORTRAN=/usr/local/bin/gfortran43 SAGE_FORTRAN_LIB=/usr/local/lib/gcc43/libgfortran.so gmake

Current Status

Currently, the following tests fail on FreeBSD 8.0-rc1/amd64. Full logs at sage-4.2.freebsd8.0-amd64.test.log.

        sage -t  "devel/sage/doc/en/reference/coercion.rst"
        sage -t  "devel/sage/sage/crypto/boolean_function.pyx"
        sage -t  "devel/sage/sage/crypto/mq/sbox.py"
        sage -t  "devel/sage/sage/crypto/mq/mpolynomialsystem.py"
        sage -t  "devel/sage/sage/crypto/mq/sr.py"
        sage -t  "devel/sage/sage/modules/free_module_element.pyx"
        sage -t  "devel/sage/sage/quadratic_forms/binary_qf.py"
        sage -t  "devel/sage/sage/quadratic_forms/constructions.py"
        sage -t  "devel/sage/sage/schemes/plane_curves/projective_curve.py"
        sage -t  "devel/sage/sage/schemes/generic/scheme.py"
        sage -t  "devel/sage/sage/schemes/generic/projective_space.py"
        sage -t  "devel/sage/sage/schemes/generic/affine_space.py"
        sage -t  "devel/sage/sage/schemes/generic/algebraic_scheme.py"
        sage -t  "devel/sage/sage/schemes/elliptic_curves/ell_field.py"
        sage -t  "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
        sage -t  "devel/sage/sage/schemes/elliptic_curves/ell_generic.py"
        sage -t  "devel/sage/sage/schemes/elliptic_curves/ell_curve_isogeny.py"
        sage -t  "devel/sage/sage/schemes/hyperelliptic_curves/jacobian_generic.py"
        sage -t  "devel/sage/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py"
        sage -t  "devel/sage/sage/schemes/hyperelliptic_curves/hyperelliptic_g2_generic.py"
        sage -t  "devel/sage/sage/schemes/hyperelliptic_curves/invariants.py"
        sage -t  "devel/sage/sage/symbolic/expression.pyx"
        sage -t  "devel/sage/sage/symbolic/relation.py"
        sage -t  "devel/sage/sage/symbolic/ring.pyx"
        sage -t  "devel/sage/sage/libs/pari/gen.pyx"
        sage -t  "devel/sage/sage/libs/symmetrica/sb.pxi"
        sage -t  "devel/sage/sage/misc/getusage.py"
        sage -t  "devel/sage/sage/modular/overconvergent/genus0.py"
        sage -t  "devel/sage/sage/coding/linear_code.py"
        sage -t  "devel/sage/sage/rings/qqbar.py"
        sage -t  "devel/sage/sage/rings/integer.pyx"
        sage -t  "devel/sage/sage/rings/tests.py"
        sage -t  "devel/sage/sage/rings/fraction_field_element.pyx"
        sage -t  "devel/sage/sage/rings/fraction_field.py"
        sage -t  "devel/sage/sage/rings/polynomial/symmetric_reduction.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/multi_polynomial_ring.py"
        sage -t  "devel/sage/sage/rings/polynomial/symmetric_ideal.py"
        sage -t  "devel/sage/sage/rings/polynomial/pbori.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/infinite_polynomial_ring.py"
        sage -t  "devel/sage/sage/rings/polynomial/laurent_polynomial.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/multi_polynomial_ring_generic.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/laurent_polynomial_ring.py"
        sage -t  "devel/sage/sage/rings/polynomial/infinite_polynomial_element.py"
        sage -t  "devel/sage/sage/rings/polynomial/groebner_fan.py"
        sage -t  "devel/sage/sage/rings/polynomial/multi_polynomial_ideal.py"
        sage -t  "devel/sage/sage/rings/polynomial/polynomial_singular_interface.py"
        sage -t  "devel/sage/sage/rings/polynomial/toy_d_basis.py"
        sage -t  "devel/sage/sage/rings/polynomial/multi_polynomial.pyx"
        sage -t  "devel/sage/sage/rings/polynomial/polynomial_ring_constructor.py"
        sage -t  "devel/sage/sage/ext/fast_eval.pyx"
        sage -t  "devel/sage/sage/ext/fast_callable.pyx"
        sage -t  "devel/sage/sage/categories/pushout.py"
        sage -t  "devel/sage/sage/categories/map.pyx"
        sage -t  "devel/sage/sage/matrix/matrix_space.py"
        sage -t  "devel/sage/sage/matrix/constructor.py"
        sage -t  "devel/sage/sage/matrix/matrix_sparse.pyx"
        sage -t  "devel/sage/sage/matrix/matrix2.pyx"
        sage -t  "devel/sage/sage/matrix/matrix_mpolynomial_dense.pyx"
        sage -t  "devel/sage/sage/structure/parent.pyx"
        sage -t  "devel/sage/sage/structure/coerce_actions.pyx"
        sage -t  "devel/sage/sage/structure/element.pyx"
        sage -t  "devel/sage/sage/structure/sage_object.pyx"
        sage -t  "devel/sage/sage/structure/coerce.pyx"
        sage -t  "devel/sage/sage/interfaces/sage0.py"
        sage -t  "devel/sage/sage/lfunctions/sympow.py"
        sage -t  "devel/sage/sage/combinat/sf/sfa.py"
        sage -t  "devel/sage/sage/combinat/sf/schur.py"
        sage -t  "devel/sage/sage/combinat/sf/dual.py"
        sage -t  "devel/sage/sage/combinat/sf/powersum.py"
        sage -t  "devel/sage/sage/combinat/sf/ns_macdonald.py"
        sage -t  "devel/sage/sage/combinat/sf/homogeneous.py"
        sage -t  "devel/sage/sage/combinat/sf/monomial.py"
        sage -t  "devel/sage/sage/combinat/sf/elementary.py"
        sage -t  "devel/sage/sage/combinat/sf/macdonald.py"
        sage -t  "devel/sage/sage/combinat/q_analogues.py"
        sage -t  "devel/sage/sage/combinat/combinat.py"
        sage -t  "devel/sage/sage/combinat/partition.py"
        sage -t  "devel/sage/sage/combinat/tableau.py"
        sage -t  "devel/sage/sage/combinat/schubert_polynomial.py"
        sage -t  "devel/sage/sage/plot/complex_plot.pyx"

The actual failures indicate that the port still needs significant work and include:

  • Failed coercions in coercion.rst
  • python/site-packages/sage/rings/polynomial/pbori.so runtime linking against the wrong C++ library.
  • Invalid polymonials reported by scheme.py
  • FreeBSD memory usage patch is incomplete

Notes on spkgs and attached patches

base.patch

  • The patch to base/sage-spkg enables the local patching that the rest of the patches rely on. Note that this patch is not intended to be merged into sage but provides a convenient mechanism to apply local patches without requiring that the spkg files are locally re-rolled.
  • The patch to standard/deps ensures that bash is used. By default, gmake will use /bin/sh to execute commands and the patched line sources local/bin/sage-env - which includes the bash'ism 'source' instead of '.'. Whilst that file begins with a #! line invoking basg, because it must be sourced, it will actually execute in the invoking shell.

atlas-3.8.3.p9

Various fixes to make it compile on FreeBSD

cliquer-1.2.p2

FreeBSD uses the same invocation as Linux to build shared libraries.

gap-4.4.10.p12

Patches (mostly taken from the FreeBSD port) to make gap compile on FreeBSD 8.x. These patches should be optional on FreeBSD/7.x.

libgcrypt-1.4.4.p0

Chase shared library name difference on FreeBSD. Sage local patch. Otherwise the gnutls build fails similar to:

gcc -std=gnu99 -shared  .libs/gnutls_openssl.o .libs/openssl_compat.o -Wl,--whole-archive ../lgl/.libs/liblgnu.a ../lib/minitasn1/.libs/libminitasn1.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/home/pjeremy/sage-3.4/local/lib -Wl,--rpath -Wl,/usr/local/lib -L/home/pjeremy/sage-3.4/spkg/build/gnutls-2.2.1.p1/src/lib/.libs -L/home/pjeremy/sage-3.4/local/lib -lgcrypt -L/usr/local/lib -lintl -liconv -lgpg-error -lgnutls  -Wl,-soname -Wl,libgnutls-openssl.so.27 -o .libs/libgnutls-openssl.so.27
/usr/bin/ld: /home/pjeremy/sage-3.4/local/lib/libgcrypt.a(libgcrypt_la-visibility.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/home/pjeremy/sage-3.4/local/lib/libgcrypt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
libtool: install: error: relink `libgnutls-openssl.la' with the above command before installing it
make[5]: *** [install-libLTLIBRARIES] Error 1
make[5]: Leaving directory `/home/pjeremy/sage-3.4/spkg/build/gnutls-2.2.1.p1/src/libextra'

matplotlib-0.99.1.p2

Add hooks to ensure that the local Sage versions of dependencies are used by FreeBSD. Otherwise you get:

BUILDING MATPLOTLIB
            matplotlib: 0.98.6svn
                python: 2.5.2 (r252:60911, Apr  1 2009, 08:50:05)  [GCC
                        4.3.4 20090326 (prerelease)]
              platform: freebsd7

REQUIRED DEPENDENCIES
                 numpy: no
                        * You must install numpy 1.1 or later to build
                        * matplotlib.
Error building matplotlib package.

Add support for FreeBSD later than 6.x. Otherwise you get :

REQUIRED DEPENDENCIES
Traceback (most recent call last):
  File "setup.py", line 119, in <module>
    if not check_for_numpy():
  File "/home/pjeremy/sage-3.4/spkg/build/matplotlib-0.98.5.3rc0-svn6910.p3/src/setupext.py", line 499, in check_for_numpy
    add_base_flags(module)
  File "/home/pjeremy/sage-3.4/spkg/build/matplotlib-0.98.5.3rc0-svn6910.p3/src/setupext.py", line 320, in add_base_flags
    [os.path.join(p, 'include') for p in basedir[sys.platform] ])
KeyError: 'freebsd7'
Error building matplotlib package.

gcc4.3 (though not gcc4.2) appears to define putchar() in a way that breaks the putchar() definitions inside ttconv. I couldn't quickly identify what the underlying cause was so I took the easy way out and undef'd the offending putchar() macro.

Individual character bounding boxes in AFM files do not have to be integral so convert each bounding box to a list of floats, rather than a list of ints. This corrects a problem where most of the tests would fail with ValueError: invalid literal for int() with base 10: '539.621'.

All three sub-patches are in #5873

numpy-1.2.0.p0

  • __init__.py needs a sage-specific patch to prefer sage_fortran on FreeBSD.

  • By default, numpy references threaded atlas libraries, as well as a custom variant on the lapack library, on FreeBSD. The reasoning behind this is unclear - there is nothing in the numpy documentation to indicate whether a threaded or non-threaded atlas is needed and the publicly available SVN logs do not mention this code. A query to the numpy mailing list elicited a response that either threaded or non-threaded atlas can be used and suggesting that the special-casing for FreeBSD may be obsolete. By default, atlas is built non-threaded and r-2.6.1.p23 assumes a non-threaded atlas and fails when only the threaded libraries are installed. Based on this, the special casing for FreeBSD was removed from numpy - it now uses the same libraries irrespective of the host OS.

r-2.6.1.p23

Pass CFLAGS, CPPFLAGS and LDFLAGS from the environment into the build process. This also corrects a typo in CPPFLAGS.

Note that FreeBSD needs the path to libiconv to be explicitly specified. In theory, --with-libiconv-prefix should work but configure script is broken and ignores that path when looking for libiconv. Hard-wire /usr/local/include and /usr/local/lib via xxFLAGS.

Note that the X11 detection in spkg-install will not work anywhere other than Linux. This needs future work.

These patches are all local to Sage.

sage-4.1

  • Compiling sage/combinat/partitions_c.cc fails because FreeBSD 7.x does not define sqrtl (it was introduced in FreeBSD 8.0). As a hackish workaround, define sqrtl to be sqrt.

  • FreeBSD does not include a definition for log2() in libm. Use a simplistic definition of log2(x) = log2(e) * ln(x) - this is numerically poor but can be cleaned up later if required.

sage_scripts-4.1

Patch sage-spkg to apply local patches. This patch also disables deletion of the spkg/build/FOO temporary directories - which was useful during porting. This latter patch can be safely removed.