From: Kevin L
Subject: Help!  ASDF with project in multiple subdirectories
Date: 
Message-ID: <j%tyg.579$jt.191@trnddc04>
Hi all,

I am refactoring a project for maintainability and have decided that I
want it ultimately to look like this:

/home/kevinl/chenl/source/
    chenl.asd
    common/
        package.lisp
        logger.lisp
        ...
    math/
        package.lisp
        solver.lisp
        ...
    ...

In other words, one top-level ASD file pointing to a bunch of
subdirectories, each containing a "module" composed of multiple files
with their own package.lisp to declare the exported symbols.  I want
each module to have its own internal dependency heirarchy and also a
top-level heirarchy:  changes to a package.lisp will cause a whole
module to recompile, and changes to any file in common/ will cause the
entire project to recompile.

I have moved the source files around and am trying to load the system
with (asdf:operate 'asdf:load-op :chenl :verbose t) .  I get the
following error:

The file "/home/kevinl/chenl/source/package.lisp" does not exist.

ASDF is expecting package.lisp to be in /home/kevinl/chenl/source, but I
expect it to be in /home/kevinl/chenl/source/common .  Here is my ASD file:

----snip----snip----
(defsystem "chenl"
  :description "ChENL (Chemical Engineering Numerical Library) Lisp system."
  :version "0.1"
  :author "Kevin L"
  :licence "GPL"
  :depends-on (:cl-statistics :split-sequence :cl-smtp :clsql :getopt)
  :components ((:module
		"common"
		:pathname "common"
		:components
		((:file "package")
		 (:file "logger" :depends-on ("package"))
		 (:file "parse-float" :depends-on ("package"))
		 (:file "miscellaneous" :depends-on ("package" "logger" "platform"))
		 (:file "pathname" :depends-on ("package" "miscellaneous" "logger"))
		 (:file "platform" :depends-on ("package"))
		 (:file "database" :depends-on ("package" "logger"))))

	       (:module
		"math"
		:pathname "math"
		:depends-on ("common")
		:components
		((:file "package")
		 (:file "math" :depends-on ("package"))))

	       (:module
		"batch"
		:pathname "batch"
		:depends-on ("common")
		:components
		((:file "package")
		 (:file "process" :depends-on ("package"))
		 (:file "scheduler" :depends-on ("package" "process"))
		 (:file "batch" :depends-on ("package"))))

	       (:module
		"molmodel"
		:pathname "molmodel"
		:depends-on ("common")
		:components
		((:file "package")
		 (:file "model" :depends-on ("package"))
		 (:file "dlpoly" :depends-on ("package" "model"))))

	       ))

----snip----snip----

What am I doing wrong here?  Any help is greatly appreciated.

Also:  the instructions at
http://common-lisp.net/~mmommer/asdf-howto.shtml for the section "A
system with modules" appears to be wrong:  the :depends-on argument to a
:file component inside a :module should be a list, not a string.

From: Kevin L
Subject: Re: Help!  ASDF with project in multiple subdirectories
Date: 
Message-ID: <_5uyg.581$jt.375@trnddc04>
Sorry, I just found the problem:  I need to add a trailing / to each
pathname.

I'm sending an email now to see if the ASDF Howto can be updated.
From: Ken Tilton
Subject: Re: Help!  ASDF with project in multiple subdirectories
Date: 
Message-ID: <Hyvyg.7810$UY2.7672@fe11.lga>
Kevin L wrote:
> Sorry, I just found the problem:  I need to add a trailing / to each
> pathname.
> 
> I'm sending an email now to see if the ASDF Howto can be updated.

It certainly is an FAQ, moi included.

fwiw, as long as the module is eponymous with the directory, you can 
leave off the :pathname bit and ASDF will look in a directory of the 
same name as a default.

ken

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon