Compile R and CUDA on Linux

This is a simplified makefile I made out of the gputools package for generating dlls for R. More details can be found in the source code of this package placed at

http://cran.r-project.org/web/packages/gputools/index.html


# directories
CUDA_HOME = /usr/local/cuda
R_HOME = /usr/lib/R

# compiler, objects, targets, etc.
CC = $(CUDA_HOME)/bin/nvcc -gencode arch=compute_13,code=sm_13
EXT = cu
OBJS = rinterface.o correlation.o cuseful.o
TARGET = gputools.so

# compiler/preprocessor options
INCS = -I$(CUDA_HOME)/include
PARAMS = -Xcompiler "-I$(R_HOME)/include `"$(R_HOME)/bin/R" CMD config CPICFLAGS`"

# linker options
LD_PARAMS = -Xlinker "-L$(R_HOME)/lib -lR"
LIBS = -L$(CUDA_HOME)/lib -lcufft -lcublas -lcuda

# make rules
$(TARGET): $(OBJS)
$(CC) -shared $(LD_PARAMS) $(LIBS) $(OBJS) -o $@

$(OBJS): %.o: %.$(EXT)
$(CC) -c $(INCS) $(PARAMS) $(SRCS) $^ -o $@

clean:
rm -f *.o *.linkinfo *~

Terms and concepts of probability

# An experiment is any procedure that can be repeated any number of times, and has a well-defined set of outcomes. (In order to be interesting from a statistical perspective, the result of the procedure is generally not known in advance.)

# An sample outcome (often denoted s) is a member of the set of outcomes of an experiment.

# The sample space (often denoted S) is the complete set of all possible sample outcomes of an experiment.

# An event is any set of sample outcomes. When the outcome of an experiment is a member of this set, the event is said to occur.

# Two events are independent if the occurance of one of the events is not related to the occurance of the other. For example, if we flip a fair coin twice, then the event ``first flip is heads'' is independant of the event ``second flip is heads''. However, the events ``first flip is heads'' and ``first flip is tails'' are not independent, because the occurance of one of these events depends on whether the other has occured. In this case, the correspondance is absolute- but this is not always the case.

# A trial is the actual ``execution'' of an experiment. For example, the procedure of tossing a coin and observing whether the result is heads or tails is an experiment, but the act of actually flipping the coin is a trial.

# A population is the set of all unique trials. This set may be infinite. For example, the population of all coin tosses is infinite, because we can perform as many unique trials as we like by flipping the coin repeatedly. In other situations, the population may be finite- for example, if our experiment is to ask a person enrolled in S-Q whether their last name contains the letter 'e', then the set of unique trials is the set consisting of one trial for each person enrolled in the course.

# A sample is a set of trials. A random sample is a set of trials selected at random from the population.

(from Daniel Ellard, http://www.eecs.harvard.edu/~ellard/Courses/index.html)