< Back to IRCAM Forum

Use ASDF from OpenMusic

I have an extensive library of algorithmic composition software written in Common Lisp and based on Cmmon Music, originally written by Drew Krause and now maintained by me. This is hosted at https://github.com/gogins/csound-extended/tree/develop/nudruz

This library has an extensive set of third party dependencies, which I have tamed by creating a nudruz.asd file that will load Drew’s code, Common Music, and all the dependencies. I have tested nudruz.asd using Steel Bank Common Lisp and it works reliably.

However, when I attempt to load nudruz into OpenMusic 6.13 on Ubuntu 17.10 from the Lisp editor using (asdf:load-system :nudruz) or (asdf-make :nudruz), literally nothing happens.

I see in the Ubuntu terminal that ASDF itself exists, reports its version (3.3.0), and allows its central-repository to be set, but that is all.

What can I do to enable loading systems with ASDF in Common Music?

1 Like

Hi,

I think you mean “What can I do to enable loading systems with ASDF in OpenMusic?” instead of Common Music. Well i am affraid it is not that easy. OM uses UNFORTUNATELY LispWorks and not SBCL. I think it should be possible if you own a LispWorks copy (non-free) and recompile OM with it enabling asdf. Or, port OM to sbcl that’s what i started doing but it is still on stdby due to overload of time and zero support…

Best
K

1 Like

Hello,

Currently testing on a Mac — probably not very useful to you but maybe worth a report.

— ASDF is included in the OM image, so asdf::load-system etc. are available.

So,
(load “/[…]/csound-extended-develop/nudruz/sources/nudruz.asd”)
… seems to “work” — if I remove the few lines in the beginning that relates to loading clocc/clocc.fasl (not installed here)

“work” = at least the ASDF system “nudruz” is defined :slight_smile:
=> I think this is also the case for you (Linux) since you seem to get some messages back from ASDF.

Then I get to another problem at calling
(asdf:load-system :nudruz)

since the OM Lisp image does not allow to compile Lisp files (only load Lisp or already-compiled .xfasl files).
So I’m also stuck here – probably where you are, but with an error report.

I’m not so familiar with ASDF: there’s maybe a way to configure it so that it just loads the file if compile-file is not available… Otherwise it is possible to just redefine compile-file as load:frowning:

Anyway, even though, then I get to another unresoved dependency with the bordeaux-threads library.
In the asd file I see half a dozen other dependencies which might be complicate to get to work togetehr in OM… so there’s more work to go but it’s maybe possible :slight_smile:

Good luck

Jean

1 Like

Hi Jean,

good to hear from you !

Yes OM as an image will not allow to compile since it is an image… You’re right !

Concerning bordeaux-threads, this asd is required by most of lisp packages such as Michael is running: common music, clx, clg-gtk, etc… Not to say these are dependencies for most of linux lisp prgs…

In order to load asdf systems (on decent lisp compilers :-)) (Michael of course knows this) one must symbolically link the package and run asdf so it could compile the code. Therefore with a LispWorks image this will not work unfortunately.

Just for info, here is a tree representation of my asd systems loaded in sbcl :
~/.sbcl
.
└── systems
├── alexandria.asd -> /usr/share/common-lisp/source/alexandria/alexandria.asd
├── bordeaux-threads.asd -> /usr/share/common-lisp/source/bordeaux-threads/bordeaux-threads.asd
├── cffi.asd -> /usr/share/common-lisp/source/cl-cffi/cffi.asd
├── cl-fad.asd -> /usr/share/common-lisp/source/cl-fad/cl-fad.asd
├── closer-mop.asd -> /usr/share/common-lisp/source/closer-mop/closer-mop.asd
├── clx.asd -> /usr/share/common-lisp/source/clx/clx.asd
├── iterate.asd -> /usr/share/common-lisp/source/iterate/iterate.asd
└── trivial-garbage.asd -> /usr/share/common-lisp/source/trivial-garbage/trivial-garbage.asd

It is linked with sbcl and should run all these “packages” when needed. I hope someday, someone will provide a decent API for sbcl so we can port it to. LispWorks is for the time being the most “convenient” solution and you (Jean) did a lot of work on this project, and you are thanked for it a lot. However a viable solution for a solid lisp working code will be an SBCL based portage since most of serious lisp code do run on this compiler.

Best

K

PS : Bises a Helen and Louise.

1 Like

This is an old post, but an evergreen topic, so I thought I’d make a note, having recently dealt with this issue myself.

It’s true that OM lacks compile-file and some other standard Lisp functions, such as describe–probably part of the LispWorks license agreement, quel dommage. It is possible, if awkward, to install the LispWorks free edition, compile everything there, and subsequently load the xfasl files in OpenMusic. But the easier solution is to address M. Bresson’s question:

Answer: load-source-op instead of load-op, using operate-on-system, to skip the compilation phase. E.g.,

(asdf:oos 'asdf:load-source-op :nudruz)

It’s not as efficient as compiled code, but this is the workaround I use for alexandria, etc.

-Jonathan

Thanks for this information. I will test this in the next days or weeks, and post here what happens.

1 Like

I have indeed tested this but without success. This is before even running in OpenMusic, just to see if my nudruz system can be loaded as source. The answer is no. That is because the Common Music package on which nudruz is based has been hacked to translate .scm files to .lisp files on the fly.

This would probably work if the Common Music code used by my nudruz system did not attempt to regenerate the Lisp source code from the Scheme source code whenever the system is compiled.

In short, the Common Music Lisp source code does not exist without compiling Common Music!

Thanks. The console output is below.

mkg@xenakis:~/csound-extended/nudruz/examples$ sbcl --load tzplay.lisp 
This is SBCL 1.4.5.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
WARNING: System definition file #P"/usr/share/common-lisp/source/rsm-mod/rsm-mod.asd" contains definition for system "rsm-mod-test". Please only define "rsm-mod" and secondary systems with a name starting with "rsm-mod/" (e.g. "rsm-mod/test") in that file.
While evaluating the form starting at line 14, column 0
  of #P"/home/mkg/csound-extended/nudruz/examples/tzplay.lisp":

debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {10005E85B3}>:
  Couldn't load #P"/home/mkg/csound-extended/dependencies/cm2/src/iter.lisp":
  file does not exist.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.