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

fpylll ignores --stdlib directive #24707

Closed
rwst opened this issue Feb 11, 2018 · 15 comments
Closed

fpylll ignores --stdlib directive #24707

rwst opened this issue Feb 11, 2018 · 15 comments

Comments

@rwst
Copy link

rwst commented Feb 11, 2018

If "--stdlib=libc++" is given in the CXX environment var, fpylll will add it only with compilations not when linking. This leads to libstdc++ being linked and import errors with fpylll.

This is the result from sage -f fpylll with CXX=clang --stdlib=libc++:

ralf@ark:~/sage> ldd /home/ralf/sage/local/lib/python2.7/site-packages/fpylll/fplll/enumeration.so
	linux-vdso.so.1 (0x00007ffd248da000)
	libgmp.so.23 => /home/ralf/sage/local/lib/libgmp.so.23 (0x00007fe2f3bee000)
	libmpfr.so.6 => /home/ralf/sage/local/lib/libmpfr.so.6 (0x00007fe2f3977000)
	libfplll.so.4 => /home/ralf/sage/local/lib/libfplll.so.4 (0x00007fe2f3138000)
	libpython2.7.so.1.0 => /home/ralf/sage/local/lib/libpython2.7.so.1.0 (0x00007fe2f2d4e000)
	libpari-gmp-2.10.so.0 => /home/ralf/sage/local/lib/libpari-gmp-2.10.so.0 (0x00007fe2f226f000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fe2f1ee6000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fe2f1be9000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fe2f19d2000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe2f17b5000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fe2f1414000)
	libc++.so.1 => /usr/lib64/libc++.so.1 (0x00007fe2f41d2000)
	libc++abi.so.1 => /usr/lib64/libc++abi.so.1 (0x00007fe2f418f000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fe2f1210000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007fe2f100d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fe2f40a3000)

In the attached build log:

    clang++ -pthread -shared -L/home/ralf/sage/local/lib -Wl,-rpath,/home/ralf/s
age/local/lib -L/home/ralf/sage/local/lib/python/lib -L/home/ralf/sage/local/lib
 -L/home/ralf/sage/local/lib/python/lib -L/home/ralf/sage/local/lib -L/home/ralf
/sage/local/lib -Wl,-rpath,/home/ralf/sage/local/lib -L/home/ralf/sage/local/lib
/python/lib -L/home/ralf/sage/local/lib -L/home/ralf/sage/local/lib/python/lib -
L/home/ralf/sage/local/lib build/temp.linux-x86_64-2.7/build/src/fpylll/fplll/en
umeration.o -L/home/ralf/sage/local/lib -L/home/ralf/sage/local/lib -lgmp -lmpfr
 -lfplll -lpython2.7 -o build/lib.linux-x86_64-2.7/fpylll/fplll/enumeration.so -
lpari -std=c++11

Upstream: Reported upstream. No feedback yet.

CC: @malb

Component: packages: standard

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

@rwst rwst added this to the sage-8.2 milestone Feb 11, 2018
@rwst

This comment has been minimized.

@kiwifb
Copy link
Member

kiwifb commented Feb 11, 2018

comment:2

Can you provide a build log please.

@simon-king-jena
Copy link
Member

comment:3

Is it fplll-5.2.0.p1.log? In other words, is fpylll a typo, or a different package?

Anyway, I posted a fplll log resulting from building Sage with clange here.

@rwst

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Feb 11, 2018

comment:5

Attachment: fpylll-0.3.0dev.p0.log

@dimpase
Copy link
Member

dimpase commented Feb 11, 2018

comment:6

reported upstream: fplll/fpylll#115

@dimpase
Copy link
Member

dimpase commented Feb 11, 2018

Upstream: Reported upstream. No feedback yet.

@simon-king-jena
Copy link
Member

comment:7

While fpylll seems to build (on my machine, with CC=clang CXX="clang++ -I/usr/include/libcxxabi/ --stdlib=libc++" make), I got a build error in ratpoints and opened #24708 for it.

@malb
Copy link
Member

malb commented Feb 11, 2018

comment:8

Shouldn't those parameters be passed as CXXFLAGS/LDFLAGS?

@rwst
Copy link
Author

rwst commented Feb 11, 2018

comment:9

Replying to @malb:

Shouldn't those parameters be passed as CXXFLAGS/LDFLAGS?

I think so, yes. At least that is their usage, as I see it now---stdlib=libc++ as compile flag to get the right include files, and -lc++ --stdlib=libc++ to get the file to link and prevent libstdc++ from being linked.

@rwst
Copy link
Author

rwst commented Feb 11, 2018

comment:10

However CXX may need to be set to clang++ --stdlib=libc++ as well. I see a lot of compile commands in the logs ignoring CXXFLAGS (ppl, gfan...)

@malb
Copy link
Member

malb commented Feb 11, 2018

comment:11

Thanks, does fpylll also fail to pass through CXXFLAGS and LDFLAGS?

@rwst
Copy link
Author

rwst commented Feb 11, 2018

comment:12

See also #24710. We need --stdlib=libc++ in the CXXFLAGS but this makes gfortran fail.

@rwst
Copy link
Author

rwst commented Feb 11, 2018

comment:13

Correction, we need it in LDFLAGS. I'm a bit frustrated.

@rwst
Copy link
Author

rwst commented Feb 11, 2018

comment:14

Replying to @dimpase:

reported upstream: fplll/fpylll#115

Thanks. I explained there that there is now a solution, i.e. to put the string in LDFLAGS.

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