[MacPorts] #45152: pure-reduce @0.4: new port submission
#45152: pure-reduce @0.4: new port submission ------------------------+-------------------------------- Reporter: aggraef@… | Owner: macports-tickets@… Type: submission | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: pure-reduce ------------------------+-------------------------------- Another Pure module that isn't in MacPorts yet. This one integrates Pure with the Reduce computer algebra system. -- Ticket URL: <https://trac.macports.org/ticket/45152> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------------- Reporter: aggraef@… | Owner: macports-tickets@… Type: submission | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------------- Comment (by aggraef@…): Ryan, it would be nice if you could have a look at whether I handled the multiple distribution tarballs correctly. pure-reduce.tar.gz is the primary source, reduce-algebra-csl-r2204.tar.bz2 is a trimmed-down snapshot from the Reduce repository I provide at the Pure website. The latter extracts into reduce-algebra which needs to be linked into the pure-reduce folder. Since I couldn't find any specific capability in MacPorts for that, I simply added the command `ln -sf ../reduce-algebra .` to the `build.cmd`, but maybe there's a better way to do that? -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (removed) * owner: macports-tickets@… => ryandesign@… * status: new => assigned Comment: Can pure-reduce not use the existing reduce-algebra port already in MacPorts? Is there a reason why you're specifying `configure.cflags-append -O2`? Does the `-Os` optimization level MacPorts users by default not work for this port? -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Replying to [comment:2 ryandesign@…]:
Can pure-reduce not use the existing reduce-algebra port already in MacPorts?
No, it uses a much newer revision of reduce-algebra, and a variant based on CSL rather than PSL. That's the combination that I found works best for the purposes of the pure-reduce module. In fact, I'm using this specific revision r2204 of reduce-algebra since I found that later versions failed to compile or were broken in some other ways. Also, I need to build reduce-algebra as a dynamic library so that I can link it into the pure-reduce module. I use a custom build process for that which requires the relevant parts of the reduce-algebra sources (basically the "embedded" CSL version of Reduce and its "procedural interface") to be available during the build. The reduce-algebra module doesn't provide this, it only offers an executable. BTW, I can't even make the reduce-algebra port to run. This is all that I get: {{{ $ redpsl Failed to find a version of bpsl that you have built try ./configure --with-psl; make to build one. }}}
Is there a reason why you're specifying `configure.cflags-append -O2`? Does the `-Os` optimization level MacPorts uses by default not work for this port?
No, `-Os` will probably work fine with clang. That port was done before I actually measured the performance of clang-generated code with `-Os`. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Replying to [comment:3 aggraef@…]:
BTW, I can't even make the reduce-algebra port to run. This is all that I get:
As an aside, a full Reduce build is really a pita if you don't know what to build and where. I actually installed it once from source, including the graphical interface. Reduce is showing its age, but it's very powerful and works fine with a modern interface like pure-reduce+pure-texmacs slapped onto it. In fact I'd say that the pure-reduce+pure-texmacs combo offers a much nicer interface to Reduce than Reduce itself. ;-) -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by ryandesign@…): Ok. Then to the remaining issues: MacPorts does provide an `ln` procedure which works similarly to the shell command of the same name. In this case, invoking it in a `post-extract` block would be reasonable. The other problem is that you've specified both a tar.gz distfile and a tar.bz2 distfile. MacPorts is currently not designed to be able to extract multiple distfiles unless they are all of the same type. So the fact that this is getting past the extract phase at all is surprising, and seems to indicate the /usr/bin/gzip at some point gained the ability to understand bz2 files. I'm not sure in which version of OS X gzip gained that ability, but we should handle this as if gzip only understood gz files, and manually extract the reduce tarball in a `post-extract` block. That would also give us the opportunity to extract it directly into the pure directory, avoiding the need to make a symlink. I'll work on this. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Replying to [comment:5 ryandesign@…]:
MacPorts does provide an `ln` procedure which works similarly to the shell command of the same name. In this case, invoking it in a `post- extract` block would be reasonable.
Great. I imagined that there must be some official way to do this but couldn't find it in the docs.
I'm not sure in which version of OS X gzip gained that ability, but we should handle this as if gzip only understood gz files, and manually extract the reduce tarball in a `post-extract` block. That would also give us the opportunity to extract it directly into the pure directory, avoiding the need to make a symlink.
Seems like a good idea! But I can also repackage the tarball as a .tar.gz and upload that if it makes things easier. Just let me know. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by ryandesign@…): Oh no, I prefer smaller distfiles, and it's no problem to manually extract it. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by ryandesign@…): The build fails: {{{ gcc -Os -arch x86_64 -c -o arith01.o ../../cslbase/arith01.c In file included from ../../cslbase/arith01.c:45: In file included from ../../cslbase/headers.h:120: ../../cslbase/tags.h:54:2: error: This system needs a 32-bit integer type. #error This system needs a 32-bit integer type. ^ 1 error generated. }}} Also, it's using a hardcoded `gcc` for the compiler instead of UsingTheRightCompiler. That can be fixed by adding: {{{ build.args CC="${configure.cc}" }}} but it doesn't change the error. I'll attach my Portfile in progress. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Replying to [comment:4 aggraef@…]:
In fact I'd say that the pure-reduce+pure-texmacs combo offers a much nicer interface to Reduce than Reduce itself. ;-) See a screenshot here: https://bitbucket.org/purelang/pure-lang/wiki/TeXmacs
NB: We should really see whether we can make the latest TeXmacs work in MacPorts and then add the Pure TeXmacs plugin to the Pure port. It's very nice and is being used a lot by engineers. I actually have this working on my MacBook here, but it uses a recent binary TeXmacs package available from http://www.texmacs.org. The TeXmacs version currently in MacPorts is ancient and doesn't work for that (it lacks plugin support IIRC). -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Replying to [comment:8 ryandesign@…]:
The build fails:
{{{ gcc -Os -arch x86_64 -c -o arith01.o ../../cslbase/arith01.c In file included from ../../cslbase/arith01.c:45: In file included from ../../cslbase/headers.h:120: ../../cslbase/tags.h:54:2: error: This system needs a 32-bit integer type. #error This system needs a 32-bit integer type. ^ 1 error generated. }}}
I'm pretty sure that I had that fixed. Are you sure that you applied the patch that I attached? -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): No, I think you missed that line in your portfile: {{{ patchfiles-append make.diff }}} -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by ryandesign@…): Sorry, I omitted the patch because I thought it only dealt with supplying extra CFLAGS, which we decided above we didn't need to do. I'll look at it again. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:12> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Yes, it's definitely needed because the original Makefile doesn't separate the EXTRA_CFLAGS. Without those the Reduce stuff doesn't compile at all. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:13> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: fixed | Keywords: Port: pure-reduce | --------------------------+-------------------------- Changes (by ryandesign@…): * status: assigned => closed * resolution: => fixed Comment: Ok, I see the patch makes the Makefile honor CFLAGS passed to it, which is needed here. So that works. I'm getting an intermittent build failure, which I think is a parallel build problem caused by inaccurate dependencies in the Makefile. I committed the port in r125733 with parallel building turned off for now. I've attached [attachment:main.2.log a log of the failure]. The error is: {{{ :info:build ld: can't write output file: reduce for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation) }}} The log shows multiple occurrences of this line: {{{ cp ../reduce.img . }}} including some after the failure. In fact, when I built with 14 parallel jobs, the log contained 14 invocations of that command. I'm assuming that the build needs that file, and that at the moment when the failure occurs, it has just begun replacing the file again, resulting in it not being there at just the moment when it's needed. -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:14> MacPorts <http://www.macports.org/> Ports system for OS X
#45152: pure-reduce @0.4: new port submission --------------------------+-------------------------- Reporter: aggraef@… | Owner: ryandesign@… Type: submission | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: fixed | Keywords: Port: pure-reduce | --------------------------+-------------------------- Comment (by aggraef@…): Yes, despite my best efforts I couldn't make the parallel build work either. It happens to work over here, but I've seen it failing. I don't really understand why, but the failures are in the Reduce/CSL Makefiles, and I'd rather not touch those. So turning off the parallel build seems the best option. Thanks for committing the port! Can you please have a look at faust2pd et al (#45141) as well? That are basically the only missing pieces right now. (Well, there's also pure-lv2 and pure-lilv, but for that I need to port LV2 (3rd party software) first. I'll work on that asap.) -- Ticket URL: <https://trac.macports.org/ticket/45152#comment:15> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts