Differences between revisions 9 and 17 (spanning 8 versions)
Revision 9 as of 2010-07-25 07:03:53
Size: 27933
Editor: PeterJeremy
Comment: numpy tweaks to make liblapack.so behave
Revision 17 as of 2022-04-05 01:21:25
Size: 0
Editor: mkoeppe
Comment: outdated
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from freebsd/sage-4.4.4
= Sage FreeBSD 8.x build notes for Sage 4.5 =

Note that this is a work-in-progress and not currently complete
{{{#!wiki comment
In general, commented-out sections are direct copies of my previous porting efforts and may not be required for sage-4.5. They have been left in case they are found to be required during testing.
}}}

'''Contents'''
<<TableOfContents(2)>>

== 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.1.7)
 * Install ports/devel/gmake
 * Install ports/lang/gcc45 - 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.5 but is expected to work.

 * Unpack sage-4.5.tar
 * `cd sage-4.5`
 * Unpack [[attachment:sage-4.5.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/gfortran45 local/bin/gfortran`
  * Various patches as described below into `spkg/patches`
 * Build Sage
  . `LD_LIBRARY_PATH=/usr/local/lib/gcc45 SAGE_PORT=yes SAGE_FORTRAN=/usr/local/bin/gfortran45 SAGE_FORTRAN_LIB=/usr/local/lib/gcc45/libgfortran.so gmake`

Note that the LD_LIBRARY_PATH is needed to work arounf configuration errors in the FreeBSD port of gcc45 - see http://www.freebsd.org/cgi/query-pr.cgi?pr=129518

The `gmake` to `make` symlink is necessary to compile (eg) eclib - which is documented as requiring GNU make, and has this
symlink as a suggested workaround.

== Current Status ==

Currently, the following tests fail on FreeBSD 8.1-PRERELEASE/amd64.
{{{#!wiki comment
  Full logs at [[attachment:sage-4.4.4.freebsd8.1-amd64.test.log]].
}}}
{{{
TBD
}}}
{{{#!wiki comment
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
 * Incorrect signs on (non-small) real or imaginary parts of complex numbers
 * No csin(), f_cdf()
 * Slight numerical differences eg '-0.629960524947437' instead of '-0.62996052494743...'.
 * Whitespace differences
 * Exception "memory usage not implemented"
}}}
== 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.

=== atlas-3.8.3.p12 ===
`liblapack.so` includes undefined references to `__powidf2` and `__powisf2`, which are defined in `libgcc` (no other Sage shared libraries appear to rely on `libgcc` helper functions. Unfortunately, for reasons I don't fully understand, linking `liblapack.so` against `libgcc.a` fails, even when building a normal executable. One example of the resultant error occurs when configuring numpy:
{{{
gcc _configtest.o -L/tank/obj/sage/sage-4.5/local/lib -llapack -lf77blas -lcblas -latlas -o _configtest
/usr/local/bin/ld: _configtest: hidden symbol `__powidf2' in /usr/local/lib/gcc45/gcc/x86_64-portbld-freebsd8.1/4.5.1/libgcc.a(_powidf2.o) is referenced by DSO
/usr/local/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
/usr/local/bin/ld: _configtest: hidden symbol `__powidf2' in /usr/local/lib/gcc45/gcc/x86_64-portbld-freebsd8.1/4.5.1/libgcc.a(_powidf2.o) is referenced by DSO
/usr/local/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
Status: 255
}}}

The fix is to add a dependency on `libgcc_s.so` when (re-)building `liblapack.so` in `make_correct_shared.sh`.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]

=== cephes-2.8 ===
 * FreeBSD does not yet include a full C99 libm so enable cephes on FreeBSD.
 * Correct error in the patched c9x-complex/makefile that refers to non-existent test sources.
 * Enable '-e' option on spkg-install to catch errors

The overall approach used on the FreeBSD is for cephes to create `complex.h`, `math.h` and `libm.so` which are installed under $SAGE_LOCAL and contain the missing C99 functions then fall back to the FreeBSD base versions for functions existing in FreeBSD.
This mean that references to `<math.h>`, `<complex.h>` or `-lm` will appear to reference a complete set of C99 functions, split over two physical locations.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/9543|#9543]]

{{{#!wiki comment
=== cliquer-1.2.p2 ===
FreeBSD uses the same invocation as Linux to build shared libraries. This patch is necessary to allow cliquer to build.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/7824|#7824]]
}}}
=== cvxopt-0.9.p8 ===
Needs patch to ensure that $SAGE_LOCAL/include is included in the search path to correctly pick up the C99 functions that do not exist in the FreeBSD base system (see comments on cephes).

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
{{{#!wiki comment
=== ?eclib-20080310.p7 ===
Various 'make' fixes - see above. Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5864|#5864]]
}}}
{{{#!wiki comment
=== ?ecm-6.2.1.p0 ===
Portability fixes so the configure script works with a POSIX shell. Submitted upstream as http://gforge.inria.fr/tracker/index.php?func=detail&aid=7639&group_id=135&atid=623

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
=== flintqs-20070817.p5 ===

`TonelliShanks.h` references `int32_t` but does not directly include `<stdint.h>`. On FreeBSD using gcc45 (but not the base gcc), this causes compilation to fail with:
{{{
g++ -ansi -c TonelliShanks.cpp -o TonelliShanks.o -I/tank/obj/sage/sage-4.5/local/include -Wall -Wno-sign-compare -fomit-frame-pointer -O2
In file included from TonelliShanks.cpp:31:0:
TonelliShanks.h:41:8: error: 'int32_t' does not name a type
TonelliShanks.h:43:51: error: 'int32_t' has not been declared
TonelliShanks.cpp:67:1: error: 'int32_t' does not name a type
TonelliShanks.cpp:136:54: error: 'int32_t' has not been declared
TonelliShanks.cpp: In function 'void sqrtmodpk(__mpz_struct*, __mpz_struct*, __mpz_struct*, __mpz_struct*, int)':
TonelliShanks.cpp:140:11: error: 'int32_t' was not declared in this scope
TonelliShanks.cpp:140:19: error: expected ';' before 'i'
TonelliShanks.cpp:140:25: error: 'i' was not declared in this scope
make[2]: *** [TonelliShanks.o] Error 1
make[2]: Leaving directory `/tank/obj/sage/sage-4.5/spkg/build/flintqs-20070817.p5/src'
Error building William Hart's Quadratic Sieve
}}}

As a work-around, make `TonelliShanks.h` idempotent on FreeBSD (it probably should be on all architectures but making the patch FreeBSD-specific simplifies testing).

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/9545|#9545]]

{{{#!wiki comment
=== ?fortran-20071120.p5 ===
FreeBSD doesn't have a '-f' option on `readlink` - sage local patch.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?freetype-2.3.5.p0 ===
Various 'make' fixes - see above. Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5866|#5866]]
}}}
{{{#!wiki comment
=== ?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.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?gd-2.0.35.p1 ===
Sage local patch needed to make gd correctly detect libiconv: [[http://trac.sagemath.org/sage_trac/ticket/5867|#5867]]. Otherwise it fails with:
{{{
checking for shared library run path origin... done
checking for iconv... no, consider installing GNU libiconv
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking whether iconv.h defines iconv_t... yes
...
 gcc -DHAVE_CONFIG_H -I. -I. -I. -I/home/pjeremy/sage-3.4/local/include/freetype2 -I/home/pjeremy/sage-3.4/local/include -I/home/pjeremy/sage-3.4/local/include -fPIC -g -I/home/pjeremy/sage-3.4/local/include -I/home/pjeremy/sage-3.4/local/include/freetype2/ -MT gdkanji.lo -MD -MP -MF .deps/gdkanji.Tpo -c gdkanji.c -fPIC -DPIC -o .libs/gdkanji.o
gdkanji.c:30: error: conflicting types for 'libiconv'
/usr/local/include/iconv.h:83: error: previous declaration of 'libiconv' was here
gdkanji.c:40: error: conflicting types for 'libiconv'
/usr/local/include/iconv.h:83: error: previous declaration of 'libiconv' was here
make[4]: *** [gdkanji.lo] Error 1
make[4]: Leaving directory `/home/pjeremy/sage-3.4/spkg/build/gd-2.0.35.p1/src'
}#}}

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?iml-1.0.1.p11 ===
Remove a stray warning by not attempting to execute ${CFLAGS}

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== libgcrypt-1.4.4.p1 ===
Chase shared library name difference on FreeBSD. Sage local patch. Otherwise the gnutls build fails similar to:
{{{
(cd /home/peter/sage/sage-4.4.4/spkg/build/gnutls-2.2.1.p4/src/libextra; /bin/sh ../libtool --tag=CC --mode=relink gcc -std=gnu99 -g -O2 -D_REENTRANT -D_THREAD_SAFE -pipe -I/home/peter/sage/sage-4.4.4/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -Wno-pointer-sign -no-undefined -L../lib/.libs -L/home/peter/sage/sage-4.4.4/local/lib -lopencdk -L/usr/local/lib -L/usr/local/lib -lgcrypt -L/usr/local/lib -lgpg-error -L/usr/local/lib -lintl -L/usr/local/lib -liconv -L/home/peter/sage/sage-4.4.4/local/lib -lz -R/home/peter/sage/sage-4.4.4/local/lib -R/usr/local/lib -version-info 27:2:1 -o libgnutls-extra.la -rpath /home/peter/sage/sage-4.4.4/local/lib gnutls_extra.lo gnutls_openpgp.lo gnutls_ia.lo openpgp/libgnutls_openpgp.la ../lgl/liblgnu.la ../lib/libgnutls.la minilzo/libminilzo.la )
gcc -std=gnu99 -shared .libs/gnutls_extra.o .libs/gnutls_openpgp.o .libs/gnutls_ia.o -Wl,--whole-archive openpgp/.libs/libgnutls_openpgp.a ../lgl/.libs/liblgnu.a minilzo/.libs/libminilzo.a -Wl,--no-whole-archive -Wl,--rpath -Wl,/home/peter/sage/sage-4.4.4/local/lib -Wl,--rpath -Wl,/usr/local/lib -L/home/peter/sage/sage-4.4.4/spkg/build/gnutls-2.2.1.p4/src/lib/.libs -L/home/peter/sage/sage-4.4.4/local/lib -lopencdk -L/usr/local/lib -lz -lgcrypt -lintl -liconv -lgpg-error -lgnutls -Wl,-soname -Wl,libgnutls-extra.so.27 -o .libs/libgnutls-extra.so.27
/usr/bin/ld: /home/peter/sage/sage-4.4.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/peter/sage/sage-4.4.4/local/lib/libgcrypt.a: could not read symbols: Bad value
libtool: install: error: relink `libgnutls-extra.la' with the above command before installing it
*** Error code 1

Stop in /home/peter/sage/sage-4.4.4/spkg/build/gnutls-2.2.1.p4/src/libextra.
*** Error code 1
} }}

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/7823|#7823]]
}}}
{{{#!wiki comment
=== ?libgpg_error-1.6.p0 ===
Chase shared library name difference on FreeBSD. Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5869|#5869]]
. Otherwise the gnutls build fails:
{{{
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/libgpg-error.a(libgpg_error_la-strsource.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
/home/pjeremy/sage-3.4/local/lib/libgpg-error.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'
}#}}

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?libm4ri-20090128 ===
The configure script is pretty much beyond redemption on FreeBSD. Instead fix the autoconf inputs to support FreeBSD and re-run autoconf. The libm4ri fixes have all be forwarded to the libm4ri maintainer and accepted by them.

Also ensure that CPPFLAGS from the environment is passed into the libm4ri build process. Sage local patch.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?linbox-1.1.6 ===
Detect FreeBSD and appropriately select BLAS and Atlas libraries. Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5870|#5870]].
}}}

=== matplotlib-0.99.3 ===

Add support for FreeBSD later than 6.x. Otherwise you get :
{{{
BUILDING MATPLOTLIB
            matplotlib: 0.99.1
                python: 2.6.2 (r262:71600, Jan 3 2010, 12:58:40) [GCC
                        4.2.1 20070719 [FreeBSD]]
              platform: freebsd8

REQUIRED DEPENDENCIES
Traceback (most recent call last):
  File "setup.py", line 123, in <module>
    if not check_for_numpy():
  File "/home/peter/sage/sage-4.4.4/spkg/build/matplotlib-0.99.1.p2/src/setupext.py", line 506, in check_for_numpy
    add_base_flags(module)
  File "/home/peter/sage/sage-4.4.4/spkg/build/matplotlib-0.99.1.p2/src/setupext.py", line 327, in add_base_flags
    [os.path.join(p, 'include') for p in basedir[sys.platform] ])
KeyError: 'freebsd8'
}}}

{{{#!wiki comment
*** It's no longer practical to build Sage on FreeBSD using gcc43 so this patch has been removed. It may still be required with gcc 44 and so hasn't been deleted:
gcc4.3 (though not gcc4.2 or gcc4.5) 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.
}}}

Trac [[http://trac.sagemath.org/sage_trac/ticket/5873|#5873]]
Reported upstream as https://sourceforge.net/tracker/?func=detail&aid=3031051&group_id=80706&atid=560722

{{{#!wiki comment
=== ?mpfr-2.4.1 ===
Portability fixes so the configure script works with a POSIX shell.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== ?ntl-5.4.2.p6 ===
Correctly pass `-fPIC` when building the shared library - [[http://trac.sagemath.org/sage_trac/ticket/5872|#5872]]

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}

=== numpy-1.3.0.p3 ===
 * `__init__.py` needs a sage-specific patch to prefer sage_fortran on FreeBSD. This is necessary to prevent matplotlib dying with:
{{{
BUILDING MATPLOTLIB
            matplotlib: 0.99.1
                python: 2.6.2 (r262:71600, Jan 3 2010, 12:58:40) [GCC
                        4.2.1 20070719 [FreeBSD]]
              platform: freebsd8

REQUIRED DEPENDENCIES
                 numpy: no
                        * You must install numpy 1.1 or later to build
                        * matplotlib.
}}}
 * 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 [[http://mail.scipy.org/pipermail/numpy-discussion/2009-August/044523.html|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.
 * `$SAGE_LOCAL/include` needs to be added to the search path to pick up the correct `<math.h>` (see cephes).

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/7831|#7831]]

=== pari-2.3.5.p1 ===
The `Configure` script does not detect `log2`, which it should. (This appears to be an intrinsic bug because it doesn't detect either `exp2` or `log2` on Linux). The top line of spkg-install is also corrupt.

These are left for now because [[http://trac.sagemath.org/sage_trac/ticket/9343|#9343]] includes a new pari - which I have not checked yet.

{{{#!wiki comment
=== ?python-2.5.2.p9 ===
Include the python patches from the FreeBSD port. This adds support for FreeBSD 7 and 8.

The patch to Lib/test/seq_tests.py disables the memory-exhaustion tests on 64-bit architectures. Otherwise, those tests allocate a 32GB chunk of memory and attempt to use it all. The default process size on FreeBSD/amd64 allows the allocation to succeed but actually using the memory generally results in swap exhaustion. This fix comes from python-2.5.4.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}
{{{#!wiki comment
=== r-2.9.2 ===
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. Without this change, you get:
{{{
checking iconv.h usability... no
checking iconv.h presence... no
checking for iconv.h... no
checking for iconv... no
checking for iconvlist... no
configure: error: --with-iconv=yes (default) and a suitable iconv is not available
Error configuring R.
} }}

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.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/7833|#7833]]
}}}

=== sage-4.5 ===
 * 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 on older versions of FreeBSD. This will be removed once the cephes integration is complete.
 * 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. This will be removed once the cephes integration is complete.
 * `sage/groups/perm_gps/permgroup_element.c` fails to compile because `LONG_LONG_MAX` is not available on FreeBSD. Some googling suggests that this macro is either a GNU extension or is deprecated in C99 and has been replaced by `LLONG_MAX` - I have not been able to find a direct reference but indirect references include the following links: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=168346#19 http://linux.softpedia.com/progChangelog/GNU-ddrescue-Changelog-6106.html http://clang.llvm.org/doxygen/limits_8h-source.html

Remaining issues include:
 * `sage/symbolic/pynac.cpp` fails to compile because FreeBSD libm is mostly missing long double functions - specifically tgammal() and lgammal() in this case. This is being resolved by integrating cephes into the FreeBSD build of sage.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]

=== sage_scripts-4.5 ===
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.

{{{#!wiki comment
=== ?scipy-20071020-0.6.p4 ===
scipy uses local/lib/python2.5/site-packages/numpy/distutils/fcompiler/gnu.py to locate a Fortran compiler. This code only looks for g77, f77, gfortran and f95. Whilst it has some patches to look in sage_fortran, this does not appear to work for scipy. The work-around is to create a symlink to the actual Fortran compiler in local/bin, otherwise the scipy build fails with:
{{{
building 'mach' library
using additional config_fc from setup script for fortran compiler: {'noopt': ('scipy/integrate/setup.py', 1)}
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
Traceback (most recent call last):
  File "setup.py", line 53, in <module>
    setup_package()
  File "setup.py", line 45, in setup_package
    configuration=configuration )
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/core.py", line 184, in setup
    return old_setup(**new_attr)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/command/build.py", line 37, in run
    old_build.run(self)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/command/build_clib.py", line 92, in run
    self.build_libraries(self.libraries)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/command/build_clib.py", line 103, in build_libraries
    self.build_a_library(build_info, lib_name, libraries)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/command/build_clib.py", line 156, in build_a_library
    fcompiler.customize(base_config_fc)
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/fcompiler/__init__.py", line 449, in customize
    self.find_executables()
  File "/home/pjeremy/sage-3.4/local/lib/python2.5/site-packages/numpy/distutils/fcompiler/__init__.py", line 342, in find_executables
    raise CompilerNotFound('%s: f90 nor f77' % ctype)
numpy.distutils.fcompiler.CompilerNotFound: gnu95: f90 nor f77
}#}}

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/?|#?]]
}}}

=== singular-3.1.0.4.p7 ===
By default, you get the following, which is corrected by the patch to singuname.sh:
{{{
make[2]: Entering directory `/home/peter/sage/sage-4.4.4/spkg/build/singular-3-1-0-4-20090818.p2/src'
make[2]: *** No rule to make target `distclean'. Stop.
make[2]: Leaving directory `/home/peter/sage/sage-4.4.4/spkg/build/singular-3-1-0-4-20090818.p2/src'
rm: /home/peter/sage/sage-4.4.4/local/bin/Singular*: No such file or directory
creating cache ./config.cache
checking uname for singular... unknown
configure: error: Unknown architecture: Check singuname.sh
Unable to configure Singular.
}}}

Correct configure script for amd64 by patching the autoconf inputs and re-running autoconf. This corrects a problem where linking libsingular.so reports lots of undefined references to both internal `om`* functions and functions within libncurses.

Several other trivial fixes to support dynamic linking on FreeBSD/amd64.

Trac ticket: [[http://trac.sagemath.org/sage_trac/ticket/7832|#7832]]

{{{#!wiki comment
The rationale behind original code to disable `__cplusplus` in cf_gmp.h is unclear. The result using gcc4.3 on FreeBSD is definitely broken as cf_gmp.h includes gmp.h which includes string.h - which results in strcat() and friends being declared without a surrounding `extern "C" {...}` block. This causes the code to linvoke (non-existent) C++ versions of strcat(char *, const char *), rather than the standard C library strcat(). Commenting out this code fixes the problem. The failure looks
like:
{{{
g++ -O3 -g -fPIC -pipe -I. -I../kernel -I/home/pjeremy/sage-3.4/local/include -I/home/pjeremy/sage-3.4/local/include -I/home/pjeremy/sage-3.4/local/include -fno-implicit-templates -DNDEBUG -DOM_NDEBUG -Dx86_64_freebsd -DHAVE_CONFIG_H -DGENTABLE -o gentable claptmpl.o iparith.cc tesths.cc mpsr_Tok.cc 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 -L../kernel -lkernel -L/home/pjeremy/sage-3.4/local/lib -L/home/pjeremy/sage-3.4/local/lib -lm -lsingfac -lsingcf -lntl -lgmp -lreadline -lncurses -lm -lomalloc ../kernel/mmalloc.o
iparith.cc:443: warning: deprecated conversion from string constant to 'char*'
...
iparith.cc:443: warning: deprecated conversion from string constant to 'char*'
mpsr_Tok.cc: In function 'void mpsr_ttGen()':
mpsr_Tok.cc:538: warning: deprecated conversion from string constant to 'char*'
/home/pjeremy/sage-3.4/local/lib/libsingcf.a(NTLconvert.o)(.text+0x2fa5): In function `convertZZ2CF(NTL::ZZ)':
/home/pjeremy/sage-3.4/spkg/build/singular-3-0-4-4-20080711.p4/src/factory/NTLconvert.cc:649: undefined reference to `strcat(char*, char const*)'
/home/pjeremy/sage-3.4/local/lib/libsingcf.a(NTLconvert.o)(.text+0x2fbf):/home/pjeremy/sage-3.4/spkg/build/singular-3-0-4-4-20080711.p4/src/factory/NTLconvert.cc:662: undefined reference to `strlen(char const*)'
collect2: ld returned 1 exit status
make[4]: *** [iparith.inc] Error 1
make[4]: Leaving directory `/home/pjeremy/sage-3.4/spkg/build/singular-3-0-4-4-20080711.p4/src/Singular'
}}}
{{{#!wiki comment
=== ?tachyon-0.98beta.p8 ===
tachyon does include BSD support (though the code advises that it hasn't been tested for a while). Looking though the source code, there's no obvious bitrot so add FreeBSD support to the spkg-install script. As noted, I haven't added support for either threaded or 64-bit tachyon. The former shouldn't be too difficult to add and the MacOS-X port implies it is optional. The 64-bit support is solely an optimisation - a test to detect wrap-around of `long` integers is removed since wrap-around isn't possible with 64-bit longs.

Sage local patch: [[http://trac.sagemath.org/sage_trac/ticket/5875|#5875]]
}}}