Description of problem: The script polyc that is intended to compile a free-standing ML program fails due to unnecessary -l options on g++ command line. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create simple ML program: cat >hw.ML <<! fun main () = print "Hello World!\n"; ! 2. Attempt to compile it: polyc -o hw hw.ML Actual results: /usr/bin/ld: cannot find -lffi /usr/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status Expected results: Generation of an executable called hw Additional info: Removing "-lffi -lgmp" from the line beginning"LIBS=" in the script fixes the problem.
Thanks for the bug report, Rob. This simple example obviously doesn't need either gmp or libffi, but I wonder how more complex sources are handled. That is, does the polyml compiler ever generate calls directly into gmp or libffi, or does it only generate calls into libpolyml (which is already linked with gmp and libffi)? If the former, then removing those link commands is wrong; we should instead make the main package Requires: gmp-devel and Requires: libffi-devel. If the latter, then removing them is the right thing to do. I see that polyc also adds rpaths on %{_libdir}, which is unnecessary. I'll remove those while fixing your bug report. I'll try to figure this out ASAP and push some new builds.
I think the right thing is to remove -lffi and -lgmp from polyc. I did some basic tests with gmp, since it's the easy case. Grepping shows that we only need gmp-devel when gmp.h is included in libpolyml/arb.cpp if polysml is configured with --enable-gmp. So we should expect that polyc is just calling libpolysml and not calling gmp directly. In fact, if we compile polyml with gmp and then test a function from PolyML.IntInf implemented with gmp, removing -lgmp from polyc doesn't produce any failures: cp /usr/bin/polyc . sed -i 's/-lgmp//' ./polyc cat > test.ML <<EOF fun main() = if PolyML.IntInf.gcd(10, 15) = 5 then print "GCD works!\n" else print "GCD isn't working.\n"; EOF ./polyc -o test test.ML ./test In an arbitrary mock with polyml installed, this outputs: "GCD works!" We can confirm that it's actually calling libgmp with gdb: (There is probably a more elegant way to do this.) gdb test (gdb) rbreak . (gdb) run ... (gdb) c ... (gdb) c ... (gdb) c ... Breakpoint 1, 0x00007ffff6637a98 in _init () from /usr/lib64/libgmp.so.10 I think this gives evidence that we can safely remove -lgmp from polyc. With libffi I don't have an easy test case like this since I'm not that familiar with polyml's C interface. (The documentation is mostly about the old CInterface implementation and not the new Foreign implementation.) But just by reading off the code it again looks like dependence on libffi-devel is limited to libpolyml itself, and so I see no reason why we'd have to link -lffi on top of this.
I submitted an upstream issue report: https://github.com/polyml/polyml/issues/76
Thanks for doing the legwork, Daniel. I'll remove the unnecessary -l options and the unnecessary rpath and push new builds.
Great, sounds good, Jerry.
Unfortunately the build failed on ppc64 and ppc64le. I got the ppc64le failure sorted and filed an upstream bug report, but the latest attempt is failing on ppc64 in a way that doesn't look easy to debug: https://koji.fedoraproject.org/koji/taskinfo?taskID=17405232 It could well be an endianness issue, since that is the only 64-bit big endian architecture.
polyml-5.6-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-90c442c61e
polyml-5.6-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-255497c225
polyml-5.6-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-255497c225
polyml-5.6-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-90c442c61e
polyml-5.6-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
polyml-5.6-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.