takagi / cl-cuda

Cl-cuda is a library to use NVIDIA CUDA in Common Lisp programs.
MIT License
283 stars 24 forks source link

no class named CFFI-GROVEL::PROCESS-OP #37

Open chaldar opened 9 years ago

chaldar commented 9 years ago

Trying to load cl-cuda in sbcl, I get this error:

* (ql:quickload :cl-cuda)

debugger invoked on a LOAD-SYSTEM-DEFINITION-ERROR in thread #<THREAD "main thread" RUNNING {1002A8B383}>: Error while trying to load definition for system cl-cuda from pathname /home/dev/quicklisp/local-projects/cl-cuda/cl-cuda.asd: There is no class named CFFI-GROVEL::PROCESS-OP.

What am I doing wrong?

takagi commented 9 years ago

CFFI-GROVEL::PROCESS-OP is defined in cffi's grovel/asdf.lisp file line 48. It seems that old version (ver 0.10 or older) of cffi did not have PROCESS-OP. Please confirm that.

2015-06-11 14:44 GMT+09:00 chaldar notifications@github.com:

Trying to load cl-cuda in sbcl, I get this error:

  • (ql:quickload :cl-cuda)

debugger invoked on a LOAD-SYSTEM-DEFINITION-ERROR in thread #: Error while trying to load definition for system cl-cuda from pathname /home/dev/quicklisp/local-projects/cl-cuda/cl-cuda.asd: There is no class named CFFI-GROVEL::PROCESS-OP.

What am I doing wrong?

— Reply to this email directly or view it on GitHub https://github.com/takagi/cl-cuda/issues/37.

chaldar commented 9 years ago

Thanks. The cffi package in the Ubuntu repository is thoroughly outdated. Installed latest cffi through Quicklisp and the problem is gone :-).

chaldar commented 9 years ago

Sorry, a new problem cropped up, so reopening the issue. Loading of cl-cuda fails as shown below. I am on Ubuntu 14.04 running SBCL 1.1.14.debian build. CUDA 7.0 toolkit is installed in /usr/local/cuda. PATH and LD_LIBRARY_PATH are set as per CUDA installation instructions. I can build and run the NVIDIA CUDA sample programs. I also set CUDA_HOME to /usr/local/cuda even though recent CUDA toolkit installations do not ask for it.

How does cffi-grovel find the .h header files? Do I need to tweak the include path? How?

debugger invoked on a CFFI-GROVEL:GROVEL-ERROR in thread #<THREAD "main thread" RUNNING {1002A8AF73}>: External process exited with code 1. Command was: "cc" "-m64" "-I/home/dev/quicklisp/dists/quicklisp/software/cffi_0.14.0/" "-o" "/home/chandan/.cache/common-lisp/sbcl-1.1.14.debian-linux-x64/home/dev/quicklisp/local-projects/cl-cuda/src/driver-api/type-grovel" "/home/chandan/.cache/common-lisp/sbcl-1.1.14.debian-linux-x64/home/dev/quicklisp/local-projects/cl-cuda/src/driver-api/type-grovel.c" Output was: /home/chandan/.cache/common-lisp/sbcl-1.1.14.debian-linux-x64/home/dev/quicklisp/local-projects/cl-cuda/src/driver-api/type-grovel.c:6:18: fatal error: cuda.h: No such file or directory

include

              ^

compilation terminated.

takagi commented 9 years ago

CFFI-GROVEL generates C source codes from specification files, type-grovel.lisp in this case, to just executes C compiler such as gcc or clang to compile the generated C source codes, type-grovel.c. Please confirm that the C compiler finds cuda.h via environment variable INCLUDE.

Disclosure commented 7 years ago

I had this issue on Ubuntu 16.04 where the cuda.h file would not be found no matter which environment variable I placed the include paths in when trying to install cl-cuda. This line was failing in the terminal as well despite going through all the installation steps specified by Nvidia:

_cc -m64 -o /home/yuri/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/yuri/quicklisp/dists/quicklisp/software/cl-cuda-20161031-git/src/driver-api/type-grovel__grovel-tmpJAIDFZTC -I/home/yuri/quicklisp/dists/quicklisp/software/cffi_0.18.0/ /home/yuri/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/yuri/quicklisp/dists/quicklisp/software/cl-cuda-20161031-git/src/driver-api/type-grovel_grovel.c

A solution was to place a symlink to cuda.h file directly into _-I/home/yuri/quicklisp/dists/quicklisp/software/cffi0.18.0/ The compilation completed without any further problems and cl-cuda loaded successfully.

guicho271828 commented 7 years ago

Adding /usr/local/cuda-8.0/targets/x86_64-linux/include to CPATH environment variable solves this.

guicho271828 commented 7 years ago

@takagi , that should be for Windows, am I correct?

I might write up some troubleshooting / tutorial for installing cl-cuda.

guicho271828 commented 7 years ago

Actually, you need both of:

/usr/local/cuda-8.0/targets/x86_64-linux/include -> CPATH
/usr/local/cuda-8.0/targets/x86_64-linux/lib         -> /etc/ld.conf.d/cuda-8-0.conf (if it does not exist)
/usr/local/cuda-8.0/bin                                         -> PATH

On ubuntu, setting LD_LIBRARY_PATH in ~/.profile doesn't work because it is reset and ignored every time