These are the build steps to compile ArrayFire from source on OSX. We use Homebrew to install dependencies.
Before you proceed with the build, make sure the submodules are up to date by running the following commands from the root of ArrayFire directory.
git submodule init
git submodule update
Overview:
$ brew install cmake freeimage
Refer to NVIDIA's website to install CUDA.
OpenCL Build DependenciesIn addition to the OpenCL library (installed by default on OSX), the OpenCL backend requires boost
. You can install it using brew:
The graphics backend uses GLFW which can be installed via. brew:
$ brew tap homebrew/versions $ brew install glfw
Configure CMake options via ccmake .
Note that Forge
graphics library doesn't need to be built to enable graphics support in ArrayFire. However, if do want to use graphics during development, please build forge too.
Commands:
$ cd /path/to/dir/arrayfire $ mkdir build && cd build $ cmake .. -DCMAKE_BUILD_TYPE=Release -DAF_BUILD_CUDA=ON -DAF_BUILD_OPENCL=ON # Enables building all 3 backends $ make -j8 # or number of threads of your choosing
The default installation prefix is /usr/local
. Thus, includes are installed to /usr/local/include
, libs are installed to /usr/local/lib
, tests and examples are installed to /usr/local/arrayfire
.
To change the install prefix, use
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dir
Then run make install
(sudo is installing to system directories).
Run tests:
$ cd /path/to/dir/arrayfire/build $ # Choose you preferred command $ make test # runs all test $ ctest # runs all test $ ctest -R substring # runs all tests that match the substring $ CTEST_OUTPUT_ON_FAILURE ctest # runs tests while printing output only if a test fails $ ./test/testname_backend # runs single test with output
Run examples:
$ cd /path/to/dir/arrayfire/build $ ./examples/example_backend
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4