Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Build Instructions for OSX

pradeep edited this pageJan 14, 2021 ·17 revisions

These are the build steps to compile ArrayFire from source on OSX. We useHomebrew 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 initgit submodule update

Overview:

Installing Dependencies

General Dependencies

  • Required: cmake
  • Recommended: FreeImage
  • OSX 10.9 or later
$ brew install cmake freeimage

CPU Build Dependencies

  • Required: fftw
$ brew install fftw

CUDA Build Dependencies

  • Required: >=CUDA 9.0, Boost (shared_ptr component)
  • Recommended: Latest version of CUDA (CUDA 10.0 at the time of writing)

Boost

$ brew install boost

CUDA

Refer toNVIDIA's website to install CUDA.

OpenCL Build Dependencies

In addition to the OpenCL library (installed by default on OSX), the OpenCL backend requiresboost. You can install it using brew:

$ brew install boost

ArrayFire graphics dependencies

The graphics backend uses GLFW which can be installed via. brew:

$ brew tap homebrew/versions$ brew install glfw

Building ArrayFire

Configure CMake options viaccmake .

OptionsDescriptionDefault
AF_BUILD_CPUEnable CPU BuildON
AF_BUILD_CUDAEnable CUDA BuildOFF
AF_BUILD_OPENCLEnable OpenCL BuildOFF
AF_BUILD_FORGEBuild Forge Graphics LibraryOFF
AF_BUILD_EXAMPLESBuilds ExamplesON
BUILD_TESTINGBuilds TestsON
CMAKE_BUILD_TYPEBuild typeDebug

Note thatForge 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

Installing ArrayFire

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 runmake install (sudo is installing to system directories).

Running Tests and Examples

Run tests:

$cd /path/to/dir/arrayfire/build$# Choose you preferred command$ maketest# 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
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp