[Gsll-devel] Compilation error in fsbv/libffi-unix.c
Liam Healy
lhealy at common-lisp.net
Wed Mar 3 18:38:03 UTC 2010
I've used 10.5, which has the cc-flags grovel form that N J
complained about. I haven't tried the newer SBCLs so I don't know
if your problem is related.
On Wed, Mar 3, 2010 at 10:25 AM, Mirko Vukovic <mirko.vukovic at gmail.com> wrote:
>
> On Wed, Mar 3, 2010 at 9:14 AM, Liam Healy <lhealy at common-lisp.net> wrote:
>>
>> You need a newer version of CFFI.
>
> Is CFFI version .10.5 enough, or is the latest snaphot required? I ask
> because sbcl 1.0.35,36 would not load the gsl libraries.
>
> Thanks,
>
> Mirko
>
>>
>> On Wed, Mar 3, 2010 at 4:02 AM, N J <raphexion at gmail.com> wrote:
>> > Hi,
>> >
>> > Thanks for the help!
>> >
>> > When I run
>> > pkg-config --cflags libffi
>> > I get
>> > -I/usr/lib64/libffi-3.0.9/include
>> >
>> > So I edited my libffi-unix.lisp file as follows (I tried to imitate
>> > the +darwin approch):
>> > #+linux
>> > (cc-flags "-I/usr/lib64/libffi-3.0.9/include/")
>> >
>> > Doing this it compiled better but then I got this:
>> >
>> > ;
>> > /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/
>> > cffi/grovel/asdf.fasl written
>> > ; compilation finished in 0:00:00
>> > ; registering #<SYSTEM :FSBV {100339C6A1}> as FSBV
>> > ; registering #<SYSTEM GSLL {1004A02BA1}> as GSLL
>> > ; loading system definition from
>> > ; /usr/share/common-lisp/systems/cl-utilities.asd into #<PACKAGE
>> > "ASDF0">
>> > ; registering #<SYSTEM CL-UTILITIES {1004FBFEE1}> as CL-UTILITIES
>> > ; loading system definition from
>> > ; /usr/share/common-lisp/systems/trivial-garbage.asd into #<PACKAGE
>> > "ASDF0">
>> > ; registering #<SYSTEM TRIVIAL-GARBAGE {1002F4D441}> as TRIVIAL-GARBAGE
>> > ; registering #<SYSTEM TRIVIAL-GARBAGE-TESTS {10031EABB1}> as
>> > ; TRIVIAL-GARBAGE-TESTS
>> > ; loading system definition from /usr/share/common-lisp/systems/grid.asd
>> > into
>> > ; #<PACKAGE "ASDF0">
>> > ; registering #<SYSTEM GRID {1002873B01}> as GRID
>> > ; loading system definition from
>> > /usr/share/common-lisp/systems/c-array.asd
>> > ; into #<PACKAGE "ASDF0">
>> > ; registering #<SYSTEM C-ARRAY {1002D72B21}> as C-ARRAY
>> > ; compiling file "/usr/share/common-lisp/source/fsbv/init.lisp"
>> > (written 01 MAR
>> > 2010 11:56:07 PM):
>> > ; compiling (IN-PACKAGE :COMMON-LISP-USER)
>> > ; compiling (DEFPACKAGE :FOREIGN-STRUCTURES-BY-VALUE ...)
>> > ; compiling (CFFI:LOAD-FOREIGN-LIBRARY "libffi.so")
>> > ; compiling (PUSHNEW :FSBV ...)
>> >
>> > ;
>> > /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/
>> > fsbv/init.fasl written
>> > ; compilation finished in 0:00:00
>> >
>> > debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread"
>> > RUNNING {
>> > 10023F6A01}>:
>> > Unknown Grovel syntax: CFFI-GROVEL::CC-FLAGS
>> >
>> > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
>> >
>> > restarts (invokable by number or by possibly-abbreviated name):
>> > 0: [TRY-RECOMPILING] Try recompiling libffi
>> > 1: [RETRY ] Retry performing #<ASDF:COMPILE-OP NIL
>> > {1004ABF331}> on
>> > #<CFFI-GROVEL:GROVEL-FILE "libffi" {100284E171}>.
>> > 2: [ACCEPT ] Continue, treating #<ASDF:COMPILE-OP NIL
>> > {1004ABF331}>
>> > on #<CFFI-GROVEL:GROVEL-FILE "libffi"
>> > {100284E171}> as
>> > having been successful.
>> > 3: [ABORT ] Exit debugger, returning to top level.
>> >
>> > ((SB-PCL::FAST-METHOD CFFI-GROVEL::%PROCESS-GROVEL-FORM (T T T))
>> > #<unavailable argument>
>> > #<unavailable argument>
>> > CFFI-GROVEL::CC-FLAGS
>> > #<unavailable argument>
>> > #<unavailable argument>)
>> >
>> >
>> > Maybe I should have modified my file differently.
>> >
>> > I also tried the symlink approch
>> > cd /src/include
>> > ln -s /usr/lib64/libffi-3.0.9/include/ffi.h ffi.h
>> > ln -s /usr/lib64/libffi-3.0.9/include/ffitarget.h ffitarget.h
>> >
>> > and I seem to work; I got:
>> >
>> > ; compiling (DEFCONSTANT +CGSM-BOHR-RADIUS+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-NEWTON+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-DYNE+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-JOULE+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-ERG+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-STEFAN-BOLTZMANN-CONSTANT+ ...)
>> > ; compiling (DEFCONSTANT +CGSM-THOMSON-CROSS-SECTION+ ...)
>> >
>> > ;
>> > /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/gsll/physical-constants/cgsm.fasl
>> > written
>> > ; compilation finished in 0:00:00
>> > ; compiling file
>> > "/usr/share/common-lisp/source/gsll/physical-constants/export.lisp"
>> > (written 01 MAR 2010 11:53:10 PM):
>> > ; compiling (IN-PACKAGE :GSL)
>> > ; compiling (EXPORT (QUOTE #))
>> >
>> > ;
>> > /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/gsll/physical-constants/export.fasl
>> > written
>> > ; compilation finished in 0:00:00
>> > ;
>> > ; compilation unit finished
>> > ; caught 1 STYLE-WARNING condition
>> > ; printed 41 notes
>> > NIL
>> > *
>> >
>> > Thanks for the help,
>> > NIK
>> >
>> > On Tue, Mar 2, 2010 at 10:05 AM, Sumant Oemrawsingh <soemraws at xs4all.nl>
>> > wrote:
>> >> Hi,
>> >>
>> >> Run pkg-config --cflags libffi and behold that ffi.h is probably in
>> >> some
>> >> non-standard location like /usr/lib64/libffi-3.0.8/include. You can
>> >> either
>> >> edit the source libffi-unix.lisp or symlink to a standard location like
>> >> /usr/include.
>> >>
>> >> As I understand, this is a problem due to upstream, not with your
>> >> distro.
>> >>
>> >> Hope it helps,
>> >> Sumant
>> >>
>> >> On Mon, Mar 01, 2010 at 11:57:25PM +0100, N J wrote:
>> >>> Hey,
>> >>>
>> >>> When I run
>> >>> (asdf:operate 'asdf:load-op :gsll)
>> >>> in sbcl
>> >>>
>> >>> I get:
>> >>>
>> >>> ; loading system definition from
>> >>> /usr/share/common-lisp/systems/c-array.asd
>> >>> ; into #<PACKAGE "ASDF0">
>> >>> ; registering #<SYSTEM C-ARRAY {10026C51D1}> as C-ARRAY
>> >>> ; compiling file "/usr/share/common-lisp/source/fsbv/init.lisp"
>> >>> (written 01 MAR 2010 11:39:35 PM):
>> >>> ; compiling (IN-PACKAGE :COMMON-LISP-USER)
>> >>> ; compiling (DEFPACKAGE :FOREIGN-STRUCTURES-BY-VALUE ...)
>> >>> ; compiling (CFFI:LOAD-FOREIGN-LIBRARY "libffi.so")
>> >>> ; compiling (PUSHNEW :FSBV ...)
>> >>>
>> >>> ;
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/init.fasl
>> >>> written
>> >>> ; compilation finished in 0:00:00
>> >>> ; cc -m64 -fPIC -o
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c
>> >>>
>> >>> debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread"
>> >>> RUNNING {10023F6A01}>:
>> >>> External process exited with code 1.
>> >>> Command was: "cc" "-m64" "-fPIC" "-o"
>> >>>
>> >>> "/home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix"
>> >>>
>> >>> "/home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c"
>> >>> Output was:
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:7:17:
>> >>> error: ffi.h: No such file or directory
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:
>> >>> In function ‘main’:
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:40:
>> >>> error: ‘FFI_OK’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:40:
>> >>> error: (Each undeclared identifier is reported only once
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:40:
>> >>> error: for each function it appears in.)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:45:
>> >>> error: ‘FFI_BAD_TYPEDEF’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:50:
>> >>> error: ‘FFI_BAD_ABI’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:61:
>> >>> error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:66:
>> >>> error: ‘FFI_SYSV’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:71:
>> >>> error: ‘FFI_UNIX64’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:79:
>> >>> error: ‘ffi_abi’ undeclared (first use in this function)
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:126:
>> >>> error: invalid application of ‘sizeof’ to incomplete type ‘struct
>> >>> _ffi_type’
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:126:
>> >>> warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘long
>> >>> unsigned int’
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:131:
>> >>> error: dereferencing pointer to incomplete type
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:136:
>> >>> error: dereferencing pointer to incomplete type
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:141:
>> >>> error: dereferencing pointer to incomplete type
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:146:
>> >>> error: dereferencing pointer to incomplete type
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:
>> >>> In function ‘print_double_for_lisp’:
>> >>>
>> >>> /home/rpx/.fasls/sbcl-1.0.19-gentoo-linux-x86-64/usr/share/common-lisp/source/fsbv/libffi-unix.c:397:
>> >>> warning: incompatible implicit declaration of built-in function
>> >>> ‘memset’
>> >>>
>> >>>
>> >>> My packages and gits are:
>> >>> git://repo.or.cz/gsll.git
>> >>> 4fef622be12cf318e015b2ba5aba6c63d4296f1e
>> >>> master
>> >>>
>> >>> git://repo.or.cz/fsbv.git
>> >>> dd8025f51fd8272b725bd73bc0b1875bae2bcf5b
>> >>> master
>> >>>
>> >>> cffi-0.10.5
>> >>>
>> >>>
>> >>> Thank you guys for any help
>> >>> NIK
>>
>> _______________________________________________
>> Gsll-devel mailing list
>> Gsll-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel
>
>
More information about the gsll-devel
mailing list