Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port Sage to FreeBSD 11 #22679

Closed
dimpase opened this issue Mar 24, 2017 · 137 comments
Closed

port Sage to FreeBSD 11 #22679

dimpase opened this issue Mar 24, 2017 · 137 comments

Comments

@dimpase
Copy link
Member

dimpase commented Mar 24, 2017

Please see #26249 for the followup (for FreeBSD 12).

FreeBSD as of version 10 uses clang by default, and is closer to OSX in other ways too, so it would be a good free testing ground for the use of clang with Sage.

preparing tools:

  • install gcc6 and create fake gfortran by making a link to gfortran6
  • make sure as is new enough: pkg install binutils will install as version 2.28, and you need it to come first in PATH (i.e. make sure that /usr/local/bin comes before /usr/bin).
  • remove stale /lib/libgcc_s.so.1 and point it to the right one in /usr/local/lib/gcc6/ (perhaps there is a better way...)
  • install gmake, gawk, gsed, and create fake make and sed to point to gmake and gsed
  • make sure /bin/sh is actually bash
  • install pkgconf (FreeBSD's replacement of pkg-config)
  • install wget (needed for AtlasRep GAP package).
  • install icu (needed for R)

building Sage itself

starting from a clean git repo:

export CFLAGS="-fPIC"
export CXXFLAGS="-fPIC"
export LDFLAGS="-L/usr/local/lib -Wl,--add-needed -lm"
./configure CC=cc CXX=c++  #(this is clang 3.8.0 a.t.m.)
MAKE="make -j7" make build
MAKE="make -j4" make # building docs is very memory-hungry

HISTORICAL: Sage itself:

  • hack configure.ac to make freebsd allowed platform
  • deal with cephes' complex.h conflicting with numpy - cephes' complex.h conflicts with a numpy header on FreeBSD #22786
  • gf2x: only builds with SAGE_FAT_BINARY on
  • upgrade sqlite to version 3.17 - otherwise there are compiling problems with editline (see update sqlite to version 3.17 #22687)
  • flint: remove "-ascii -pedantic" flags from CFLAGS in configure
  • libraries (libgap, cddlib, etc) need -fPIC for CFLAGS (so we build with CC="cc -fPIC -pipe" ; (-pipe is probably not really needed)) - see on clang libgap needs -fPIC #22784
  • but gap cannot be built with CC="cc -fPIC -pipe", as it does something weird in ./configure, setting BASECC to be cc, and generating broken Makefile (with -fPIC and -pipe on two separate lines); so build gap with CC=cc
  • giac needs CFLAGS="-I/usr/local/include" to find libintl.h and LDFLAGS="-L/usr/local/lib -lintl" to link.
  • either provide /bin/bash or fix this properly (get rid of /bin/bash #22689)
  • Sage builds and runs, modulo linking issues with flint and arb, which can be fixed ad hoc by hand.
  • deal with cephes' libm not pulling system's libm, unless some arcane linker flags are used (see comments below)
  • old freebsd workaround for libgd removed in remove obsolete FreeBSD workaround in libgd #22785
  • ...

Depends on #12426
Depends on #23700

CC: @sagetrac-stephen @kiwifb @jdemeyer @jpflori

Component: porting: BSD

Author: Dima Pasechnik

Branch/Commit: u/dimpase/fbsd-support @ 4aaeeb4

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/22679

@dimpase dimpase added this to the sage-8.0 milestone Mar 24, 2017
@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase dimpase changed the title port Sage to FreeBSD 11. port Sage to FreeBSD 11 Mar 24, 2017
@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Mar 24, 2017

comment:6

cf my comments at
numpy/numpy#8530

for the need for /lib/libgcc_s.so.1 to be replaced.

Basically, gcc/gfortran and clang's toolchains are slightly incompatible; while workarounds are in place for OSX,
linking on freebsd makes it more or less mandatory.

@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Mar 26, 2017

comment:9

one of internal giac tests fail (harmlessly, I hope):

< -sqrt(6)*I*sqrt(sqrt(13)+3),sqrt(6)*I*sqrt(sqrt(13)+3),-sqrt(6)*sqrt(sqrt(13)-3),sqrt(6)*sqrt(sqrt(13)-3),0,
---
> sqrt(6)*I*sqrt(sqrt(13)+3),-sqrt(6)*I*sqrt(sqrt(13)+3),-sqrt(6)*sqrt(sqrt(13)-3),sqrt(6)*sqrt(sqrt(13)-3),0,
FAIL: chk_fhan16

@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Mar 27, 2017

Author: Dima Pasechnik

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Mar 27, 2017

Dependencies: #22687

@dimpase
Copy link
Member Author

dimpase commented Mar 27, 2017

New commits:

a44a934updating sqlite to version 3.17
a32b0c7let Sage accept freebsd
3178fbcremove -ascii -pedantic flags from configure
4691d92allow clang++ and libc++ combo on freebsd
90234a3using libintl from /usr/local/

@dimpase
Copy link
Member Author

dimpase commented Mar 27, 2017

Commit: 90234a3

@dimpase
Copy link
Member Author

dimpase commented Mar 27, 2017

Branch: u/dimpase/freebsd_experimental

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

df76ac2temporary fix to mke building on freebsd work

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from 90234a3 to df76ac2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from df76ac2 to f5a9b80

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

f5a9b80disable cephes installation on freebsd version >= 10

@dimpase

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from f5a9b80 to 9b622a8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

516f029Upgraded to R 3.3.3
cbe9134Merge branch 'public/r311' of git://trac.sagemath.org/sage into finalr
f029f66This simple patch removes an overkill check in R's configure.
c8a0b1bMerge branch 'public/r311' of trac.sagemath.org:sage into sqliteupdate
d0d5ca7update fplll/fpylll to 5.1.0/0.2.4dev
9f702f3Merge branch 'u/malb/22643-fplll-upgrade' of trac.sagemath.org:sage into sqliteupdate
1201132LONG_LONG_MAX is an obsolete gnu-ism
276e658R on freebsd needs this for libcurl
0c0c603Write custom create_extension() for Cython
9b622a8Merge branch 'u/jdemeyer/use_create_extension___from_cython' of trac.sagemath.org:sage into sqliteupdate

@dimpase

This comment has been minimized.

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Aug 31, 2017

comment:89

ticket description should be edited on an updated ticket page, duh...

@dimpase
Copy link
Member Author

dimpase commented Aug 31, 2017

Changed dependencies from #12426, #23565 to #12426, #23565, #23700

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Aug 31, 2017

comment:90

The segfault in the bottom part of comment 87 remains the same if gc and libatomic_ops are rebuilt with threads disabled.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

eacd3d6Merge branch 'develop' of trac.sagemath.org:sage into fbsdon81
6f17c02Merge branch 'compiler' into clang-progress
ceb3bf5conform to new packaging in place since 8.1.beta1
07bfc5aMerge branch 'compiler' into clang-progress
d8cb828Merge branch 'compiler' into clang-progress
0ec453bMerge branch 'develop' into clang-progress
a7bf51fMerge branch 'u/fbissey/clang-progress' of trac.sagemath.org:sage into fbsdon81

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 8, 2017

Changed commit from d04c9f7 to a7bf51f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 6, 2017

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

f9ca589Merge branch 'u/dimpase/gcupdate' of trac.sagemath.org:sage into gc76
e365c32backported patch for FreeBSD support
c98c98cMerge branch 'u/dimpase/gcupdate' of trac.sagemath.org:sage into fbsdon81
83815b2Merge branch 'develop' into clang-progress
40d3214Merge branch 'develop' into clang-progress
6902166Simplify gfortran spkg-install a bit. Thanks to Jeroen Demeyer for the feedback on this.
afca2b6no need to be so verbose about gfortran.
235c09eIncluding upstream PR 29 to compile with xcode 9 until we have a new release.
48462eaMerge branch 'eclib-xcode9' into clang-progress
4aaeeb4Merge branch 'u/fbissey/clang-progress' of trac.sagemath.org:sage into fbsdon81

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 6, 2017

Changed commit from a7bf51f to 4aaeeb4

@dimpase
Copy link
Member Author

dimpase commented Oct 11, 2017

comment:93

New code for RiemannSurface uses Voronoi from scipy. But the latter is broken on FreeBSD:

$ ./sage --python
Python 2.7.13 (default, Oct 11 2017, 17:41:18) 
[GCC 4.2.1 Compatible Clang 6.0.0 ] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> points = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2],[2, 0], [2, 1], [2, 2]])
>>> from scipy.spatial import Voronoi
>>> Voronoi(points)
Segmentation fault (core dumped)

(might be due to careless use of threading...)

Note that the previously used in Sage version of scipy 0.17.1, still works.

@dimpase
Copy link
Member Author

dimpase commented Oct 20, 2017

comment:94

it turns out that scipy's Voronoi works with the system's Python 2.7.14, but not with Sage's one (there are BSD-only Python patches; trying them now).

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member Author

dimpase commented Dec 29, 2017

Changed dependencies from #12426, #23565, #23700 to #12426, #23700

@dimpase
Copy link
Member Author

dimpase commented Sep 11, 2018

comment:96

Please see #26249 for a followup, for FreeBSD version 12, where things are considerably simpler.

@dimpase dimpase removed this from the sage-8.1 milestone Sep 11, 2018
@dimpase
Copy link
Member Author

dimpase commented Sep 13, 2018

Reviewer: Dima Pasechnik

@dimpase

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants