Does anyone have their emacs configured for cuda with syntax highlighting and the other bells and whistles? Would they mind sharing their configuration with the community?
I found one here (EmacsWiki: Cuda Mode) but simply copying and pasting it in my emacs file did not work. It complained about the use of defconst. I am using emacs 23.
Although not all that elegant, I get around this issue by creating various .c modules
which I edit with emacs and which get the normal C support. Then I have a single, short
.cu file that just includes the .c files. My Makefile points to the .cu file.
Its just a kludge so I didnt have to figure out how to deal with emacs, which has so many
features that its documentation is unusable (another problem for a different forum, I would
think).
Bill
Dr. W. B. Langdon,
Department of Computer Science,
King's College London,
Strand, London, WC2R 2LS, UK
[url="http://www.dcs.kcl.ac.uk/staff/W.Langdon/"]http://www.dcs.kcl.ac.uk/staff/W.Langdon/[/url]
If you want to use that mode, you have to copy-paste it in another file, such as cuda-mode.el (somewhere in your load-path). You can then add the following to your .emacs:
I have an updated cuda-mode.el in my Git repository. You can see it here or download it here. It uses C++ instead of C, and works fine on my Emacs 23.2.
Be careful to add the cuda-mode.el file in a directory that is in your load-path, or Emacs won’t be able to find it! (you can check it with C-h v load-path RET). I store all my emacs config files in ~/.config/emacs, and have the following line in my ~/.emacs:
I have an updated cuda-mode.el in my Git repository. You can see it here or download it here. It uses C++ instead of C, and works fine on my Emacs 23.2.
Be careful to add the cuda-mode.el file in a directory that is in your load-path, or Emacs won’t be able to find it! (you can check it with C-h v load-path RET). I store all my emacs config files in ~/.config/emacs, and have the following line in my ~/.emacs:
I was able to make this work with xemacs by putting the configuration code into my .xemacs/init.el file, changing the load path to point to ~/.xemacs, and putting the cuda-mode.el file in ~/.xemacs
I tried the elisp code linked above ([url]http://www.emacswiki.org/emacs/CudaMode[/url]) on GNU Emacs in Ubuntu 10.10, then in openSUSE 12.12 and finally in Windows XP, and it works fine everywhere. I copied the code as it is in the .emacs init file. For Windows, I happened to have an msys installation, and the HOME environment variable was set because of that installation, so I copied .emacs there. For Linux, it has to be just the home directory of the current user.