Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeModules/osx_install/OSXInstaller.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ PKG_BUILD( PKG_NAME ArrayFireOPENCL
DEPENDS OSX_INSTALL_SETUP_OpenCL
TARGETS opencl_package
INSTALL_LOCATION /usr/local
SCRIPT_DIR ${OSX_INSTALL_DIR}/opencl_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.opencl.lib
PATH_TO_FILES ${OSX_TEMP}/OpenCL
FILTERS cpu cuda unified)
Expand Down
17 changes: 14 additions & 3 deletions CMakeModules/osx_install/cpu_scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set -o pipefail
err_file=/tmp/AFInstallerCPU.err
brew=/usr/local/bin/brew

echo $(date) > $err_file

if [ ! -f $brew ]; then
osascript -e 'tell app "Finder" to display dialog "Brew not installed. Please install brew at http://brew.sh"'
osascript -e 'tell app "Installer" to display dialog "Brew not installed. Please install brew at http://brew.sh"'
open http://brew.sh
echo "Brew not found" >> $err_file
exit 1
Expand All @@ -20,5 +22,14 @@ if [ -z $user ]; then
exit 1
fi

su $user -c "$brew tap homebrew/versions" 2> $err_file
su $user -c "$brew install fftw glfw3 fontconfig" 2> $err_file
function deps_err
{
osascript -e 'tell app "Installer" to display dialog "ArrayFire files installed but failed to install ArrayFire dependencies using Brew."'
osascript -e 'tell app "Installer" to display dialog "Visit https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures to fix errors manually."'
open https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures
echo "Dependencies failed to install" >> $err_file
exit 1
}

su $user -c "$brew tap homebrew/versions" >> $err_file 2>&1
su $user -c "$brew install fftw glfw3 fontconfig" >> $err_file 2>&1 || deps_err
17 changes: 14 additions & 3 deletions CMakeModules/osx_install/cuda_scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set -o pipefail
err_file=/tmp/AFInstallerCUDA.err
brew=/usr/local/bin/brew

echo $(date) > $err_file

if [ ! -f $brew ]; then
osascript -e 'tell app "Finder" to display dialog "Brew not installed. Please install brew at brew.sh"'
osascript -e 'tell app "Installer" to display dialog "Brew not installed. Please install brew at brew.sh"'
echo "Brew not found" >> $err_file
exit 1
fi
Expand All @@ -19,5 +21,14 @@ if [ -z $user ]; then
exit 1
fi

su $user -c "$brew tap homebrew/versions" 2> $err_file
su $user -c "$brew install glfw3 fontconfig" 2> $err_file
function deps_err
{
osascript -e 'tell app "Installer" to display dialog "ArrayFire files installed but failed to install ArrayFire dependencies using Brew."'
osascript -e 'tell app "Installer" to display dialog "Visit https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures to fix errors manually."'
open https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures
echo "Dependencies failed to install" >> $err_file
exit 1
}

su $user -c "$brew tap homebrew/versions" >> $err_file 2>&1
su $user -c "$brew install glfw3 fontconfig" >> $err_file 2>&1 || deps_err
17 changes: 14 additions & 3 deletions CMakeModules/osx_install/opencl_scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set -o pipefail
err_file=/tmp/AFInstallerOpenCL.err
brew=/usr/local/bin/brew

echo $(date) > $err_file

if [ ! -f $brew ]; then
osascript -e 'tell app "Finder" to display dialog "Brew not installed. Please install brew at brew.sh"'
osascript -e 'tell app "Installer" to display dialog "Brew not installed. Please install brew at brew.sh"'
echo "Brew not found" >> $err_file
exit 1
fi
Expand All @@ -19,5 +21,14 @@ if [ -z $user ]; then
exit 1
fi

su $user -c "$brew tap homebrew/versions" 2> $err_file
su $user -c "$brew install glfw3 fontconfig" 2> $err_file
function deps_err
{
osascript -e 'tell app "Installer" to display dialog "ArrayFire files installed but failed to install ArrayFire dependencies using Brew."'
osascript -e 'tell app "Installer" to display dialog "Visit https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures to fix errors manually."'
open https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures
echo "Dependencies failed to install" >> $err_file
exit 1
}

su $user -c "$brew tap homebrew/versions" >> $err_file 2>&1
su $user -c "$brew install fftw glfw3 fontconfig" >> $err_file 2>&1 || deps_err
1 change: 1 addition & 0 deletions CMakeModules/osx_install/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ <h2>Install Directories</h2>
</ul>
<p> For complete list of updates, visit <a href="http://www.arrayfire.com/docs/releasenotes.htm">ArrayFire Release Notes</a></p>

<p> For questions about ArrayFire or this installer, visit <a href="https://groups.google.com/forum/#!forum/arrayfire-users"> ArrayFire User Forums</a> </p>
</body>
</html>
45 changes: 44 additions & 1 deletion docs/pages/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
Release Notes {#releasenotes}
==============

v3.3.2
==============

Improvements
------------
* Family of [Sort](\ref sort_mat) functions now support
[higher order dimensions](https://github.com/arrayfire/arrayfire/pull/1373).
* Improved performance of batched sort on dim 0 for all [Sort](\ref sort_mat) functions.
* [Median](\ref stat_func_median) now also supports higher order dimensions.

Bug Fixes
--------------

* Fixes to [error handling](https://github.com/arrayfire/arrayfire/issues/1352) in C++ API for binary functions.
* Fixes to [external OpenCL context management](https://github.com/arrayfire/arrayfire/issues/1350).
* Fixes to [JPEG_GREYSCALE](https://github.com/arrayfire/arrayfire/issues/1360) for FreeImage versions <= 3.154.
* Fixed for [non-float inputs](https://github.com/arrayfire/arrayfire/issues/1386) to \ref af::rgb2gray().

Build
------
* [Disable CPU Async](https://github.com/arrayfire/arrayfire/issues/1378) when building with GCC < 4.8.4.
* Add option to [disable CPUID](https://github.com/arrayfire/arrayfire/issues/1369) from CMake.
* More verbose message when [CUDA Compute Detection fails](https://github.com/arrayfire/arrayfire/issues/1362).
* Print message to use [CUDA library stub](https://github.com/arrayfire/arrayfire/issues/1363)
from CUDA Toolkit if CUDA Library is not found from default paths.
* [Build Fixes](https://github.com/arrayfire/arrayfire/pull/1385) on Windows.
* For compiling tests our of source.
* For compiling ArrayFire with static MKL.
* [Exclude <sys/sysctl.h>](https://github.com/arrayfire/arrayfire/pull/1368) when building on GNU Hurd.
* Add [manual CMake options](https://github.com/arrayfire/arrayfire/pull/1389) to build DEB and RPM packages.

Documentation
-------------
* Fixed documentation for \ref af::replace().
* Fixed images in [Using on OSX](\ref using_on_osx) page.

Installer
---------
* Linux x64 installers will now be compiled with GCC 4.9.2.
* OSX installer gives better error messages on brew failures and
now includes link to [Fixing OS X Installer Failures] (https://github.com/arrayfire/arrayfire/wiki/Fixing-Common-OS-X-Installer-Failures)
for brew installation failures.

v3.3.1
==============

Expand Down Expand Up @@ -361,7 +404,7 @@ Bug Fixes
Documentation Updates
---------------------
* Improved tutorials documentation
* More detailed Using on [Linux](\ref using_on_windows), [OSX](\ref using_on_windows),
* More detailed Using on [Linux](\ref using_on_linux), [OSX](\ref using_on_osx),
[Windows](\ref using_on_windows) pages.
* Added return type information for functions that return different type
arrays
Expand Down
185 changes: 116 additions & 69 deletions docs/pages/using_on_osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,75 +27,12 @@ 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.

## XCode
## Build Instructions:
* [CMake](#CMake)
* [MakeFiles](#MakeFiles)
* [XCode](#XCode)

Although we recommend using CMake to build ArrayFire projects on OSX, you can
use XCode if this is your preferred development platform.
To save some time, we have created an sample XCode project in our
[ArrayFire Project Templates repository](https://github.com/arrayfire/arrayfire-project-templates).

To set up a basic C/C++ project in XCode do the following:

1. Start up XCode. Choose OSX -> Application, Command Line Tool for the project:
<img src="xcode-setup/xcode-startup.png" alt="Create a command line too XCode Project" width="100%" />

2. Fill in the details for your project and choose either C or C++ for the project:
<img src="xcode-setup/project-options.png" alt="Create a C/C++ project" width="100%" />

3. Next we need to configure the build settings. In the left-hand pane, click
on the project. In the center pane, click on "Build Settings" followed by
the "All" button:
<img src="xcode-setup/build-settings.png" alt="Configure build settings" width="100%" />

4. Now search for "Header Search Paths" and add `/usr/local/include` to the list:
<img src="xcode-setup/header-search-paths.png" alt="Configure build settings" width="100%" />

5. Then search for "Library Search Paths" and add `/usr/local/lib` to the list:
<img src="xcode-setup/library-search-paths.png" alt="Configure build settings" width="100%" />

6. Next, we need to make sure the executable is linked with an ArrayFire library:
To do this, click the "Build Phases" tab and expand the "Link with Binary Library"
menu:
<img src="xcode-setup/build-phases.png" alt="Configure build settings" width="100%" />

7. In the search dialog that pops up, choose the "Add Other" button from the
lower right. Specify the `/usr/local/lib` folder:
<img src="xcode-setup/library-folder-path.png" alt="Configure build settings" width="100%" />

8. Lastly, select the ArrayFire library with which you wish to link your program.
Your options will be:

~~~~~
libafcuda.*.dylib - CUDA backend
libafopencl.*.dylib - OpenCL backend
libafcpu.*.dylib - CPU backend
libaf.*.dylib - Unified backend
~~~~~

In the picture below, we have elected to link with the OpenCL backend:

<img src="xcode-setup/pick-arrayfire-library.png" alt="Configure build settings" width="100%" />

9. Lastly, lets test ArrayFire's functionality. In the left hand pane open
the main.cpp` file and insert the following code:

~~~~~
// Include the ArrayFire header file
#include <arrayfire.h>

int main(int argc, const char * argv[]) {
// Gather some information about the ArrayFire device
af::info();
return 0;
}
~~~~~

Finally, click the build button and you should see some information about your
graphics card in the lower-section of your screen:

<img src="xcode-setup/afinfo-result.png" alt="Configure build settings" width="100%" />

## CMake
## <a name="CMake"></a>CMake

We recommend that the CMake build system be used to create ArrayFire projects.
If you are writing a new ArrayFire project in C/C++ from scratch, we suggest
Expand Down Expand Up @@ -193,7 +130,7 @@ would modify the `cmake` command above to contain the following definition:

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

## MakeFiles
## <a name="MakeFiles"></a> MakeFiles

Building ArrayFire projects with Makefiles is fairly similar to CMake except
you must specify all paths and libraries manually.
Expand All @@ -217,3 +154,113 @@ Here is a minimial example MakeFile which uses ArrayFire's CPU backend:

all: main.cpp Makefile
$(CC) main.cpp -o test $(INCLUDES) $(LIBS) $(LIB_PATHS)

## <a name="XCode"></a> XCode

Although we recommend using CMake to build ArrayFire projects on OSX, you can
use XCode if this is your preferred development platform.
To save some time, we have created an sample XCode project in our
[ArrayFire Project Templates repository](https://github.com/arrayfire/arrayfire-project-templates).

To set up a basic C/C++ project in XCode do the following:

1. Start up XCode. Choose OSX -> Application, Command Line Tool for the project:
\htmlonly
<br />
<a href="xcode-setup/xcode-startup.png">
<img src="xcode-setup/xcode-startup.png" alt="Create a command line too XCode Project" align="middle" width="50%" />
</a>
\endhtmlonly

2. Fill in the details for your project and choose either C or C++ for the project:
\htmlonly
<br />
<a href="xcode-setup/project-options.png">
<img src="xcode-setup/project-options.png" alt="Create a C/C++ project" align="middle" width="50%" />
</a>
\endhtmlonly

3. Next we need to configure the build settings. In the left-hand pane, click
on the project. In the center pane, click on "Build Settings" followed by
the "All" button:
\htmlonly
<br />
<a href="xcode-setup/build-settings.png">
<img src="xcode-setup/build-settings.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

4. Now search for "Header Search Paths" and add `/usr/local/include` to the list:
\htmlonly
<br />
<a href="xcode-setup/header-search-paths.png">
<img src="xcode-setup/header-search-paths.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

5. Then search for "Library Search Paths" and add `/usr/local/lib` to the list:
\htmlonly
<br />
<a href="xcode-setup/library-search-paths.png">
<img src="xcode-setup/library-search-paths.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

6. Next, we need to make sure the executable is linked with an ArrayFire library:
To do this, click the "Build Phases" tab and expand the "Link with Binary Library"
menu:
\htmlonly
<br />
<a href="xcode-setup/build-phases.png">
<img src="xcode-setup/build-phases.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

7. In the search dialog that pops up, choose the "Add Other" button from the
lower right. Specify the `/usr/local/lib` folder:
\htmlonly
<br />
<a href="xcode-setup/library-folder-path.png">
<img src="xcode-setup/library-folder-path.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

8. Lastly, select the ArrayFire library with which you wish to link your program.
Your options will be:
~~~~~
libafcuda.*.dylib - CUDA backend
libafopencl.*.dylib - OpenCL backend
libafcpu.*.dylib - CPU backend
libaf.*.dylib - Unified backend
~~~~~
In the picture below, we have elected to link with the OpenCL backend:
\htmlonly
<br />
<a href="xcode-setup/pick-arrayfire-library.png">
<img src="xcode-setup/pick-arrayfire-library.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly

9. Lastly, lets test ArrayFire's functionality. In the left hand pane open
the main.cpp` file and insert the following code:

~~~~~
// Include the ArrayFire header file
#include <arrayfire.h>

int main(int argc, const char * argv[]) {
// Gather some information about the ArrayFire device
af::info();
return 0;
}
~~~~~

Finally, click the build button and you should see some information about your
graphics card in the lower-section of your screen:

\htmlonly
<br />
<a href="xcode-setup/afinfo-result.png">
<img src="xcode-setup/afinfo-result.png" alt="Configure build settings" align="middle" width="50%" />
</a>
\endhtmlonly