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: Fix cliquer, giac, meataxe, rw, libbraiding to build shared libraries, using AM_LDFLAGS=-no-undefined #29152

Closed
embray opened this issue Feb 4, 2020 · 93 comments

Comments

@embray
Copy link
Contributor

embray commented Feb 4, 2020

Follow-up from #30396, where libtool's fallback to static library build for giac caused linker errors while building sagelib.

This is fixed by passing -no-undefined to the libtool linking flags, by setting AM_LDFLAGS=-no-undefined.

Affected packages can be found as follows:

$ grep "undefined symbols not allowed" logs/pkgs/*
cliquer-1.21.p4.log:libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries
giac-1.5.0.87p0.log:libtool: warning: undefined symbols not allowed in x86_64-pc-cygwin shared libraries; building static only
libbraiding-1.0.p0.log:libtool: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries; building static only
rw-0.7.p0.log:libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries
singular-4.1.1p2.p0.log:libtool: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries; building static only

In singular, only the gitfan.la library (module) is affected:

Making all in gitfan
...
/usr/bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -std=gnu++11  -O2 -g  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks -fno-rtti -module -export-dynamic -avoid-version -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup -L/cygdrive/d/a/sage/sage/local/lib -Wl,-rpath,/cygdrive/d/a/sage/sage/local/lib  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fconserve-space -funroll-loops -fno-delete-null-pointer-checks  -Wl,-Bdynamic -o gitfan.la -rpath /cygdrive/d/a/sage/sage/local/libexec/singular/MOD gitfan_la-gitfan.lo  -lreadline -lncurses -lmpfr -lrt
libtool: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries; building static only
libtool: link: ar cru .libs/gitfan.a  gitfan_la-gitfan.o
libtool: link: ranlib .libs/gitfan.a
libtool: link: ( cd ".libs" && rm -f "gitfan.la" && ln -s "../gitfan.la" "gitfan.la" )

The issue also affects the optional package meataxe.

[meataxe-1.0.p0] /usr/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2  -L/opt/sagemath-9.0/local/lib -Wl,-rpath,/opt/sagemath-9.0/local/lib  -o libmtx.la -rpath /opt/sagemath-9.0/local/lib args.lo berlekmp.lo bsand.lo bscore.lo bsdup.lo bsissub.lo bsmatch.lo bsminus.lo bsop.lo bsor.lo bsprint.lo bsread.lo bswrite.lo cfinfo.lo charpol.lo chbasis.lo error.lo ffio.lo fpcore.lo fpdup.lo fpmul.lo fpmul2.lo fpprint.lo gcd.lo genseed.lo grmaprow.lo grmatcore.lo grtable.lo homcomp.lo imatcore.lo imatread.lo imatwrite.lo init.lo intio.lo issub.lo isisom.lo kernel-0.lo ldiag.lo maddmul.lo mat2vec.lo matadd.lo matclean.lo matcmp.lo maketabF.lo matcopy.lo matcore.lo matcut.lo matdup.lo matech.lo matid.lo matins.lo matinv.lo matmul.lo matnull.lo matorder.lo matpivot.lo matprint.lo matpwr.lo matread.lo mattr.lo mattrace.lo matwrite.lo message.lo mfcore.lo mfread.lo mfreadlong.lo mfwrite.lo mfwritelong.lo minpol.lo mkendo.lo mmulscal.lo mraddgen.lo mrcore.lo mrread.lo mrtranspose.lo mrwrite.lo msclean.lo mscore.lo mtensor.lo mtxobj.lo os.lo permcmp.lo permcore.lo permdup.lo perminv.lo permmul.lo permorder.lo permprint.lo permpwr.lo permread.lo permwrite.lo poladd.lo polcmp.lo polcore.lo polderive.lo poldiv.lo poldup.lo polgcd.lo polmul.lo polprint.lo polread.lo polwrite.lo quotient.lo random.lo rdcfgen.lo saction.lo setcore.lo setinsert.lo settest.lo spinup.lo spinup2.lo split.lo stabpwr.lo stfcore.lo stfread.lo stfwrite.lo string.lo sumint.lo temap.lo tkinfo.lo vec2mat.lo wgen.lo window.lo zcleanrow.lo zcmprow.lo zgap.lo zpermrow.lo zzz2.lo
[meataxe-1.0.p0] libtool:   error: can't build x86_64-unknown-cygwin shared library unless -no-undefined is specified

This is a common issue especially when using libtool to link Windows DLLs and should hopefully be straightforward to fix.

See also:

Depends on #31064

Upstream: Reported upstream. No feedback yet.

CC: @simon-king-jena @miguelmarco @dimpase @orlitzky @antonio-rojas @kiwifb @slel @jhpalmieri @vbraun

Component: porting: Cygwin

Author: Matthias Koeppe, Miguel Marco, Simon King

Branch/Commit: 6b6ee5c

Reviewer: Matthias Koeppe, Dima Pasechnik

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

@embray embray added this to the sage-9.1 milestone Feb 4, 2020
@embray embray self-assigned this Feb 4, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented May 4, 2020

comment:2

The failure can be seen at https://github.com/mkoeppe/sage/runs/641394565

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Optional package meataxe doesn't build on Cygwin Cygwin: Make sure all package build shared libraries, using AM_LDFLAGS=-no-undefined Sep 11, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:5

Cc'ing mmarco re libbraiding

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:6

cc'ing dimpase re cliquer, also reported at dimpase/autocliquer#4

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

Upstream: Reported upstream. No feedback yet.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:7

Upstream link in build/pkgs/rw/SPKG.rst no longer works

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:8

Cc'ing gentoo, arch people to see if new rw upstream is known

@mkoeppe mkoeppe changed the title Cygwin: Make sure all package build shared libraries, using AM_LDFLAGS=-no-undefined Cygwin: Make sure all packages build shared libraries, using AM_LDFLAGS=-no-undefined Sep 11, 2020
@antonio-rojas
Copy link
Contributor

comment:10

I'm getting it from https://sourceforge.net/projects/rankwidth/, but I don't know if there's anybody reading tickets there (there are none filed so far)

@kiwifb
Copy link
Member

kiwifb commented Sep 11, 2020

comment:11

Replying to @antonio-rojas:

I'm getting it from https://sourceforge.net/projects/rankwidth/, but I don't know if there's anybody reading tickets there (there are none filed so far)

Same here in Gentoo https://packages.gentoo.org/packages/sci-mathematics/rw

@orlitzky
Copy link
Contributor

comment:12

What's wrong with rw upstream? The program is more or less "complete," so I wouldn't expect much activity. Last time (a few years ago), we just emailed the guy to ask about contributing an autotools build system.

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

Commit: 45a4167

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 11, 2020

comment:14

Replying to @orlitzky:

What's wrong with rw upstream?

See ticket description


New commits:

45a4167build/pkgs/rw/SPKG.rst: Update link to upstream project

@miguelmarco
Copy link
Contributor

comment:15

I created a new release for libbraiding:

https://github.com/miguelmarco/libbraiding/releases/tag/1.1

Should I also update the sage package?

IIRC, there is a new way to upload the tarball. Isn't it?

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 12, 2020

comment:16

Replying to @miguelmarco:

I created a new release for libbraiding:

https://github.com/miguelmarco/libbraiding/releases/tag/1.1

Thanks a lot!

Should I also update the sage package?

Yes please

IIRC, there is a new way to upload the tarball. Isn't it?

No need to upload, but please add upstream_url as explained in https://wiki.sagemath.org/ReleaseTours/sage-9.1#For_developers-1

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 12, 2020

Changed commit from 45a4167 to 44839c7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 10, 2020

Changed commit from 9661065 to 4c34a0e

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 19, 2020

Work Issues: rebase on top of #31064

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2020

Changed commit from 4c34a0e to 58c22df

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2020

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

cea4cd5ci-cygwin-standard.yml: More stages, continue-on-error: true
cf31b79Fixup after cherry-pick
73b0e8fbuild/pkgs/rw/SPKG.rst: Update link to upstream project
9d724bclibbraiding version bump
a67a446build/pkgs/meataxe/distros: Add fedora.txt
c79da6abuild/pkgs/cliquer: Update to 1.22
b5dcb16build/pkgs/cliquer/SPKG.rst: Update
9e6de0bbuild/pkgs/rw: Update to 0.9
32385deUpgrade SharedMeatAxe, to fix a build problem on Cygwin
58c22dfAdd upstream url for SharedMeatAxe

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 19, 2020

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 19, 2020

Changed work issues from rebase on top of #31064 to none

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 19, 2020

Changed dependencies from #30154 to #31064

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2020

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

09d1737Makefile: Add targets ptest-nodoc etc.
0dca776Merge branch 't/29124/script-packages-prereq-toolchain-bootstrap' into t/31084/makefile__add__ptest__targets_that_do_not_depend_on_the_docbuild
073124cMerge branch 't/31084/makefile__add__ptest__targets_that_do_not_depend_on_the_docbuild' into t/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq
8769bd6.github/workflows/ci-cygwin-*.yml: Separate docbuild and ptest
c2daec7Merge branch 't/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq' into t/29152/cygwin__make_sure_all_packages_build_shared_libraries__using__am_ldflags__no_undefined_

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 19, 2020

Changed commit from 58c22df to c2daec7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 29, 2020

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

78ff9d5src/sage/misc/package.py: Add one more # optional - build
a44042fMerge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/script-packages-prereq-toolchain-bootstrap
64bde5fMerge tag '9.3.beta5' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
e9a7572src/sage/misc/package.py: Improve source formatting
c7bcda9Merge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/script-packages-prereq-toolchain-bootstrap
9988c5fci-cygwin*.yml: Adjust to new script packages _bootstrap, _prereq
d65299cMerge branch 't/29124/script-packages-prereq-toolchain-bootstrap' into t/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq
ab19133Merge branch 't/29124/script-packages-prereq-toolchain-bootstrap' into t/30944/tox__improve_local_sudo_ubuntu_standard
a5e4051Merge branch 't/30944/tox__improve_local_sudo_ubuntu_standard' into t/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq
76804dcMerge branch 't/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq' into t/29152/cygwin__make_sure_all_packages_build_shared_libraries__using__am_ldflags__no_undefined_

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 29, 2020

Changed commit from c2daec7 to 76804dc

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 1, 2021

comment:68

Let's please get this in.

@dimpase
Copy link
Member

dimpase commented Feb 2, 2021

comment:69

It still doesn't fix all the Cygwin things, no? Anyway, LGTM.

@dimpase
Copy link
Member

dimpase commented Feb 2, 2021

Changed reviewer from Matthias Koeppe, https://github.com/mkoeppe/sage/actions/runs/432820484, ... to Matthias Koeppe, Dima Pasechnik

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 2, 2021

comment:70

Thank you!

Follow up for the remaining issues in #30814.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 7, 2021

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

42f4458Merge tag '9.3.beta7' into t/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq
6b6ee5cMerge branch 't/31064/ci_cygwin__yml__adjust_to_new_script_packages__bootstrap___prereq' into t/29152/cygwin__make_sure_all_packages_build_shared_libraries__using__am_ldflags__no_undefined_

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 7, 2021

Changed commit from 76804dc to 6b6ee5c

@vbraun
Copy link
Member

vbraun commented Mar 1, 2021

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

9 participants