JCuda - Java bindings for NVIDIA CUDA

Copyright (c) 2008-2015 Marco Hutter - http://www.jcuda.org


This document and summarizes how to build the native JCuda libraries on 
different operating systems and gives an overview over the JCuda project 
structure.


=== Requirements =============================================================

The following software is required to compile the native JCuda libraries:

- The CUDA driver and SDK from the NVIDIA website:
  http://www.nvidia.com/object/cuda_get.html

- The Java Development Kit (JDK) from Sun/Oracle:
  http://www.oracle.com/technetwork/java/javase/downloads/index.html
  
- A C/C++ compiler
  For Windows: Visual Studio 2005 or higher
  For Linux and MacOS : The GCC
  Alternatively: Any compiler that may be used as a generator for CMake
  (see the notes in the section "Compilation" below)
  

=== Project structure ========================================================

The libraries of JCuda are contained in different directories of the source 
code distribution. Each directory contains the project- and makefiles for 
the respective library, and a source code folder. These directories are
organized as follows:

- CommonJNI:
    A static library, used by all other libraries

- JCudaRuntimeJNI and JCudaDriverJNI:    
    The shared libraries for the CUDA runtime and driver API

- JCublasJNI/JCublas2JNI, 
- JCufftJNI
- JCusparseJNI
- JCurandJNI
- JCusolverJNI
    The shared libraries for the CUDA runtime libraries
    which are contained in the CUDA toolkit
    


=== Compilation ==============================================================

JCuda uses CMake from http://www.cmake.org/ for the compilation of the native 
libraries. The CMake makefiles are named 'CMakeLists.txt'. The main CMake 
makefile is contained in the root directory of the source code distribution, 
and refers to the CMake makefiles for the individual libraries contained in 
the respective subdirectories.

To create makefiles or project files from the CMake files for a specific 
compiler (for example, for GNU make or Visual Studio) the following command
has to be executed in the root directory of the source code distribution:

    cmake.exe -G <generator-name> CmakeLists.txt

where <generator-name> stands for one of the target compilers listed under
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#section_Generators 

For example, the follwing command will create the project files for 
Visual Studio 2008 on 64bit Windows:
    
    cmake.exe -G "Visual Studio 9 2008 Win64" CmakeLists.txt

The resulting project- or makefiles may then be used to compile the 
JCuda libraries as a batch. Dependencies and most of the settings that
are specific for the target platform will be resolved automatically.

