Notes about GCC and make

Notes for creating C code to be called from R

Notes for creating DLL using an existing C library to be used in R

  1. To use Makevars with R CMD SHLIB either

  2. gcc equivalent commands to R CMD SHLIB can be found in the answer to the following question found on stackoverflow

  3. To add enviroment variable in a unix-like system, u can either add them to the .bash_profile or to the .profile files in your home directory see unix.stackexchange

  4. It's not a good idea to mix compilers (i.e. use gcc with a library built in Microsoft VisualC++ (MSVC)).stackoverflow Here is some links that might help

  5. But if you insist, then good luck. below are some links

  6. Source Code for SHLIB command (for sun arch which is developed by Sun and whose operating system includes SunOS, Solaris or OpenSolaris, NeXTSTEP, RTEMS, FreeBSD, OpenBSD, NetBSD, and GNU/Linux) can be found here

  7. Packaging a C library in 15 minutes R-bloggers

  8. For the difference between: Makefile, Makevars and configure, see Prof. Brian D. Ripley explanation on R-dev mailing list

  9. Make and Makefiles tutorial can be found @ http://mrbook.org/tutorials/make/

Notes for Daemons and Agents in Mac OSx

  1. see apple developer link for basic introductory information

  2. use launchd to manage daemons apple support link

  3. To configure daemon, one creates a .plist wich is essentially an xml file. See blog link for the .plist file used to manage RStudio Server on a Mac, and it's usually placed in /Library/LaunchDaemons.

  4. launchd.plist command to manage daemons on mac apple developer link

  5. launchctl Tutorial blog link

  6. Lingon is a GUI utility to view & edit agents & daemons for OS X - see. blog link

Notes for Linux:

  1. Ubuntu keyboard shortcuts can be found @ https://help.ubuntu.com/community/KeyboardShortcuts

  2. to find out the ip of the machine, use ifconfig command

  3. how to create symbolic link using ls command. seeaskubuntu.com

  4. Despite initial success with R CMD SHLIB after setting up enviroment variable, as discussed above, when i used the command dyn.load in R, i would get an error that the library file could not be found. This is the same library file that i had linked against, using the enviroment variable. To diagnose this problem, i went back to the .so file which was created usin R CMD SHLIB, and type: ldd NameOfLibrary.so to see its dependencies. See the links below for info.

  5. Another possible solution (although untested), is to LD_LIBRARY_PATH environment variable, as described in http://www.bioconductor.org/help/faq/ where they discuss the situation where an R package can install properly but fail to load.

  6. To set enviroment variable from within R and to be used only for R, use the following commands: Sys.getenv and Sys.setenv

  7. Library file (.so) are usually installed in /usr/local/lib/ as discussed in askubuntu and ubuntuforums