quil-lang/magicl

Cannot load fortran lib

Opened this issue · 0 comments

(asdf:load-system "magicl") fails in a fresh build in a fresh repo because the system is still looking for the Fortran lib file in the "old location", that is, the location that used to be used a couple commits ago. The background is that the recent change e94e78d APPLY-OUTPUT-TRANSLATIONS on Fortran outputs (e94e78d) was intended to save fortran lib files for magicl in the same directory as other binaries, typically like ~/.cache/common-lisp/.../expokit/..., whereas previous it had been in a location like /expokit/....

In other words, the loader seems to be out of sync with the output location used by the writer of the library file.

In a nonfresh build, this issue might not be noticed, since the loader could just find the library created in a previous commit. (The suspect commit at this point is just several weeks old.)

The debugger output in a fresh commit should be something like this, from SLIME:

Unable to load any of the alternatives:
   (#P"/Users/A_USER/repos/magicl/expokit/libexpokit.dylib"
    "libexpokit.dylib" "expokit.dylib")
   [Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]

Restarts:
 0: [RETRY] Try loading the foreign library again.
 1: [USE-VALUE] Use another library instead.
 2: [TRY-RECOMPILING] Recompile load-libs and try loading it again
 3: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "magicl/ext-expokit" "src/extensions/expokit" "load-libs">.
 4: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "magicl/ext-expokit" "src/extensions/expokit" "load-libs"> as having been successful.
 5: [RETRY] Retry ASDF operation.
 --more--

Backtrace:
  0: (CFFI::FL-ERROR "Unable to load any of the alternatives:~%   ~S" (#P"/Users/A_USER/repos/magicl/expokit/libexpokit.dylib" "libexpokit.dylib" "expokit.dylib"))
  1: (CFFI::TRY-FOREIGN-LIBRARY-ALTERNATIVES MAGICL.FOREIGN-LIBRARIES:LIBEXPOKIT (#P"/Users/A_USER/repos/magicl/expokit/libexpokit.dylib" "libexpokit.dylib" "expokit.dylib") NIL)
  2: (CFFI::LOAD-FOREIGN-LIBRARY-HELPER MAGICL.FOREIGN-LIBRARIES:LIBEXPOKIT (:OR #P"/Users/A_USER/repos/magicl/expokit/libexpokit.dylib

Note: running tests suffers from a similar issue. Try it with (asdf:test-system "magicl").