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

Generate different fasl extension for different platform #14

Closed
syakovyn opened this issue Dec 20, 2011 · 2 comments
Closed

Generate different fasl extension for different platform #14

syakovyn opened this issue Dec 20, 2011 · 2 comments

Comments

@syakovyn
Copy link

Hello Anton,

Would it be possible to have different fasl extensions for x86 and x64 fasls?
E.g. Clozure has .wx32fsl and .wx64fsl extensions for different fasls respectively.

Thank you for doing great work,
Serhiy Y

@akovalenko
Copy link
Owner

SB-FASL:*FASL-FILE-TYPE* (a variable of type SIMPLE-STRING) provides a default extension for FASLs. It's "fasl" by default, and you can set it to anything you like in your .sbclrc.

E.g. the fragment below will make it x86-64fasl or x86fasl, depending on word size:

(setf sb-fasl:*fasl-file-type* (format nil "~(~a)fasl" (machine-type)))

That's all you need to get what you want. Here are some arguments against wanting it:

If you use ASDF to compile and load all Lisp code (that's a usual way to do it), there is no need for such things: ASDF puts FASL files into a separate hierarchy ("user cache"), below an implementation-specific subdirectory with a name depending on (machine-type), (lisp-implementation-type), (lisp-implementation-version) and (software-type). Thus output files are separated from Lisp sources, and incompatible output files have different locations. Look up "output translations" in ASDF manual to get more information on this feature.

If you use SLIME for development, commands like C-c C-k reintroduce the problem: SLIME (swank) doesn't use ASDF translations, putting each compiled file near its source. The following code in .swank.lisp fixes it:

(setf swank:*fasl-pathname-function*
      (lambda (pathname &rest options)
        (ensure-directories-exist 
         (asdf:apply-output-translations 
          (compile-file-pathname pathname)))))

Startup files (.swank.lisp and .sbclrc) should be located in your user profile directory, (user-homedir-pathname).

@syakovyn
Copy link
Author

syakovyn commented Feb 1, 2012

Thank you, I will use the way you suggested to generate different extentions

@syakovyn syakovyn closed this as completed Feb 1, 2012
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