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

cygwin-standard: sagelib build fails #30396

Closed
mkoeppe opened this issue Aug 19, 2020 · 77 comments
Closed

cygwin-standard: sagelib build fails #30396

mkoeppe opened this issue Aug 19, 2020 · 77 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 19, 2020

https://github.com/sagemath/sage/runs/1003662756

  [sagelib-9.2.beta9]   gcc -shared -Wl,--enable-auto-image-base -L/cygdrive/d/a/sage/sage/local/lib -Wl,-rpath,/cygdrive/d/a/sage/sage/local/lib build/temp.cygwin-3.1.6-x86_64-3.7/build/cythonized/sage/ext/interpreters/wrapper_rr.o -L/cygdrive/d/a/sage/sage/local/lib/python3.7/config -L/usr/lib -lmpfr -lgmp -lpython3.7m -o build/lib.cygwin-3.1.6-x86_64-3.7/sage/ext/interpreters/wrapper_rr.cpython-37m-x86_64-cygwin.dll -lpari
  [sagelib-9.2.beta9]   g++ -shared -Wl,--enable-auto-image-base -L/cygdrive/d/a/sage/sage/local/lib -Wl,-rpath,/cygdrive/d/a/sage/sage/local/lib build/temp.cygwin-3.1.6-x86_64-3.7/build/cythonized/sage/symbolic/expression.o -L/cygdrive/d/a/sage/sage/local/lib/python3.7/config -L/usr/lib -lgmp -lpynac -lpython3.7m -o build/lib.cygwin-3.1.6-x86_64-3.7/sage/symbolic/expression.cpython-37m-x86_64-cygwin.dll -lpari
  [sagelib-9.2.beta9]   error: command 'gcc' failed with exit status 1

CC: @embray @frederichan-IMJPRG @sagetrac-parisse @kiwifb @jhpalmieri @dimpase

Component: porting: Cygwin

Author: Matthias Koeppe

Branch/Commit: e673110

Reviewer: Darij Grinberg, Travis Scrimshaw

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

@mkoeppe mkoeppe added this to the sage-9.2 milestone Aug 19, 2020
@embray
Copy link
Contributor

embray commented Aug 31, 2020

comment:1

Without an error message I wouldn't even know how to begin interpreting this. Is it something you can reproduce locally? Did anything change recently in that file?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 31, 2020

comment:2

That's exactly my problem as well. Very consistently in these builds I get this error but no error message.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 31, 2020

comment:3

Local replication of this failure would already be a step forward. (I don't have a Windows machine.)

@vbraun
Copy link
Member

vbraun commented Sep 8, 2020

comment:4

Realistically that can't be a release blocker then

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:5

I have what appears to be the same error. 9.2.beta12, after distclean.
Last lines after what appears to be a full compilation of sagelib:

[sagelib-9.2.beta12] error: command 'g++' failed with exit status 1
[sagelib-9.2.beta12]
[sagelib-9.2.beta12] real       191m8.476s
[sagelib-9.2.beta12] user       176m28.216s
[sagelib-9.2.beta12] sys        5m47.132s
make[4]: *** [Makefile:2161: sagelib-no-deps] Error 1
make[3]: *** [Makefile:2161: /home/skraeling/sage/local/var/lib/sage/installed/sagelib-9.2.beta12] Error 2
make[2]: *** [Makefile:1769: all-build] Error 2
make[2]: Leaving directory '/home/skraeling/sage/build/make'

Full log: https://www.dropbox.com/s/jjmgib33r9z0359/install.log?dl=0

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:7

Thanks for checking this.

I see this error:

[sagelib-9.2.beta12] gcc -shared -Wl,--enable-auto-image-base -L/home/skraeling/sage/local/lib -Wl,-rpath,/home/skraeling/sage/local/lib build/temp.cygwin-3.1.6-x86_64-3.6/build/cythonized/sage/misc/sage_ostools.o -L/home/skraeling/sage/local/lib/python3.6/config -L/usr/lib -lpython3.6m -o build/lib.cygwin-3.1.6-x86_64-3.6/sage/misc/sage_ostools.cpython-36m-x86_64-cygwin.dll
[sagelib-9.2.beta12] /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: build/temp.cygwin-3.1.6-x86_64-3.6/build/cythonized/sage/misc/sage_ostools.o: in function `__pyx_pf_4sage_4misc_12sage_ostools_5fix_for_ticket_30157':
[sagelib-9.2.beta12] /home/skraeling/sage/build/pkgs/sagelib/src/build/cythonized/sage/misc/sage_ostools.c:4052: undefined reference to `sqlite3_initialize'
[sagelib-9.2.beta12] /home/skraeling/sage/build/pkgs/sagelib/src/build/cythonized/sage/misc/sage_ostools.c:4052:(.text+0xe05): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sqlite3_initialize'
[sagelib-9.2.beta12] collect2: error: ld returned 1 exit status

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:8

Could you rerun make build one more time after this failure and post the log?

Could you also post your config.log?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:9

Looks like this is coming from #30157

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

Commit: d133f2c

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:11

Here's a possible fix


New commits:

d133f2csrc/sage/misc/sage_ostools.pyx: Add distutils header

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:12

Sadly, doesn't help.
https://www.dropbox.com/s/z2ayo5teqhfqvoa/install-last.log?dl=0

Where do I find config.log?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:13

Replying to @darijgr:

Where do I find config.log?

Root of the sage tree

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:14

Interesting. The file is supposedly there but actually isn't. But this reminds me of the fact that I have not used ./configure. Maybe I should try again....

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:15

Replying to @darijgr:

Sadly, doesn't help.

It did, actually, now other errors are preventing the build.

[sagelib-9.2.beta12] g++ -shared -Wl,--enable-auto-image-base -L/home/skraeling/sage/local/lib -Wl,-rpath,/home/skraeling/sage/local/lib build/temp.cygwin-3.1.6-x86_64-3.6/build/cythonized/sage/libs/giac/giac.o -L/home/skraeling/sage/local/lib/python3.6/config -L/usr/lib -lgmp -lgiac -lpython3.6m -o build/lib.cygwin-3.1.6-x86_64-3.6/sage/libs/giac/giac.cpython-36m-x86_64-cygwin.dll -lpari
[sagelib-9.2.beta12] /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /home/skraeling/sage/local/lib/libgiac.a(moyal.o): in function `giac::Airy_Ai(giac::gen const&, giac::context const*)':
[sagelib-9.2.beta12] /home/skraeling/sage/local/var/tmp/sage/build/giac-1.5.0.87p0/src/src/moyal.cc:243: undefined reference to `gsl_sf_airy_Ai'
[sagelib-9.2.beta12] /home/skraeling/sage/local/var/tmp/sage/build/giac-1.5.0.87p0/src/src/moyal.cc:243:(.text+0x63b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `gsl_sf_airy_Ai'
....

Looks like libgiac is underlinked

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:16

(This comes from #29171)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2020

Changed commit from d133f2c to a36d00a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 10, 2020

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

a36d00asrc/sage/libs/giac/giac.pyx: Add libraries to work around underlinked libgiac on cygwin

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 10, 2020

comment:18

Try with this one please

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:19

config.log (just ran ./configure): https://www.dropbox.com/s/lv2r3wq2qz55th3/config.log?dl=0


New commits:

a36d00asrc/sage/libs/giac/giac.pyx: Add libraries to work around underlinked libgiac on cygwin

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:20

New failure, with your new commit: https://www.dropbox.com/s/lv2r3wq2qz55th3/config.log?dl=0

@darijgr
Copy link
Contributor

darijgr commented Sep 10, 2020

comment:21

Oops, wrong link.
https://www.dropbox.com/s/1lsao5jh7l8i67y/install3.log?dl=0

@darijgr
Copy link
Contributor

darijgr commented Sep 11, 2020

comment:46

This errors out again again:
https://www.dropbox.com/s/do329gofsaxxw3w/install6.log?dl=0
Note that I have not run "make distclean" after pulling; I've just done the ./configure you suggested and tried to make build again.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2020

comment:47

Attachment: giac-1.5.0.87p2.tar.bz2.gz

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

c47b078build/pkgs/giac: Fixup: Ensure shared library build on cygwin

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 11, 2020

Changed commit from d48a91a to c47b078

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 11, 2020

comment:48

Thanks for testing. Here's a better version

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 12, 2020

Changed reviewer from Darij Grinberg to Darij Grinberg, https://github.com/mkoeppe/sage/actions/runs/250810927

@darijgr
Copy link
Contributor

darijgr commented Sep 12, 2020

comment:50

Smaller install.log, still failing (don't mind the interrupt; I had to turn off my PC in the process). Again it's sagelib that's failing, not giac.
https://www.dropbox.com/s/xhzrzwzt27643wf/install7.log?dl=0

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 12, 2020

comment:51

Thanks for testing, we are getting closer.

[giac-1.5.0.87p2] /usr/bin/bash ../libtool  --tag=CXX   --mode=link g++ -std=gnu++11  -g -O2  -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -no-undefined -L/home/skraeling/sage/local/lib -Wl,-rpath,/home/skraeling/sage/local/lib  -o libgiac.la -rpath /home/skraeling/sage/local/lib input_lexer.lo sym2poly.lo gausspol.lo threaded.lo moyal.lo maple.lo ti89.lo mathml.lo misc.lo permu.lo quater.lo desolve.lo input_parser.lo symbolic.lo index.lo modpoly.lo modfactor.lo ezgcd.lo derive.lo solve.lo intg.lo intgab.lo risch.lo lin.lo series.lo subst.lo vecteur.lo sparse.lo csturm.lo tex.lo global.lo ifactor.lo alg_ext.lo gauss.lo isom.lo plot.lo plot3d.lo rpn.lo prog.lo pari.lo cocoa.lo unary.lo usual.lo identificateur.lo gen.lo tinymt32.lo first.lo TmpLESystemSolver.lo TmpFGLM.lo help.lo lpsolve.lo optimization.lo signalprocessing.lo graphe.lo graphtheory.lo nautywrapper.lo markup.lo kdisplay.lo kadd.lo -lntl  -lpari -lgsl -lopenblas -lm  -lopenblas  -lopenblas  -lintl -lrt -lpthread -lnauty -lcurl -lglpk -ldl -lm -lecm -lmpfi -lmpfr -lgmp 
[giac-1.5.0.87p2] 
[giac-1.5.0.87p2] *** Warning: linker path does not have real file for library -lnauty.
[giac-1.5.0.87p2] *** I have the capability to make that library automatically link in when
[giac-1.5.0.87p2] *** you link to this library.  But I can only do this if you have a
[giac-1.5.0.87p2] *** shared version of the library, which you do not appear to have
[giac-1.5.0.87p2] *** because I did check the linker path looking for a file starting
[giac-1.5.0.87p2] *** with libnauty and none of the candidates passed a file format test
[giac-1.5.0.87p2] *** using a file magic. Last file checked: /home/skraeling/sage/local/lib/libnauty.a
[giac-1.5.0.87p2] *** The inter-library dependencies that have been dropped here will be
[giac-1.5.0.87p2] *** automatically added whenever a program is linked with this library
[giac-1.5.0.87p2] *** or is declared to -dlopen it.
[giac-1.5.0.87p2] 
[giac-1.5.0.87p2] *** Since this library must not contain undefined symbols,
[giac-1.5.0.87p2] *** because either the platform does not support them or
[giac-1.5.0.87p2] *** it was explicitly requested with -no-undefined,
[giac-1.5.0.87p2] *** libtool will only create a static version of it.
[giac-1.5.0.87p2] libtool: link: ar cru .libs/libgiac.a  input_lexer.o sym2poly.o gausspol.o threaded.o moyal.o maple.o ti89.o mathml.o misc.o permu.o quater.o desolve.o input_parser.o symbolic.o index.o modpoly.o modfactor.o ezgcd.o derive.o solve.o intg.o intgab.o risch.o lin.o series.o subst.o vecteur.o sparse.o csturm.o tex.o global.o ifactor.o alg_ext.o gauss.o isom.o plot.o plot3d.o rpn.o prog.o pari.o cocoa.o unary.o usual.o identificateur.o gen.o tinymt32.o first.o TmpLESystemSolver.o TmpFGLM.o help.o lpsolve.o optimization.o signalprocessing.o graphe.o graphtheory.o nautywrapper.o markup.o kdisplay.o kadd.o
[giac-1.5.0.87p2] libtool: link: ranlib .libs/libgiac.a
[giac-1.5.0.87p2] libtool: link: ( cd ".libs" && rm -f "libgiac.la" && ln -s "../libgiac.la" "libgiac.la" )
[giac-1.5.0.87p2] /usr/bin/bash ../libtool  --tag=CXX   --mode=link g++ -std=gnu++11  -g -O2  -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -no-undefined -L/home/skraeling/sage/local/lib -Wl,-rpath,/home/skraeling/sage/local/lib  -o libxcas.la  History.lo Input.lo Xcas1.lo Equation.lo Print.lo Tableur.lo Editeur.lo Graph.lo Graph3d.lo Help1.lo Cfg.lo Flv_CStyle.lo Flve_Check_Button.lo Flve_Input.lo Flv_Style.lo Flv_Data_Source.lo Flve_Combo.lo Flv_List.lo Flv_Table.lo gl2ps.lo libgiac.la  -lintl -lrt -lpthread -lnauty -lcurl -lglpk -ldl -lm -lecm -lmpfi -lmpfr -lgmp 

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 12, 2020

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

e673110build/pkgs/giac/spkg-install.in [Cygwin]: Disable linking with libnauty.a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Sep 12, 2020

Changed commit from c47b078 to e673110

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 12, 2020

comment:53

Please try this one

@darijgr
Copy link
Contributor

darijgr commented Sep 12, 2020

comment:54

Compiles and runs this time. Good job! (That said, I haven't "make distclean"ed.)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 12, 2020

comment:55

Great! Thanks very much for testing.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 12, 2020

Changed reviewer from Darij Grinberg, https://github.com/mkoeppe/sage/actions/runs/250810927 to Darij Grinberg

@darijgr
Copy link
Contributor

darijgr commented Sep 12, 2020

comment:57

pats laptop on the back

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 13, 2020

comment:59

Build from scratch at https://github.com/mkoeppe/sage/runs/1106904182 succeeded in building sagelib too

@tscrim
Copy link
Collaborator

tscrim commented Sep 13, 2020

comment:60

This now works for me on Ubuntu.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 13, 2020

comment:61

Positive review?

@tscrim
Copy link
Collaborator

tscrim commented Sep 13, 2020

Changed reviewer from Darij Grinberg to Darij Grinberg, Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Sep 13, 2020

comment:62

In terms of things working, yes, but I don't think having new tarballs of a tweaked giac are the way to go. The standard ways are something released from upstream or you include the patch(es) you applied in the $SAGE_ROOT/build/pkgs/giac/patches/ folder with a change in the patch level to 1.5.0.87p1 in the package-version.txt file. (It would also be good to remove the patched bzips from trac to avoid clutter that way.)

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 13, 2020

comment:63

The new patch modifies autotools source files and therefore the tarball has to be regenerated. See https://doc.sagemath.org/html/en/developer/packaging.html#when-to-patch-when-to-repackage-when-to-autoconfiscate

@tscrim
Copy link
Collaborator

tscrim commented Sep 13, 2020

comment:64

I see. Thanks for the explanation.

These are in the nitpick category: Could the patched tarball name have a slightly more descriptive description (the numbering p2 also doesn't make sense once it goes into Sage as well). I would leave it also as .p0 since you are patching that new modified version for the first time.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 13, 2020

comment:65

giac-1.5.0.87p2 identifies the patched tarball uniquely on the Sage mirrors (... and in testers' upstream/ directories)

@tscrim
Copy link
Collaborator

tscrim commented Sep 13, 2020

comment:66

However, it won't have a good history on the mirrors as it feels arbitrary. Anyways, I don't care that strongly about it, so feel free to set a positive review if you want to keep the name.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 13, 2020

comment:67

Thanks.

@vbraun
Copy link
Member

vbraun commented Sep 15, 2020

Changed branch from u/mkoeppe/cygwin_standard__sagelib_build_fails to e673110

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

6 participants