Skip to content

Commit

Permalink
Use /dev/shm as /tmp during maxima
Browse files Browse the repository at this point in the history
Because O_TMPFILE fails with EOPNOTSUPP
  • Loading branch information
mame committed Apr 30, 2018
1 parent 34ff037 commit 3c41835
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,11 @@ QR.mzn: QR.mac
@echo "## 100: Maxima -> MiniZinc ##"
@echo "###############################"
@echo
mv /tmp /tmp.bak
ln -s /dev/shm /tmp
maxima -q --init-mac=QR.mac > QR.mzn
rm /tmp
mv /tmp.bak /tmp

QR.il: QR.mzn
@echo
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ Then, build the bundled interpreters.
$ lua5.3 QR.lua > QR.m4
$ m4 QR.m4 > QR.mk
$ make -f QR.mk > QR.mac
$ maxima -q --init-mac=QR.mac > QR.mzn
$ mv /tmp /tmp.bak && ln -s /dev/shm /tmp && maxima -q --init-mac=QR.mac > QR.mzn &&
rm /tmp && mv /tmp.bak /tmp
$ mzn2fzn QR.mzn && fzn-gecode QR.fzn | solns2out --soln-sep '' QR.ozn > QR.il
$ ilasm QR.il && mono QR.exe > QR.mustache
$ mustache QR.mustache QR.mustache > QR.asm
Expand Down
2 changes: 1 addition & 1 deletion src/code-gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class MiniZinc < CodeGen

class Maxima < CodeGen
File = "QR.mac"
Cmd = "maxima -q --init-mac=QR.mac > OUTFILE"
Cmd = "mv /tmp /tmp.bak && ln -s /dev/shm /tmp && maxima -q --init-mac=QR.mac > OUTFILE && rm /tmp && mv /tmp.bak /tmp"
Apt = "maxima"
Code = %q("linel:99999;print#{E[PREV]};quit();")
end
Expand Down

0 comments on commit 3c41835

Please sign in to comment.