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

Building DQVM #256

Open
mlxd opened this issue Apr 27, 2020 · 7 comments
Open

Building DQVM #256

mlxd opened this issue Apr 27, 2020 · 7 comments

Comments

@mlxd
Copy link
Contributor

mlxd commented Apr 27, 2020

Hi, I am looking at building the DQVM, but the Readme.md (https://github.com/rigetti/qvm/blob/master/dqvm/README.md) seems to reference a Makefile that was deleted sometime in the past.

I am wondering if there are some updated instructions to build this?
Thank you in advance!

@notmgsk
Copy link
Member

notmgsk commented Apr 27, 2020

@mlxd I haven't verified this, but it might be the case that the Makefile was replaced by the script in dqvm/scripts/build-dqvm2-sbcl. Give that a shot.

@notmgsk
Copy link
Member

notmgsk commented Apr 27, 2020

Yeah that looks to be the case: https://github.com/rigetti/qvm/blob/bump-version-1.17.1/dqvm/Makefile

@mlxd
Copy link
Contributor Author

mlxd commented Apr 28, 2020

@notmgsk Thanks for the info. My Common Lisp isn't really up to scratch, but I needed to make two edits to that script to get things building:

  1. Loading Quicklisp (we use non-standard installation directory for this) by adding --load <QUICKLISP_HOME>/quicklisp/setup.lisp
  2. Remove :compression t from the final eval line, as the issue seemed the same as here this runtime was not built with zlib support quilc#161 as we use a conda provided sbcl environment.

The above script succeeded, but it failed to load the DQVM when attempting to use the provided run script with a sample quil file (I assume I will need to make some edits here, but will need to revisit in a day or two).

I wonder if there is any help needed to generalise this script similar as the builds of qvm and qvm-ng? Would a Makefile be a better fit, as variables can be overridden by the user without editing the file, and any generated objects can also be tracked and recompiled as necessary?

If none of this would be helpful, no problem, and I can keep plugging away to find a structure that works for me. Thanks again for any feedback.

@mlxd
Copy link
Contributor Author

mlxd commented Apr 28, 2020

Just a quick update, I have made a few changes to put the appropriate paths into the run script:
./dqvm2-sbcl --load $QUICKLISP_HOME/setup.lisp --eval "(push \"$PWD/\" ql:*local-project-directories*)" --eval '(asdf:load-system :dqvm2)' --eval '(quit)' and am now reaching the following error: The variable MPI::+MPI-DOUBLE-COMPLEX+ is unbound.

This seems to be also found here, which is either the same or at least similar: http://report.quicklisp.org/2020-04-28/failure-report/qvm.html#dqvm2

Again, I appreciate any feedback that can be given.

@notmgsk
Copy link
Member

notmgsk commented Apr 28, 2020

Ah! Congrats on getting that far 😃

A colleague was working on improving the CL MPI bindings. Though that particular PR seems to have stalled.

Are you familiar with how to install your own CL libraries?

@mlxd
Copy link
Contributor Author

mlxd commented Apr 28, 2020

Thanks! 👍

Not familiar, but I can take another look at this in a few days (and at that PR) and see if I can work through it.

@notmgsk
Copy link
Member

notmgsk commented Apr 28, 2020

Here's a few steps to follow:

  1. Clone the aforementioned PR into somewhere like /home/you/code/lisp/cl-mpi and then checkout the appropriate branch.
  2. In your ~/.sbclrc config file, add something like
#+quicklisp
(progn
  (setf quicklisp-client:*quickload-verbose* t)
  (push "/home/you/code/lisp/"
        ql:*local-project-directories*))
  1. Open up sbcl and start with (ql:register-local-projects), and then try (ql:quickload :cl-mpi).

If 3. doesn't work out, make sure that quicklisp is finding your cl-mpi with
4. (asdf:locate-system :cl-mpi) -- hopefully this should show the correct path /home/you/code/lisp/cl-mpi.asd.
5. If not, you might need to go nuclear and blow any caches away. In your qvm folder, try make cleanall. Then go back to 3.

I was able to get dqvm2 loading after doing the above. Let me know how you get along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants