Skip to content

Commit

Permalink
Added section about external dependencies to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gpu committed Apr 27, 2016
1 parent 6e97835 commit ff2e5fa
Showing 1 changed file with 53 additions and 2 deletions.
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,63 @@ and any compatible target compiler (e.g. Visual Studio or GCC):
* Press "Generate"

Then, `C:\JOCLRoot\JOCL.build` will contain the build files, e.g. the
GCC makefiles or the Visual Studio project files. Compiling the
GCC makefiles or the Visual Studio project files. Compiling the project
with these makefiles will place the binaries into a `nativeLibraries`
subdirectory of the project, e.g. into
`C:\JOCLRoot\JOCL\nativeLibraries`.


**Building and packaging the external native library dependencies**

JOCL itself does not have external dependencies, except for the run-time
dependency to the OpenCL implementation. If you only want to compile
JOCL, then you can skip this section.

This section only refers to libraries like
[JOCLBLAS](https://github.com/gpu/JOCLBLAS) and
[JOCLBlast](https://github.com/gpu/JOCLBlast), which require installations of
external libraries ([clBLAS](https://github.com/clMathLibraries/clBLAS/) and
[CLBlast](https://github.com/CNugteren/CLBlast/), respectively). The following
JOCLBlast and CLBlast, but the same process applies to all other external
dependencies.

Compiling and installing CLBlast (as described in its documentation) will
result in directories that contain the header files and the native libraries.
In order to build JOCLBlast, the paths to these header directories and
library files have to be entered in the CMake GUI, as the values of the
`CLBLAST_INSTALL_DIR` and `CLBlast_LIBRARY`.

After this information has been entered, the JOCLBlast library may be
compiled as described above, under **Building the native libraries**.
The resulting native JOCLBlast library will be placed into
the `nativeLibraries` directory of the project, for example, into
`C:\JOCLRoot\JOCLBlast\nativeLibraries`

This library is *dynamically* linked against the actual CLBlast library.
In order to be able to load this library, the CLBlast library must
be in a specific subdirectory of the `nativeLibraries` folder.
The name of this subdirectory is determined by the operating system and
architecture that the library is compiled for. The general pattern here is

`C:\JOCLRoot\JOCLBlast\nativeLibraries\OS\ARCHITECTURE`

The `OS` here refers to the operating system, and will usually be `windows`,
`linux` or `apple`. The `ARCHITECTURE` refers to the processor architecture
of the target system, and will usually be `x86` (for 32 bit system) or
`x86_64` (for 64 bit systems).

For example, on 64 bit Windows, the `clblast.dll` will have to be placed
into the directory

`C:\JOCLRoot\JOCLBlast\nativeLibraries\windows\x86_64\`

There, it will be picked up by the Maven and integrated into the JAR,
as described in the next section.





**Building the Java libraries**

The actual Java libraries can be built with
Expand All @@ -41,7 +92,7 @@ and execute
mvn clean install

This will compile the Java libraries, run the unit tests, assemble the
classes (together with the native library), sources and JavaDocs into
classes (together with the native libraries), sources and JavaDocs into
JAR files, and finally place all libraries into the
`C:\JOCLRoot\JOCL\target` directory.

Expand Down

0 comments on commit ff2e5fa

Please sign in to comment.