Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Created October 30, 2015 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmpvar/833d462b3774f1199348 to your computer and use it in GitHub Desktop.
Save tmpvar/833d462b3774f1199348 to your computer and use it in GitHub Desktop.
diff --git a/examples/opencl/histogram.cpp b/examples/opencl/histogram.cpp
index 4817efd..fb3c39b 100644
--- a/examples/opencl/histogram.cpp
+++ b/examples/opencl/histogram.cpp
@@ -18,6 +18,7 @@
#include <iterator>
#include <algorithm>
#include "cl_helpers.h"
+#include <math.h>
using namespace cl;
using namespace std;
tmp‣ git clone https://github.com/arrayfire/forge && cd forge && cmake . -DBUILD_EXAMPLES=ON && make
Cloning into 'forge'...
remote: Counting objects: 1915, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 1915 (delta 0), reused 0 (delta 0), pack-reused 1911
Receiving objects: 100% (1915/1915), 591.68 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1268/1268), done.
Checking connectivity... done.
-- The C compiler identification is AppleClang 7.0.0.7000176
-- The CXX compiler identification is AppleClang 7.0.0.7000176
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework
-- Using Dynamic GLEWmx Lib
-- Looking for XOpenDisplay in /opt/X11/lib/libX11.dylib;/opt/X11/lib/libXext.dylib
-- Looking for XOpenDisplay in /opt/X11/lib/libX11.dylib;/opt/X11/lib/libXext.dylib - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /opt/X11/lib/libX11.dylib
-- GLM...
-- getting https://github.com/g-truc/glm/archive/0.9.6.3.tar.gz
-- [download 0% complete]
-- [download 1% complete]
-- [download 2% complete]
-- [download 3% complete]
-- [download 4% complete]
-- [download 5% complete]
-- [download 6% complete]
-- [download 7% complete]
-- [download 8% complete]
-- [download 9% complete]
-- [download 10% complete]
-- [download 11% complete]
-- [download 12% complete]
-- [download 13% complete]
-- [download 14% complete]
-- [download 15% complete]
-- [download 16% complete]
-- [download 17% complete]
-- [download 18% complete]
-- [download 19% complete]
-- [download 20% complete]
-- [download 21% complete]
-- [download 22% complete]
-- [download 23% complete]
-- [download 24% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 27% complete]
-- [download 28% complete]
-- [download 29% complete]
-- [download 30% complete]
-- [download 31% complete]
-- [download 32% complete]
-- [download 33% complete]
-- [download 34% complete]
-- [download 35% complete]
-- [download 36% complete]
-- [download 37% complete]
-- [download 38% complete]
-- [download 39% complete]
-- [download 40% complete]
-- [download 41% complete]
-- [download 42% complete]
-- [download 43% complete]
-- [download 44% complete]
-- [download 45% complete]
-- [download 46% complete]
-- [download 47% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 50% complete]
-- [download 51% complete]
-- [download 52% complete]
-- [download 53% complete]
-- [download 54% complete]
-- [download 55% complete]
-- [download 56% complete]
-- [download 57% complete]
-- [download 58% complete]
-- [download 59% complete]
-- [download 60% complete]
-- [download 61% complete]
-- [download 62% complete]
-- [download 63% complete]
-- [download 64% complete]
-- [download 65% complete]
-- [download 66% complete]
-- [download 67% complete]
-- [download 68% complete]
-- [download 69% complete]
-- [download 70% complete]
-- [download 71% complete]
-- [download 72% complete]
-- [download 73% complete]
-- [download 74% complete]
-- [download 75% complete]
-- [download 76% complete]
-- [download 77% complete]
-- [download 78% complete]
-- [download 79% complete]
-- [download 80% complete]
-- [download 81% complete]
-- [download 82% complete]
-- [download 83% complete]
-- [download 84% complete]
-- [download 85% complete]
-- [download 86% complete]
-- [download 87% complete]
-- [download 88% complete]
-- [download 89% complete]
-- [download 90% complete]
-- [download 91% complete]
-- [download 92% complete]
-- [download 93% complete]
-- [download 94% complete]
-- [download 95% complete]
-- [download 96% complete]
-- [download 97% complete]
-- [download 98% complete]
-- [download 99% complete]
-- [download 100% complete]
-- validating /Users/tmpvar/work/gfx/tmp/forge/third_party/glm-0.9.6.3.tar.gz
-- extracting /Users/tmpvar/work/gfx/tmp/forge/third_party/glm-0.9.6.3.tar.gz
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29")
-- Found Fontconfig: /opt/X11/lib/libfontconfig.dylib
-- GLFW found!
-- CUDA Toolkit not found, not building CUDA examples.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tmpvar/work/gfx/tmp/forge
Scanning dependencies of target freetype-ext
[ 2%] Creating directories for 'freetype-ext'
[ 4%] Performing download step (git clone) for 'freetype-ext'
Cloning into 'freetype-ext'...
Note: checking out '14df6b1a63f5c5773bb498063205cb79aac21173'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 14df6b1... [autofit] By default, enable warping code but switch off warping.
[ 7%] No patch step for 'freetype-ext'
[ 9%] No update step for 'freetype-ext'
[ 11%] Performing configure step for 'freetype-ext'
-- The C compiler identification is AppleClang 7.0.0.7000176
-- The CXX compiler identification is AppleClang 7.0.0.7000176
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Creating directory, /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/src/freetype-ext-build/include/freetype2.
-- Creating /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/src/freetype-ext-build/include/freetype2/ftconfig.h.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/src/freetype-ext-build
[ 14%] Performing build step for 'freetype-ext'
Scanning dependencies of target freetype
[ 1%] Building C object CMakeFiles/freetype.dir/src/autofit/autofit.c.o
[ 3%] Building C object CMakeFiles/freetype.dir/src/base/ftadvanc.c.o
[ 5%] Building C object CMakeFiles/freetype.dir/src/base/ftbbox.c.o
[ 7%] Building C object CMakeFiles/freetype.dir/src/base/ftbdf.c.o
[ 9%] Building C object CMakeFiles/freetype.dir/src/base/ftbitmap.c.o
[ 11%] Building C object CMakeFiles/freetype.dir/src/base/ftcalc.c.o
[ 13%] Building C object CMakeFiles/freetype.dir/src/base/ftcid.c.o
[ 15%] Building C object CMakeFiles/freetype.dir/src/base/ftdbgmem.c.o
[ 16%] Building C object CMakeFiles/freetype.dir/src/base/ftdebug.c.o
[ 18%] Building C object CMakeFiles/freetype.dir/src/base/ftfntfmt.c.o
[ 20%] Building C object CMakeFiles/freetype.dir/src/base/ftfstype.c.o
[ 22%] Building C object CMakeFiles/freetype.dir/src/base/ftgasp.c.o
[ 24%] Building C object CMakeFiles/freetype.dir/src/base/ftgloadr.c.o
[ 26%] Building C object CMakeFiles/freetype.dir/src/base/ftglyph.c.o
[ 28%] Building C object CMakeFiles/freetype.dir/src/base/ftgxval.c.o
[ 30%] Building C object CMakeFiles/freetype.dir/src/base/ftinit.c.o
[ 32%] Building C object CMakeFiles/freetype.dir/src/base/ftlcdfil.c.o
[ 33%] Building C object CMakeFiles/freetype.dir/src/base/ftmm.c.o
[ 35%] Building C object CMakeFiles/freetype.dir/src/base/ftobjs.c.o
[ 37%] Building C object CMakeFiles/freetype.dir/src/base/ftotval.c.o
[ 39%] Building C object CMakeFiles/freetype.dir/src/base/ftoutln.c.o
[ 41%] Building C object CMakeFiles/freetype.dir/src/base/ftpatent.c.o
[ 43%] Building C object CMakeFiles/freetype.dir/src/base/ftpfr.c.o
[ 45%] Building C object CMakeFiles/freetype.dir/src/base/ftrfork.c.o
[ 47%] Building C object CMakeFiles/freetype.dir/src/base/ftsnames.c.o
[ 49%] Building C object CMakeFiles/freetype.dir/src/base/ftstream.c.o
[ 50%] Building C object CMakeFiles/freetype.dir/src/base/ftstroke.c.o
[ 52%] Building C object CMakeFiles/freetype.dir/src/base/ftsynth.c.o
[ 54%] Building C object CMakeFiles/freetype.dir/src/base/ftsystem.c.o
[ 56%] Building C object CMakeFiles/freetype.dir/src/base/fttrigon.c.o
[ 58%] Building C object CMakeFiles/freetype.dir/src/base/fttype1.c.o
[ 60%] Building C object CMakeFiles/freetype.dir/src/base/ftutil.c.o
[ 62%] Building C object CMakeFiles/freetype.dir/src/base/ftwinfnt.c.o
[ 64%] Building C object CMakeFiles/freetype.dir/src/bdf/bdf.c.o
[ 66%] Building C object CMakeFiles/freetype.dir/src/bzip2/ftbzip2.c.o
[ 67%] Building C object CMakeFiles/freetype.dir/src/cache/ftcache.c.o
[ 69%] Building C object CMakeFiles/freetype.dir/src/cff/cff.c.o
[ 71%] Building C object CMakeFiles/freetype.dir/src/cid/type1cid.c.o
[ 73%] Building C object CMakeFiles/freetype.dir/src/gzip/ftgzip.c.o
[ 75%] Building C object CMakeFiles/freetype.dir/src/lzw/ftlzw.c.o
[ 77%] Building C object CMakeFiles/freetype.dir/src/pcf/pcf.c.o
[ 79%] Building C object CMakeFiles/freetype.dir/src/pfr/pfr.c.o
[ 81%] Building C object CMakeFiles/freetype.dir/src/psaux/psaux.c.o
[ 83%] Building C object CMakeFiles/freetype.dir/src/pshinter/pshinter.c.o
[ 84%] Building C object CMakeFiles/freetype.dir/src/psnames/psmodule.c.o
[ 86%] Building C object CMakeFiles/freetype.dir/src/raster/raster.c.o
[ 88%] Building C object CMakeFiles/freetype.dir/src/sfnt/sfnt.c.o
[ 90%] Building C object CMakeFiles/freetype.dir/src/smooth/smooth.c.o
[ 92%] Building C object CMakeFiles/freetype.dir/src/truetype/truetype.c.o
[ 94%] Building C object CMakeFiles/freetype.dir/src/type1/type1.c.o
[ 96%] Building C object CMakeFiles/freetype.dir/src/type42/type42.c.o
[ 98%] Building C object CMakeFiles/freetype.dir/src/winfonts/winfnt.c.o
[100%] Linking C static library libfreetype.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfreetype.a(ftdbgmem.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libfreetype.a(ftdbgmem.c.o) has no symbols
[100%] Built target freetype
[ 16%] Performing install step for 'freetype-ext'
[100%] Built target freetype
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config/ftconfig.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config/ftheader.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config/ftmodule.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config/ftoption.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/config/ftstdlib.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/freetype.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ft2build.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftadvanc.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftautoh.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftbbox.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftbdf.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftbitmap.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftbzip2.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftcache.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftcffdrv.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftchapters.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftcid.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/fterrdef.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/fterrors.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftfntfmt.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftgasp.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftglyph.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftgxval.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftgzip.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftimage.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftincrem.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftlcdfil.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftlist.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftlzw.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftmac.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftmm.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftmodapi.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftmoderr.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftotval.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftoutln.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftpfr.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftrender.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftsizes.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftsnames.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftstroke.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftsynth.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftsystem.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/fttrigon.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftttdrv.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/fttypes.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ftwinfnt.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/t1tables.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ttnameid.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/tttables.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/tttags.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/include/freetype2/ttunpat.h
-- Installing: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/lib/libfreetype.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /Users/tmpvar/work/gfx/tmp/forge/third_party/freetype/lib/libfreetype.a(ftdbgmem.c.o) has no symbols
[ 19%] Completed 'freetype-ext'
[ 19%] Built target freetype-ext
Scanning dependencies of target forge
[ 21%] Building CXX object src/CMakeFiles/forge.dir/chart.cpp.o
[ 23%] Building CXX object src/CMakeFiles/forge.dir/colormap.cpp.o
[ 26%] Building CXX object src/CMakeFiles/forge.dir/common.cpp.o
[ 28%] Building CXX object src/CMakeFiles/forge.dir/err_common.cpp.o
[ 30%] Building CXX object src/CMakeFiles/forge.dir/exception.cpp.o
[ 33%] Building CXX object src/CMakeFiles/forge.dir/font.cpp.o
[ 35%] Building CXX object src/CMakeFiles/forge.dir/histogram.cpp.o
[ 38%] Building CXX object src/CMakeFiles/forge.dir/image.cpp.o
[ 40%] Building CXX object src/CMakeFiles/forge.dir/plot.cpp.o
[ 42%] Building CXX object src/CMakeFiles/forge.dir/plot3.cpp.o
[ 45%] Building CXX object src/CMakeFiles/forge.dir/surface.cpp.o
[ 47%] Building CXX object src/CMakeFiles/forge.dir/window.cpp.o
[ 50%] Building CXX object src/CMakeFiles/forge.dir/glfw/window.cpp.o
[ 52%] Linking CXX shared library libforge.dylib
[ 52%] Built target forge
Scanning dependencies of target example_fractal_cpu
[ 54%] Building CXX object examples/CMakeFiles/example_fractal_cpu.dir/cpu/fractal.cpp.o
[ 57%] Linking CXX executable cpu/fractal_cpu
[ 57%] Built target example_fractal_cpu
Scanning dependencies of target example_fractal_opencl
[ 59%] Building CXX object examples/CMakeFiles/example_fractal_opencl.dir/opencl/fractal.cpp.o
[ 61%] Linking CXX executable opencl/fractal_opencl
[ 61%] Built target example_fractal_opencl
Scanning dependencies of target example_histogram_cpu
[ 64%] Building CXX object examples/CMakeFiles/example_histogram_cpu.dir/cpu/histogram.cpp.o
[ 66%] Linking CXX executable cpu/histogram_cpu
[ 66%] Built target example_histogram_cpu
Scanning dependencies of target example_histogram_opencl
[ 69%] Building CXX object examples/CMakeFiles/example_histogram_opencl.dir/opencl/histogram.cpp.o
/Users/tmpvar/work/gfx/tmp/forge/examples/opencl/histogram.cpp:283:16: error: use of undeclared identifier 'fmod'
if(fmod(persistance, 0.5f) < 0.01)
^
1 error generated.
make[2]: *** [examples/CMakeFiles/example_histogram_opencl.dir/opencl/histogram.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/example_histogram_opencl.dir/all] Error 2
make: *** [all] Error 2
forge (master)‣ examples/opencl/surface_opencl
InfoLog:
WARNING: Output of vertex shader 'hpoint' not read by fragment shader
OpenGL Shader linking failed(2001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment