Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated 3.9 install and getting started instructions #3496

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 40 additions & 49 deletions docs/pages/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ target architecture and operating system. Although ArrayFire can be [built
from source](https://github.com/arrayfire/arrayfire), the installers
conveniently package necessary dependencies.

Install the latest device drivers before using ArrayFire. If you are going to
target the CPU using ArrayFire’s OpenCL backend, install the OpenCL
runtime. Drivers and runtimes should be downloaded and installed from the
device vendor’s website.
Install the latest device drivers before using ArrayFire. Drivers and runtimes
should be downloaded and installed from each device vendor's website.

# Install Instructions {#InstallInstructions}

Expand All @@ -19,15 +17,11 @@ device vendor’s website.

## Windows {#Windows}

Prior to installing ArrayFire on Windows,
[download](https://www.microsoft.com/download/details.aspx?id=48145)
install the Visual Studio 2015 (x64) runtime libraries.
Once the ArrayFire has been downloaded, run the installer.

Once the ArrayFire installer has been downloaded, run the installer. If you
choose not to modify the path during the installation procedure, you'll need
to manually add ArrayFire to the path for all users. Simply append
`%%AF_PATH%/lib` to the PATH variable so that the loader can find ArrayFire
DLLs.
The installer offers the option to automatically add ArrayFire to the path for
all users. If the installer did not do this, simply append `%%AF_PATH%/lib` to
the PATH variable so that the loader can find ArrayFire DLLs.

For more information on using ArrayFire on Windows, visit the following
[page](http://arrayfire.org/docs/using_on_windows.htm).
Expand All @@ -36,42 +30,42 @@ For more information on using ArrayFire on Windows, visit the following

There are two ways to install ArrayFire on Linux.
1. Package Manager
2. Using ArrayFire Linux Installer
2. Using the ArrayFire Linux Installer

As of today, approach (1) is only supported for Ubuntu 18.04 and 20.04. Please
go through [our GitHub wiki
page](https://github.com/arrayfire/arrayfire/wiki/Install-ArrayFire-From-Linux-Package-Managers)
for the detailed instructions.
go through [the GitHub
wiki[page](https://github.com/arrayfire/arrayfire/wiki/Install-ArrayFire-From-Linux-Package-Managers)
for detailed instructions.

For approach (2), once you have downloaded the ArrayFire installer, execute
the installer from the terminal as shown below. Set the `--prefix` argument to
the directory you would like to install ArrayFire to - we recommend `/opt`.
For approach (2), once the ArrayFire installer is downloaded, execute the
installer from the terminal as shown below. Set the `--prefix` argument to the
target install directory; we recommend `/opt`.

./Arrayfire_*_Linux_x86_64.sh --include-subdir --prefix=/opt
./ArrayFire_*_Linux_x86_64.sh --include-subdir --prefix=/opt

Given sudo permissions, you can add the ArrayFire libraries via `ldconfig` like
so:
Given sudo permissions, the ArrayFire libraries can be added to the path via
`ldconfig` like so:

echo /opt/arrayfire/lib64 > /etc/ld.so.conf.d/arrayfire.conf
sudo ldconfig

Otherwise, you will need to set the `LD_LIBRARY_PATH` environment variable in
order to let your shared library loader find the ArrayFire libraries.
Otherwise, the `LD_LIBRARY_PATH` environment variable can be set so that the
shared library loader can find the ArrayFire libraries.

For more information on using ArrayFire on Linux, visit the following
[page](http://arrayfire.org/docs/using_on_linux.htm).

### Graphics support

ArrayFire allows you to do high performance visualizations via our
ArrayFire enables high-performance visualizations via the
[Forge](https://github.com/arrayfire/forge) library. On Linux, there are a few
dependencies you will need to install to enable graphics support:
dependencies to install to enable graphics support:

FreeImage
Fontconfig
GLU (OpenGL Utility Library)
* FreeImage
* Fontconfig
* GLU (OpenGL Utility Library)

We show how to install these dependencies on common Linux distributions:
To install these dependencies on common Linux distributions:

__Debian, Ubuntu (14.04 and above), and other Debian derivatives__

Expand All @@ -84,9 +78,9 @@ __Fedora, Redhat, CentOS__

## macOS {#macOS}

Once you have downloaded the ArrayFire installer, execute the installer by
either double clicking on the ArrayFire `pkg` file or running the following
command from your terminal:
Once the ArrayFire installer has been downloaded, execute the installer by
either double-clicking on the ArrayFire `pkg` file or running the following
command:

sudo installer -pkg Arrayfire-*_OSX.pkg -target /

Expand All @@ -95,11 +89,10 @@ For more information on using ArrayFire on macOS, visit the following

## NVIDIA Tegra devices

ArrayFire is capable of running on TX1 and TX2 devices. The TK1 is no longer
supported.
ArrayFire is capable of running TX2 devices.

Prior to installing ArrayFire, make sure you have the latest version of JetPack
(v2.3 and above) or L4T (v24.2 and above) on your device.
Before installing ArrayFire, make sure the latest version of JetPack (v2.3 and
above) or L4T (v24.2 and above) is installed.

### Tegra prerequisites

Expand All @@ -109,27 +102,25 @@ The following dependencies are required for Tegra devices:

## Testing installation

After ArrayFire is finished installing, we recommend building and running a few
of the provided examples to verify things are working as expected.
After ArrayFire is finished installing, we recommend building and running a
few of the provided examples to verify things are working as expected.

On Unix-like systems:
On Windows, open the CMakeLists.txt file from CMake-GUI. Once the project is
configured and generated, build and run the examples from Visual Studio.

On Linux, run the following commands:

cp -r /opt/arrayfire/share/ArrayFire/examples /tmp/examples
cd /tmp/examples
mkdir build
cd build
cmake -DASSETS_DIR:PATH=/tmp ..
cmake ..
make
./helloworld/helloworld_{cpu,cuda,opencl}

On Windows, open the CMakeLists.txt file from CMake-GUI and set `ASSETS_DIR`
variable to the parent folder of examples folder. Once the project is
configured and generated, you can build and run the examples from Visual
Studio.
./helloworld/helloworld_{cpu,cuda,oneapi,opencl}

## <a name="GettingHelp"></a> Getting help

* Google Groups: https://groups.google.com/forum/#!forum/arrayfire-users
* ArrayFire Services: [Consulting](https://arrayfire.com/consulting/) | [Support](https://arrayfire.com/support/) | [Training](https://arrayfire.com/training/)
* ArrayFire Services: [Consulting](https://arrayfire.com/consulting/) | [Training](https://arrayfire.com/training/)
* ArrayFire Blogs: http://arrayfire.com/blog/
* Email: <mailto:technical@arrayfire.com>
* Email: <mailto:support@arrayfire.com>
22 changes: 14 additions & 8 deletions docs/pages/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,40 @@ v3.9.0
- Add broadcast support \PR{2871}
- Improve OpenCL CPU JIT performance \PR{3257} \PR{3392}
- Optimize thread/block calculations of several kernels \PR{3144}
- Add support for fast math compiliation when building ArrayFire \PR{3334 \PR{3337}
- Add support for fast math compiliation when building ArrayFire \PR{3334}
\PR{3337}
- Optimize performance of fftconvolve when using floats \PR{3338}
- Add support for CUDA 12.1 and 12.2
- Better handling of empty arrays \PR{3398}
- Better handling of memory in linear algebra functions in OpenCL \PR{3423}
- Better logging with JIT kernels \PR{3468}
- Optimize memory manager/JIT interactions for small number of buffers \PR{3468}
- Optimize memory manager/JIT interactions for small number of buffers
\PR{3468}
- Documentation improvements \PR{3485}
- Optimize reorder function \PR{3488}

## Fixes
- Improve Errors when creating OpenCL contexts from devices \PR{3257}
- Improvements to vcpkg builds \PR{3376 \PR{3476}
- Fix reduce by key when nan's are present \PR{3261}
- Fix error in convolve where the ndims parameter was forced to be equal to 2 \PR{3277}
- Make constructors that accept dim_t to be explicit to avoid invalid conversions \PR{3259}
- Fix error in randu when compiling against clang 14 \PR{3333}
- Fix error in convolve where the ndims parameter was forced to be equal to 2
\PR{3277}
- Make constructors that accept dim_t to be explicit to avoid invalid
conversions \PR{3259}
- Fix error in randu when compiling against clang 14 \PR{3333}
- Fix bug in OpenCL linear algebra functions \PR{3398}
- Fix bug with thread local variables when device was changed \PR{3420} \PR{3421}
- Fix bug in qr related to uninitialized memory \PR{3422}
- Fix bug with thread local variables when device was changed \PR{3420}
\PR{3421}
- Fix bug in qr related to uninitialized memory \PR{3422}
- Fix bug in shift where the array had an empty middle dimension \PR{3488}


## Contributions

Special thanks to our contributors:
[Willy Born](https://github.com/willyborn)
[Mike Mullen](https://github.com/mfzmullen)


v3.8.3
======

Expand Down Expand Up @@ -101,6 +106,7 @@ Special thanks to our contributors:
[Jacob Kahn](https://github.com/jacobkahn)
[Willy Born](https://github.com/willyborn)


v3.8.1
======

Expand Down
54 changes: 28 additions & 26 deletions docs/pages/using_on_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Using ArrayFire on Linux {#using_on_linux}
Once you have [installed](\ref installing) ArrayFire on your system, the next
thing to do is set up your build system. On Linux, you can create ArrayFire
projects using almost any editor, compiler, or build system. The only
requirements are that you include the ArrayFire header directories and link with
the ArrayFire library you intend to use i.e. CUDA, OpenCL, CPU, or Unified
backends.
requirements are that you include the ArrayFire header directories and link
with the ArrayFire library you intend to use i.e. CUDA, OpenCL, oneAPI, CPU,
or Unified backends.

## The big picture {#big-picture-linux}

Expand All @@ -15,17 +15,18 @@ installer will populate files in the following sub-directories:

include/arrayfire.h - Primary ArrayFire include file
include/af/*.h - Additional include files
lib/libaf* - CPU, CUDA, oneAPI and OpenCL libraries (.a, .so)
lib/libaf* - CPU, CUDA, oneAPI, and OpenCL libraries (.a, .so)
lib/libforge* - Visualization library
lib/libcu* - CUDA backend dependencies
lib/libOpenCL.so - OpenCL ICD Loader library
share/ArrayFire/cmake/* - CMake config (find) scripts
share/ArrayFire/examples/* - All ArrayFire examples

Because ArrayFire follows standard installation practices, you can use basically
any build system to create and compile projects that use ArrayFire. Among the
many possible build systems on Linux we suggest using ArrayFire with either
CMake or Makefiles with CMake being our preferred build system.
Because ArrayFire follows standard installation practices, you can use
basically any build system to create and compile projects that use
ArrayFire. Among the many possible build systems on Linux we suggest using
ArrayFire with either CMake or Makefiles with CMake being our preferred build
system.

## Prerequisite software

Expand Down Expand Up @@ -57,8 +58,8 @@ apt install build-essential cmake cmake-curses-gui
## CMake

We recommend that the CMake build system be used to create ArrayFire projects.
As [discussed above](#big-picture-linux), ArrayFire ships with a series of CMake
scripts to make finding and using our library easy.
As [discussed above](#big-picture-linux), ArrayFire ships with a series of
CMake scripts to make finding and using our library easy.

First create a file called `CMakeLists.txt` in your project directory:

Expand All @@ -74,19 +75,19 @@ and populate it with the following code:
# Unified backend lets you choose the backend at runtime
target_link_libraries(<my_executable> ArrayFire::af)

where `my_executable` is the name of the executable you wish to create. See the
[CMake documentation](https://cmake.org/documentation/) for more information on
how to use CMake. To link with a specific backend directly, replace the
`ArrayFire::af` with the following for their respective backends.
where `my_executable` is the name of the executable you wish to create. See
the [CMake documentation](https://cmake.org/documentation/) for more
information on how to use CMake. To link with a specific backend directly,
replace the `ArrayFire::af` with the following for their respective backends.

* `ArrayFire::afcpu` for CPU backend.
* `ArrayFire::afcuda` for CUDA backend.
* `ArrayFire::afoneapi` for oneAPI backend.
* `ArrayFire::afopencl` for OpenCL backend.

Next we need to instruct CMake to create build instructions and then compile. We
suggest using CMake's out-of-source build functionality to keep your build and
source files cleanly separated. To do this open the CMake GUI.
Next we need to instruct CMake to create build instructions and then
compile. We suggest using CMake's out-of-source build functionality to keep
your build and source files cleanly separated. To do this open the CMake GUI.

cd your-project-directory
mkdir build
Expand All @@ -98,27 +99,28 @@ source files cleanly separated. To do this open the CMake GUI.
still help you out. When you execute CMake specify the path to ArrayFire
installation root as `ArrayFire_DIR` variable.

For example, if ArrayFire were installed locally to `/home/user/ArrayFire` then
you would modify the `cmake` command above to contain the following definition:
For example, if ArrayFire were installed locally to `/home/user/ArrayFire`
then you would modify the `cmake` command above to contain the following
definition:

cmake -DArrayFire_DIR=/home/user/ArrayFire ..

You can also specify this information in the `ccmake` command-line interface.

## Makefiles

Building ArrayFire projects with Makefiles is fairly similar to CMake except you
must specify all paths and libraries manually.
Building ArrayFire projects with Makefiles is fairly similar to CMake except
you must specify all paths and libraries manually.

As with any `make` project, you need to specify the include path to the
directory containing `arrayfire.h` file. This should be `-I
/opt/arrayfire/include` if you followed our installation instructions.

Similarly, you will need to specify the path to the ArrayFire library using the
`-L` option (e.g. `-L/opt/arrayfire/lib`) followed by the specific ArrayFire
library you wish to use using the `-l` option (for example `-lafcpu`,
`-lafopencl`, `-lafoneapi`, `-lafcuda`, or `-laf` for the CPU, OpenCL, oneAPI
and CUDA, and unified backends, respectively.
Similarly, you will need to specify the path to the ArrayFire library using
the `-L` option (e.g. `-L/opt/arrayfire/lib`) followed by the specific
ArrayFire library you wish to use using the `-l` option (for example
`-lafcpu`, `-lafopencl`, `-lafoneapi`, `-lafcuda`, or `-laf` for the CPU,
OpenCL, oneAPI, and CUDA, and unified backends, respectively.

Here is a minimal example Makefile which uses ArrayFire's CPU backend:

Expand Down