Code Monkey home page Code Monkey logo

graphene's People

Contributors

3v1n0 avatar achadwick avatar alexlarsson avatar doraskayo avatar ebassi avatar ericonr avatar fanc999-1 avatar georgesstavracas avatar lazka avatar lubosz avatar mdevlamynck avatar ml- avatar ndufresne avatar nekopsykose avatar nirbheek avatar q66 avatar ricotz avatar rossburton avatar sbstnk avatar seungha-yang avatar sidt4 avatar smcv avatar tingping avatar tp-m avatar tschoonj avatar vanvugt avatar vtorri avatar whitecl4ws avatar xclaesse avatar xry111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphene's Issues

Fails to build on Windows with mingw32

libtool: compile: i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../src -I../../src -I../../src -DG_LOG_DOMAIN="Graphene-Bench" -O3 -ffast-math -fstrict-aliasing -mms-bitfields -I/home/jenkins/workspace/cerbero-cross-mingw32/workdir/dist/windows_x86/include/glib-2.0 -I/home/jenkins/workspace/cerbero-cross-mingw32/workdir/dist/windows_x86/lib/glib-2.0/include -fvisibility=hidden -mms-bitfields -I/home/jenkins/workspace/cerbero-cross-mingw32/workdir/dist/windows_x86/include/glib-2.0 -I/home/jenkins/workspace/cerbero-cross-mingw32/workdir/dist/windows_x86/lib/glib-2.0/include -Wall -Wshadow -Wstrict-aliasing=2 -Wno-uninitialized -Wcast-align -Wstrict-prototypes -Werror=logical-op -Werror=pointer-arith -Werror=missing-declarations -Werror=redundant-decls -Werror=implicit-function-declaration -Werror=format=2 -Werror=missing-include-dirs -Werror=init-self -Werror=empty-body -Werror=declaration-after-statement -Wall -g -O2 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -g -MT libgraphene_bench_la-graphene-bench-utils.lo -MD -MP -MF .deps/libgraphene_bench_la-graphene-bench-utils.Tpo -c graphene-bench-utils.c -DDLL_EXPORT -DPIC -o .libs/libgraphene_bench_la-graphene-bench-utils.o
In file included from ../../src/graphene-config.h:36:0,
from ../../src/graphene-simd4f.h:37,
from ../../src/graphene-simd4x4f.h:27,
from matrix.c:15:
/home/jenkins/workspace/cerbero-cross-mingw32/workdir/mingw/w32/bin/../lib/gcc/i686-w64-mingw32/4.7.3/include/xmmintrin.h:32:3: error: #error "SSE instruction set not enabled"
In file included from ../../src/graphene-simd4f.h:37:0,
from ../../src/graphene-simd4x4f.h:27,
from matrix.c:15:
../../src/graphene-config.h:37:1: error: unknown type name '__m128'
In file included from ../../src/graphene-simd4x4f.h:27:0,
from matrix.c:15:
../../src/graphene-simd4f.h: In function 'graphene_simd4f_madd':

matrix_unproject_point3d requires an inverted modelview matrix

To fully invert from screen space to model space, the modelview matrix passed to graphene_matrix_unproject_point3d needs to be inverted. I believe that was attempted in e0c4e4c but reverted because it's a behaviour change by e0c4e4c. Instead the documentation should be updated to mention that the caller needs to pass the inverted modelview matrix.

Pacman doesn't seem to work...?

Hi, I followed your instructions for building on Windows, but no matter what I do, Pacman keeps firing timeouts at me. I don't have issues with my internet connection, as evidenced by the fact that I'm posting this question.

$ pacman -Sy
:: Synchronising package databases...
error: failed retrieving file 'mingw32.db' from 148.251.42.38 : Operation timed out after 0 milliseconds with 0 out of 0 bytes received
 mingw32                                                                 28.9 KiB  46.3K/s 00:04 [#######-------------------------------------------------]  13%

This happens with every file it tries to download. Is there any step I should have followed which was not listed in your instructions?

add vector/scalar multiplication operator

internally, it should be something in the form of:

res = graphene_simd4f_mul (vec, graphene_simd4f_splat (scalar));

but we need the graphene_vec[234]_t wrappers around it.

the name could be graphene_vec[234]_scale().

Inspiration with blend2d - highly optimized and CPU accelerated 2D library

There is a highly advanced project Blend2D dealing with graphical operations being computed on CPU, but focused on 2D. It might be a good source of inspiration or even source code (though it's C++) as it has no dependencies (not even standard library) and is basically the fastest possible library for 2D graphical operations. Graphene does not necessarily provide these operations, but rather a base for them, so this is just a pointer in case it should get extended or a new thin library on top of Graphene should get created.

https://blend2d.com/

Blend2D is also based on the awesome AsmJIT library from the same author.

Fix graphene_triangle_get_barycoords() for a point outside the triangle plane

graphene_triangle_get_barycoords() is based on this algo. From the description on that page:

 With that in mind we can now describe any point on the plane as
    P = A + u * (C - A) + v * (B - A)

-> "on the plane".

From the book that I read, there are three different algorithms described, with:

Although it is straightforward to solve Equation (2.32) algebraically, it is often fruitful to compute a direct geometric solution.

The algebraically equation being roughly the same as implemented in graphene currently.

One geometric solution is to compute the signed areas of the sub-triangles: A_a being the subtriangle PBC, A_b the subtriangle APC and A_c the subtriangle ABP, and A the area of the full triangle ABC. A_a + A_b + A_c = A if the point is in the same plane as the triangle. And the barycentric coordinates are A_b/A and A_c/A. Looks like a simple solution, at least on paper. (note that I've written this paragraph a bit quickly, it can contain some mistakes such as the order of the subtriangles vectors, since it matters for a signed area).

Error no such file or directory graphene-config.h

HI
I'm trying to use graphene for calculations in OpenGL program
I opened the NetBeans and i have typed #include<graphene-1.0/graphene.h>
then build
the following error appeared
/usr/local/include/graphene-1.0/graphene-types.h:31:29: fatal error: graphene-config.h: No such file or directory
I tried to add option to the linker like -lgraphene or -lgraphene-1.0 and still the error appears
could you help me please
thanks in advance

i586 build failure in combination with -Wl,--as-needed

While packaging graphene for openSUSE, the build bot is configured to build for i586, x86_64 and ppc64le (at this moment)

i586 fails with this log trail:

[   36s] [64/65] 'Generating Graphene-1.0.gir with a custom command.'
[   36s] FAILED: src/Graphene-1.0.gir 
[   36s] 'g-ir-scanner' '../src/graphene-box.h' '../src/graphene-euler.h' '../src/graphene-frustum.h' '../src/graphene-macros.h' '../src/graphene-matrix.h' '../src/graphene-plane.h' '../src/graphene-point.h' '../src/graphene-point3d.h' '../src/graphene-quad.h' '../src/graphene-quaternion.h' '../src/graphene-ray.h' '../src/graphene-rect.h' '../src/graphene-size.h' '../src/graphene-sphere.h' '../src/graphene-triangle.h' '../src/graphene-types.h' '../src/graphene-vec2.h' '../src/graphene-vec3.h' '../src/graphene-vec4.h' '../src/graphene-version-macros.h' '../src/graphene-gobject.h' '../src/graphene-alloc.c' '../src/graphene-box.c' '../src/graphene-euler.c' '../src/graphene-frustum.c' '../src/graphene-matrix.c' '../src/graphene-plane.c' '../src/graphene-point.c' '../src/graphene-point3d.c' '../src/graphene-quad.c' '../src/graphene-quaternion.c' '../src/graphene-ray.c' '../src/graphene-rect.c' '../src/graphene-size.c' '../src/graphene-sphere.c' '../src/graphene-triangle.c' '../src/graphene-vectors.c' '../src/graphene-gobject.c' '-pthread' '-I/usr/include/gobject-introspection-1.0' '-I/usr/include/glib-2.0' '-I/usr/lib/glib-2.0/include' '--no-libtool' '--namespace=Graphene' '--nsversion=1.0' '--warn-all' '--output' 'src/Graphene-1.0.gir' '--identifier-filter-cmd=/home/abuild/rpmbuild/BUILD/graphene-1.5.2/src/identfilter.py' '--c-include=graphene-gobject.h' '--accept-unprefixed' '-DGRAPHENE_COMPILATION' '--cflags-begin' '-I/home/abuild/rpmbuild/BUILD/graphene-1.5.2/src' '-I/home/abuild/rpmbuild/BUILD/graphene-1.5.2/build/src' '--cflags-end' '-I/home/abuild/rpmbuild/BUILD/graphene-1.5.2/src' '-I/home/abuild/rpmbuild/BUILD/graphene-1.5.2/build/src' '--include=GObject-2.0' '--symbol-prefix=graphene' '--identifier-prefix=Graphene' '--pkg-export=graphene-gobject-1.0' '-I/usr/include/glib-2.0' '-I/usr/lib/glib-2.0/include' '-L/home/abuild/rpmbuild/BUILD/graphene-1.5.2/build/src' '-lglib-2.0' '-lgobject-2.0' '-lm' '--library' 'graphene-1.0'
[   36s] ERROR: can't resolve libraries to shared libraries: m
[   36s] ninja: build stopped: subcommand failed.
[   36s] error: Bad exit status from /var/tmp/rpm-tmp.wyhjVm (%build)

Some digging revealed that the Graphene-1.0 binary (in tmp-introspectr(RANDOM)) that is being inspected by shlibs.py (part of g-ir-scanner) dropped 'libm' from the ldd output - the compiler mast have marked libm useless on this arch and thus dropped it.

But as '-lm' figures in the g-ir-scanner command line, g-ir-scanner attempts to resolve this to a real library name.

make check fails

on Mac OS X Yosemite with graphene 1.2.4:

ERROR: quaternion - missing test plan
ERROR: quaternion - exited with status 134 (terminated by signal 6?)

graphene_quaternion_to_angles: which convention is used?

Experienced behavior

quat = graphene_quaternion_init(quat, 0.7071, 0.7071, 0, 0 ); 
graphene_quaternion_to_angles (quat,  &yaw, &pitch, &chroll);

yields

yaw = 180 
pitch  = 0
roll = -90

Expected behaviour

If compared against https://github.com/matthew-brett/transforms3d

In [48]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='rzyx'))
Out[48]: array([  90.,   -0.,  180.])

In [49]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='szyx'))
Out[49]: array([ -90.,    0., -180.])

In [50]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='rxyz'))
Out[50]: array([-180.,    0.,  -90.])

In [51]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='sxyz'))
Out[51]: array([ 180.,   -0.,   90.])

In [52]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='szxy'))
Out[52]: array([  90.,   -0.,  180.])

In [53]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='rzxy'))
Out[53]: array([ -90.,    0., -180.])

In [54]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='ryxz'))
Out[54]: array([ 180.,   -0.,   90.])

In [55]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='syxz'))
Out[55]: array([-180.,    0.,  -90.])

In [56]: np.rad2deg(quat2euler([0,0.7071,0.7071,0],axes='szxy'))
Out[56]: array([  90.,   -0.,  180.])

one finds no triple with one of the angles being -90 and the other 180 degrees.
q[0] corresponts to graphene's q.w .

I am pretty sure about https://github.com/matthew-brett/transforms3d as I checked quat2euler(q,axes='rzyx') case before with quaternion and Yaw-Pitch-Roll output of my gyro.

Operating system in use

debian 8

SIMD implementation in use

SSE

Matrix multiplication order has changed

This commit has changed the order of the matrix multiplication
cecf4bc

This is the resulting GStreamer bug:
https://bugzilla.gnome.org/show_bug.cgi?id=733510

This change is not in the 0.99.2 release, but occurs on master.

I wrote a test for this issue:
lubosz@aa1fd65

NEW

left
1.00000 2.00000 3.00000 4.00000
5.00000 6.00000 7.00000 8.00000
9.00000 10.00000 11.00000 12.00000
13.00000 14.00000 15.00000 16.00000

right
16.00000 15.00000 14.00000 13.00000
12.00000 11.00000 10.00000 9.00000
8.00000 7.00000 6.00000 5.00000
4.00000 3.00000 2.00000 1.00000

left * right
80.00000 70.00000 60.00000 50.00000
240.00000 214.00000 188.00000 162.00000
400.00000 358.00000 316.00000 274.00000
560.00000 502.00000 444.00000 386.00000

right * left
386.00000 444.00000 502.00000 560.00000
274.00000 316.00000 358.00000 400.00000
162.00000 188.00000 214.00000 240.00000
50.00000 60.00000 70.00000 80.00000

OLD

1.00000 2.00000 3.00000 4.00000
5.00000 6.00000 7.00000 8.00000
9.00000 10.00000 11.00000 12.00000
13.00000 14.00000 15.00000 16.00000

right
16.00000 15.00000 14.00000 13.00000
12.00000 11.00000 10.00000 9.00000
8.00000 7.00000 6.00000 5.00000
4.00000 3.00000 2.00000 1.00000

left * right
386.00000 444.00000 502.00000 560.00000
274.00000 316.00000 358.00000 400.00000
162.00000 188.00000 214.00000 240.00000
50.00000 60.00000 70.00000 80.00000

right * left
80.00000 70.00000 60.00000 50.00000
240.00000 214.00000 188.00000 162.00000
400.00000 358.00000 316.00000 274.00000
560.00000 502.00000 444.00000 386.00000

According to Wolfram Alpha, the new order is correct.

http://www.wolframalpha.com/input/?i=%7B%7B1%2C2%2C3%2C4%7D%2C%7B5%2C6%2C7%2C8%7D%2C%7B9%2C10%2C11%2C12%7D%2C%7B13%2C14%2C15%2C16%7D%7D+*++%7B%7B16%2C15%2C14%2C13%7D%2C%7B12%2C11%2C10%2C9%7D%2C%7B8%2C7%2C6%2C5%7D%2C%7B4%2C3%2C2%2C1%7D%7D

Was this change intended?
Do you want to keep the new order or leave it like in the 0.99.2 release?

Meson build error

Experienced behavior

master@debian-master:~/graphene/_build$ meson ..
The Meson build system
Version: 0.21.0
Source dir: /home/master/graphene
Build dir: /home/master/graphene/_build
Build type: native build

Meson encountered an error in file meson.build, line 13, column 38:
Expecting eof got lbracket.

Expected behavior

Successful build with meson.

Steps to reproduce

$ git clone git://github.com/ebassi/graphene
$ cd graphene
$ mkdir _build && cd _build
$ meson ..

Operating system in use

master@debian-master:~/graphene/_build$ cat /etc/debian_version
8.4
master@debian-master:~/graphene/_build$ uname -a
Linux debian-master 3.8-1-xenomai.x86-amd64 #1 SMP Debian 3.8.13-12~1jessie~1da x86_64 GNU/Linux
master@debian-master:~/graphene/_build$ dpkg -l | grep  meson
ii  meson                                  0.21.0-1                                          all          high-productivity build system

msys2: fails to build: FAILED: src/Graphene-1.0.gir

Experienced behavior

With #87 applied, the build fails during introspection scanning:

$ ninja
[...]
"g-ir-scanner" "../src/graphene-box.h" "../src/graphene-euler.h" "../src/graphene-frustum.h" "../src/graphene-macros.h" "../src/graphene-matrix.h" "../src/graphene-plane.h" "../src/graphene-point.h" "../src/graphene-point3d.h" "../src/graphene-quad.h" "../src/graphene-quaternion.h" "../src/graphene-ray.h" "../src/graphene-rect.h" "../src/graphene-size.h" "../src/graphene-sphere.h" "../src/graphene-triangle.h" "../src/graphene-types.h" "../src/graphene-vec2.h" "../src/graphene-vec3.h" "../src/graphene-vec4.h" "../src/graphene-version-macros.h" "../src/graphene-gobject.h" "../src/graphene-alloc.c" "../src/graphene-box.c" "../src/graphene-euler.c" "../src/graphene-frustum.c" "../src/graphene-matrix.c" "../src/graphene-plane.c" "../src/graphene-point.c" "../src/graphene-point3d.c" "../src/graphene-quad.c" "../src/graphene-quaternion.c" "../src/graphene-ray.c" "../src/graphene-rect.c" "../src/graphene-size.c" "../src/graphene-sphere.c" "../src/graphene-triangle.c" "../src/graphene-vectors.c" "../src/graphene-gobject.c" "-pthread" "-mms-bitfields" "-IC:/msys64/mingw64/include/gobject-introspection-1.0" "-IC:/msys64/mingw64/lib/libffi-3.2.1/include" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mingw64/include" "--no-libtool" "--namespace=Graphene" "--nsversion=1.0" "--warn-all" "--output" "src/Graphene-1.0.gir" "--identifier-filter-cmd=C:/msys64/usr/src/graphene/src/identfilter.py" "--c-include=graphene-gobject.h" "--accept-unprefixed" "-DGRAPHENE_COMPILATION" "-IC:/msys64/usr/src/graphene/src" "-IC:/msys64/usr/src/graphene/_build/src" "--include=GObject-2.0" "--symbol-prefix=graphene" "--identifier-prefix=Graphene" "--pkg-export=graphene-gobject-1.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-IC:/msys64/mingw64/include" "-mms-bitfields" "-IC:/msys64/mingw64/include/glib-2.0" "-LC:/msys64/usr/src/graphene/_build/src" "-lintl" "-lm" "-LC:/msys64/mingw64/lib" "-lglib-2.0" "-lgobject-2.0" "--library" "graphene-1.0"
CreateProcess failed: The system cannot find the file specified.
ninja: fatal: GetOverlappedResult: The handle is invalid.

$ which g-ir-scanner
/mingw64/bin/g-ir-scanner

$ pacman -Qo /mingw64/bin/g-ir-scanner
/mingw64/bin/g-ir-scanner is owned by mingw-w64-x86_64-gobject-introspection 1.50.0-2

Expected behavior

The build should progress beyond this line.

Steps to reproduce

$ mkdir _build
$ cd _build
$ meson.py ..
$ ninja

Operating system in use

Windows 7 Enterprise SP1.

SIMD implementation in use

Not sure.

No aligned malloc implementation on MinGW

When building on Windows with MinGW, there's no available aligned malloc implementation:

configure:

checking for aligned_alloc... no
checking for posix_memalign... no
checking for memalign... no

meson:

Checking for function "aligned_alloc": NO
Checking for function "memalign": NO
Checking for function "posix_memalign": NO

This means that alloc_align() in src/bench/matrix.c ends up returning an uninitialized pointer. The implementation needs to be like this to actually show the bug at compile-time:

diff --git a/src/bench/matrix.c b/src/bench/matrix.c
index 2621243..d2d6a0a 100644
--- a/src/bench/matrix.c
+++ b/src/bench/matrix.c
@@ -58,6 +58,8 @@ alloc_align (gsize n,
   res = aligned_alloc (alignment, real_size);
 #elif defined(HAVE_MEMALIGN)
   res = memalign (alignment, real_size);
+#else
+#error "Need some type of aligned allocation function"
 #endif

   g_assert (res != NULL);

I noticed this because of this warning:

[40/61] Compiling c object src/bench/matrix-scalar@exe/matrix.c.obj
../src/bench/matrix.c: In function 'alloc_align':
../src/bench/matrix.c:50:9: warning: unused variable 'real_size' [-Wunused-variable]
../src/bench/matrix.c:63:3: warning: 'res' is used uninitialized in this function [-Wuninitialized]

Maybe graphene should be built with werror=true in meson.build:project() so that -Werror is enabled, or perhaps that option can be enabled with a version check inside meson.build.

segfault in graphene_matrix_interpolate() with clang and scalar SIMD4f

when running the scalar implementations of the graphene_simd4f_t type, we get a segmentation fault inside graphene_matrix_interpolate() when calculating the linear interpolation of the two perspective vec4.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7df0ebb in graphene_matrix_interpolate (a=<optimized out>, b=<optimized out>, factor=<optimized out>, 
    res=0x7fffffffded8) at graphene-matrix.c:997
997   res->value.w = graphene_simd4f_interpolate (perspective_a.value,
(gdb) print res
$1 = (graphene_matrix_t *) 0x7fffffffded8
(gdb) print res->value
$2 = {x = {5.88428767e-39, 0, -nan(0x7fdf68), 4.59163468e-41}, y = {-2.38550409e+21, 6.72623263e-44, 0, 0}, z = {
    7.00649232e-44, 0, 8.83997365e-39, 0}, w = {5.88777971e-39, 0, 5.88867373e-39, 0}}
(gdb) print res->value.w
$3 = {5.88777971e-39, 0, 5.88867373e-39, 0}
(gdb) print perspective_a
$4 = {value = {0, 0, 0, 1}}
(gdb) print perspective_b
$5 = {value = {0, 0, 0, 1}}

the issue goes away when compiling graphene with -O0; any other optimization causes a segmentation fault.

vapigen produces invalid code

This is either a bug in vapigen or in graphene's GIRs.

I ran vapigen on the graphene gir and all the res arguments had out unowned modifiers on them. This causes vala to attempt to double-redirect for them, which is wrong.

use degrees instead of radians in matrix rotation

no need to make things more complicated than they need to be.

the underlying graphene_simd4x4f_rotation() function can keep using radians, but the convenience API for graphene_matrix_t needs to be converted to degrees.

graphene_rect_union(): schema and implementation mismatch

I see that you've added schemas, that's nice.

But for graphene_rect_union(), the implementation doesn't do what the schema shows:

res->origin.x = MIN (ra.origin.x, rb.origin.x);
res->origin.y = MIN (ra.origin.y, rb.origin.y);

res->size.width = MAX (ra.size.width, rb.size.width);
res->size.height = MAX (ra.size.height, rb.size.height);

In other words, the schema shows the bounding rectangle, but the union() function does something else. That's why I said in the other bug that rectangle union was a strange operation to me.

Allocation problems in Python

What are graphene's plans for gobject introspection? Will it be still supported, despite the "de-glib-ify" branch?

I would like to use graphene in Pitivi for OpenGL, as I suppose many other Python users would find very useful.

These issues need likely to be reported to gobject-introspection or python-gobject, I will collect them here to have an overview though.

Examples

Segmentation fault on print_()

This snipped crashes on the last print statement.

#!/usr/bin/env python3

from gi.repository import Graphene

mat = Graphene.Matrix()
mat.alloc()
mat.print_()
mat.init_identity()
mat.print_()

Backtrace

#0  0x00007ffff5cb8890 in g_slist_length () at /usr/lib/libglib-2.0.so.0
#1  0x00007ffff6657721 in  () at /usr/lib/python3.4/site-packages/gi/_gi.cpython-34m.so
#2  0x00007ffff664d49e in  () at /usr/lib/python3.4/site-packages/gi/_gi.cpython-34m.so
#3  0x00007ffff79a8e68 in PyObject_Call (func=func@entry=0x7ffff4722810, arg=arg@entry=0x7ffff7fba048, kw=kw@entry=0x0) at Objects/abstract.c:2067
#4  0x00007ffff7a58e49 in PyEval_EvalFrameEx (nk=<optimized out>, na=0, pp_stack=0x7fffffffe070, func=<optimized out>) at Python/ceval.c:4456
#5  0x00007ffff7a58e49 in PyEval_EvalFrameEx (oparg=<optimized out>, pp_stack=0x7fffffffe070)
    at Python/ceval.c:4254
#6  0x00007ffff7a58e49 in PyEval_EvalFrameEx (f=0x7ffff6c13438, throwflag=<optimized out>)
    at Python/ceval.c:2829
#7  0x00007ffff7a5f289 in PyEval_EvalCodeEx (_co=0x3f800000, 
    _co@entry=0x7ffff6bd5390, globals=0x0, locals=0x7ffff6c135b0, args=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3578
#8  0x00007ffff7a5f32b in PyEval_EvalCode (co=co@entry=0x7ffff6bd5390, globals=globals@entry=0x7ffff6c11408, locals=locals@entry=0x7ffff6c11408) at Python/ceval.c:773
#9  0x00007ffff7a7b4d4 in run_mod (mod=mod@entry=0x6f5c40, filename=filename@entry=0x7ffff6b111f0, globals=globals@entry=0x7ffff6c11408, locals=locals@entry=0x7ffff6c11408, flags=flags@entry=0x7fffffffe2f0, arena=arena@entry=0x6e0450) at Python/pythonrun.c:2180
#10 0x00007ffff7a7d705 in PyRun_FileExFlags (fp=0x6e0210, filename_str=<optimized out>, start=<optimized out>, globals=0x7ffff6c11408, locals=0x7ffff6c11408, closeit=1, flags=0x7fffffffe2f0)
    at Python/pythonrun.c:2133
#11 0x00007ffff7a7e6d3 in PyRun_SimpleFileExFlags (fp=0x3f800000, filename=0x7ffff6c08740 "./bug.py", closeit=1, flags=0x0) at Python/pythonrun.c:1606
#12 0x00007ffff7a948bc in Py_Main (p_cf=<optimized out>, filename=<optimized out>, fp=<optimized out>)
    at Modules/main.c:319
#13 0x00007ffff7a948bc in Py_Main (argc=-156168016, argv=0x7ffff6c08720) at Modules/main.c:751
#14 0x0000000000400af6 in main ()

Uninitialized Memory on init_identity()

Two values of the matrix are not initialized properly. This happens when the calls happen on the same object and not on the return value.

#!/usr/bin/env python3

from gi.repository import Graphene

mat = Graphene.Matrix()
mat.alloc()
mat.init_identity()

# same result when initialized like this
# mat = Graphene.Matrix()
# Graphene.Matrix.init_identity(mat)

mat.print_()

foo = mat.to_float()

print(foo)

Output

1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 0.00000
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.9769944729427674e-38, 0.0, 2.2420775429197073e-44, 0.0]

Segfault on to_float()

Here we get correctly initialized values, because the operations are done on the return values, rather than in place. It segfaults when calling to_float() though. The print_() and get_value() functions work thought.

#!/usr/bin/env python3

from gi.repository import Graphene

mat = Graphene.Matrix()
mat2 = mat.alloc()
mat3 = mat2.init_identity()

mat.print_()
print("#")
mat2.print_()
print("#")
mat3.print_()

foo = mat3.to_float()

Output

0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
#
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
#
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000
Segmentation fault

Backtrace

#0  0x00007ffff5cb7055 in g_slice_alloc () at /usr/lib/libglib-2.0.so.0
#1  0x00007ffff5c6f825 in g_array_sized_new () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff665b20a in  () at /usr/lib/python3.4/site-packages/gi/_gi.cpython-34m.so
#3  0x00007ffff66580eb in  () at /usr/lib/python3.4/site-packages/gi/_gi.cpython-34m.so
#4  0x00007ffff664d49e in  () at /usr/lib/python3.4/site-packages/gi/_gi.cpython-34m.so
#5  0x00007ffff79a8e68 in PyObject_Call (func=func@entry=0x7ffff471e880, arg=arg@entry=0x7ffff7fba048, kw=kw@entry=0x0) at Objects/abstract.c:2067
#6  0x00007ffff7a58e49 in PyEval_EvalFrameEx (nk=<optimized out>, na=0, pp_stack=0x7fffffffe070, func=<optimized out>) at Python/ceval.c:4456
#7  0x00007ffff7a58e49 in PyEval_EvalFrameEx (oparg=<optimized out>, pp_stack=0x7fffffffe070) at Python/ceval.c:4254
#8  0x00007ffff7a58e49 in PyEval_EvalFrameEx (f=0x7ffff6c13438, throwflag=<optimized out>) at Python/ceval.c:2829
#9  0x00007ffff7a5f289 in PyEval_EvalCodeEx (_co=0x20, 
    _co@entry=0x7ffff6bd5390, globals=0x0, locals=0x7ffff6c135b0, args=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3578
#10 0x00007ffff7a5f32b in PyEval_EvalCode (co=co@entry=0x7ffff6bd5390, globals=globals@entry=0x7ffff6c11408, locals=locals@entry=0x7ffff6c11408) at Python/ceval.c:773
#11 0x00007ffff7a7b4d4 in run_mod (mod=mod@entry=0x6f6470, filename=filename@entry=0x7ffff6b111f0, globals=globals@entry=0x7ffff6c11408, locals=locals@entry=0x7ffff6c11408, flags=flags@entry=0x7fffffffe2f0, arena=arena@entry=0x677610) at Python/pythonrun.c:2180
#12 0x00007ffff7a7d705 in PyRun_FileExFlags (fp=0x6773d0, filename_str=<optimized out>, start=<optimized out>, globals=0x7ffff6c11408, locals=0x7ffff6c11408, closeit=1, flags=0x7fffffffe2f0)
    at Python/pythonrun.c:2133
#13 0x00007ffff7a7e6d3 in PyRun_SimpleFileExFlags (fp=0x20, filename=0x7ffff6c08740 "./bug.py", closeit=1, flags=0x7dd4c0) at Python/pythonrun.c:1606
#14 0x00007ffff7a948bc in Py_Main (p_cf=<optimized out>, filename=<optimized out>, fp=<optimized out>) at Modules/main.c:319
#15 0x00007ffff7a948bc in Py_Main (argc=-156168016, argv=0x7ffff6c08720) at Modules/main.c:751
#16 0x0000000000400af6 in main ()

JavaScript to_float()

In JavaScript the initialization seems to work correctly, but the runtime does not allow to call to_float at all.

#!/usr/bin/env gjs

const Graphene = imports.gi.Graphene;

let mat = new Graphene.Matrix();
mat.alloc();
mat.init_identity();
mat.print();

let foo = mat.to_float();

Output

1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
0.00000 0.00000 0.00000 1.00000

(gjs:3095): Gjs-WARNING **: JS ERROR: Error: Unsupported type array for (out caller-allocates)
@./bug.js:11

JS_EvaluateScript() failed

g-ir-compiler failure

on Mac OS X Yosemite with graphene 1.2.4. There are also a lot of warnings.

graphene-vec3.h:50: Warning: Graphene: graphene_vec3_alloc: Constructors must return an instance of their class
graphene-box.h:52: Warning: Graphene: graphene_box_alloc: Constructors must return an instance of their class
graphene-euler.h:82: Warning: Graphene: graphene_euler_alloc: Constructors must return an instance of their class
graphene-plane.h:54: Warning: Graphene: graphene_plane_alloc: Constructors must return an instance of their class
graphene-frustum.h:53: Warning: Graphene: graphene_frustum_alloc: Constructors must return an instance of their class
graphene-matrix.h:46: Warning: Graphene: graphene_matrix_alloc: Constructors must return an instance of their class
graphene-point.h:76: Warning: Graphene: graphene_point_alloc: Constructors must return an instance of their class
graphene-point.h:152: Warning: Graphene: graphene_size_alloc: Constructors must return an instance of their class
graphene-point3d.h:74: Warning: Graphene: graphene_point3d_alloc: Constructors must return an instance of their class
graphene-quad.h:49: Warning: Graphene: graphene_quad_alloc: Constructors must return an instance of their class
graphene-vec4.h:50: Warning: Graphene: graphene_vec4_alloc: Constructors must return an instance of their class
graphene-quaternion.h:56: Warning: Graphene: graphene_quaternion_alloc: Constructors must return an instance of their class
graphene-sphere.h:51: Warning: Graphene: graphene_sphere_alloc: Constructors must return an instance of their class
graphene-vec2.h:50: Warning: Graphene: graphene_vec2_alloc: Constructors must return an instance of their class
graphene-triangle.h:52: Warning: Graphene: graphene_triangle_alloc: Constructors must return an instance of their class
graphene-vectors.c:615: Warning: Graphene: graphene_vec3_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-box.c:60: Warning: Graphene: graphene_box_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-euler.c:60: Warning: Graphene: graphene_euler_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-plane.c:50: Warning: Graphene: graphene_plane_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-frustum.c:55: Warning: Graphene: graphene_frustum_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-matrix.c:73: Warning: Graphene: graphene_matrix_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-point.c:66: Warning: Graphene: graphene_point_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-size.c:45: Warning: Graphene: graphene_size_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-point3d.c:49: Warning: Graphene: graphene_point3d_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-quad.c:46: Warning: Graphene: graphene_quad_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-vectors.c:1311: Warning: Graphene: graphene_vec4_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-quaternion.c:58: Warning: Graphene: graphene_quaternion_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-rect.c:78: Warning: Graphene: graphene_rect_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-sphere.c:50: Warning: Graphene: graphene_sphere_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-vectors.c:63: Warning: Graphene: graphene_vec2_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-triangle.c:52: Warning: Graphene: graphene_triangle_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-rect.c:78: Warning: Graphene: graphene_rect_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-size.c:45: Warning: Graphene: graphene_size_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-plane.c:50: Warning: Graphene: graphene_plane_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-quaternion.c:58: Warning: Graphene: graphene_quaternion_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-vectors.c:63: Warning: Graphene: graphene_vec2_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-vectors.c:615: Warning: Graphene: graphene_vec3_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-vectors.c:1311: Warning: Graphene: graphene_vec4_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-sphere.c:50: Warning: Graphene: graphene_sphere_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-triangle.c:52: Warning: Graphene: graphene_triangle_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-frustum.c:55: Warning: Graphene: graphene_frustum_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-point.c:66: Warning: Graphene: graphene_point_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-euler.c:60: Warning: Graphene: graphene_euler_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-point3d.c:49: Warning: Graphene: graphene_point3d_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-quad.c:46: Warning: Graphene: graphene_quad_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-box.c:60: Warning: Graphene: graphene_box_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
graphene-matrix.c:73: Warning: Graphene: graphene_matrix_alloc: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
/usr/local/Cellar/gobject-introspection/1.44.0/bin/g-ir-compiler  --includedir=. Graphene-1.0.gir -o Graphene-1.0.typelib
Graphene-1.0.gir:-1: In Box .contains_box.a.: error: type reference 'ugrapheneuboxut' not found

generate introspection data

even if Graphene is not strictly speaking a GObject library, we should generate introspection data from the GTypes we expose.

right now, we depend on https://bugzilla.gnome.org/show_bug.cgi?id=706898 to land inside the gobject introspection scanner, otherwise it'll croak on our type naming convention.

after that bit lands, the generation is pretty straightforward. see the introspection branch.

Error building with JHBuild

I am using JHBuild to build GNOME - jhbuild build, but it only works if it is new clean build or I choose option Go to phase "wipe directory and start over"

If I want update existing modules with latest changes it always fails with error:

*** Building graphene *** [39/196]
make -j 9
CDPATH="${ZSH_VERSION+.}:" && cd . && -I build/autotools
/bin/bash: -I: command not found
Makefile:431: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127

Graphene-1.0.gir compilation error in mingw

Probably win32 specific, here is g-ir-scaner output:

Making install in src
make[1]: Entering directory `/d/Sources/graphene-1.0.0/src'
make  install-recursive
make[2]: Entering directory `/d/Sources/graphene-1.0.0/src'
Making install in .
make[3]: Entering directory `/d/Sources/graphene-1.0.0/src'
C:/msys/rtvc10-32/bin/g-ir-scanner   --namespace=Graphene --nsversion=1.0 --libtool="../libtool" --pkg=gobject-2.0 --include=GObject-2.0   --library=libgraphene-1.0.la --identifier-filter-cmd="/usr/bin/sed -e 's|\(.*\)_t\b|\1|' -e 's|^\([a-z]\)|\u\1|' -e 's|_\([a-z]\)|\u\1|g' -e 's|\([0-9]\)\([a-z]\)|\1\u\2|g'" --accept-unprefixed --symbol-prefix=graphene --c-include="graphene-object.h" --warn-all --verbose --pkg-export graphene-gobject-1.0 --cflags-begin -DGRAPHENE_COMPILATION -I../src -I../src --cflags-end  graphene-macros.h graphene-matrix.h graphene-point.h graphene-point3d.h graphene-quad.h graphene-quaternion.h graphene-rect.h graphene-vec2.h graphene-vec3.h graphene-vec4.h graphene-types.h graphene-version-macros.h graphene-gobject.h graphene-alloc.c graphene-matrix.c graphene-point.c graphene-point3d.c graphene-quad.c graphene-quaternion.c graphene-rect.c graphene-size.c graphene-vectors.c graphene-gobject.c libgraphene-1.0.la Makefile --output Graphene-1.0.gir
c:\msys\mingw-w64\lib\gcc\i686-w64-mingw32\4.7.3\include\xmmintrin.h:92: syntax error, unexpected '{' in '  return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f };
' at '{'
c:\msys\mingw-w64\lib\gcc\i686-w64-mingw32\4.7.3\include\xmmintrin.h:859: syntax error, unexpected '{' in '  return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f };
' at '{'
c:\msys\mingw-w64\lib\gcc\i686-w64-mingw32\4.7.3\include\xmmintrin.h:866: syntax error, unexpected '{' in '  return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F };
' at '{'
c:\msys\mingw-w64\lib\gcc\i686-w64-mingw32\4.7.3\include\xmmintrin.h:921: syntax error, unexpected '{' in '  return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z };
' at '{'
c:\msys\mingw-w64\lib\gcc\i686-w64-mingw32\4.7.3\include\xmmintrin.h:928: syntax error, unexpected '{' in '  return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W };
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:109: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_matrix_is_identity (const graphene_matrix_t *m);
' at 'graphene_matrix_is_identity'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:109: syntax error, unexpected ')', expecting ',' or ';' in 'bool graphene_matrix_is_identity (const graphene_matrix_t *m);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:111: syntax error, unexpected ')', expecting ',' or ';' in 'bool graphene_matrix_is_2d (const graphene_matrix_t *m);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:113: syntax error, unexpected ')', expecting ',' or ';' in 'bool graphene_matrix_is_backface_visible (const graphene_matrix_t *m);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:115: syntax error, unexpected ')', expecting ',' or ';' in 'bool graphene_matrix_is_singular (const graphene_matrix_t *m);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:121: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_matrix_to_2d (const graphene_matrix_t *m,
' at 'graphene_matrix_to_2d'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:122: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *xx,
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:123: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *yx,
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:124: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *xy,
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:125: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *yy,
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:126: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *x_0,
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:127: syntax error, unexpected DOUBLE, expecting identifier or '(' or '*' in '                                                                 double *y_0);
' at 'double'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:127: syntax error, unexpected ')', expecting ',' or ';' in '                                                                 double *y_0);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:176: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_matrix_untransform_point (const graphene_matrix_t *m,
' at 'graphene_matrix_untransform_point'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:177: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                 const graphene_point_t *p,
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:178: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                 const graphene_rect_t *bounds,
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:179: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in '                                                                 graphene_point_t *res);
' at 'graphene_point_t'
d:\Sources\graphene-1.0.0\src\graphene-matrix.h:179: syntax error, unexpected ')', expecting ',' or ';' in '                                                                 graphene_point_t *res);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-point.h:88: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_point_equal (const graphene_point_t *a,
' at 'graphene_point_equal'
d:\Sources\graphene-1.0.0\src\graphene-point.h:89: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                 const graphene_point_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-point.h:89: syntax error, unexpected ')', expecting ',' or ';' in '                                                                 const graphene_point_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-point.h:98: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_point_near (const graphene_point_t *a,
' at 'graphene_point_near'
d:\Sources\graphene-1.0.0\src\graphene-point.h:99: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                 const graphene_point_t *b,
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-point.h:100: syntax error, unexpected FLOAT, expecting identifier or '(' or '*' in '                                                                 float epsilon);
' at 'float'
d:\Sources\graphene-1.0.0\src\graphene-point.h:163: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_size_equal (const graphene_size_t *a,
' at 'graphene_size_equal'
d:\Sources\graphene-1.0.0\src\graphene-point.h:164: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                 const graphene_size_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-point.h:164: syntax error, unexpected ')', expecting ',' or ';' in '                                                                 const graphene_size_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-point3d.h:94: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_point3d_equal (const graphene_point3d_t *a,
' at 'graphene_point3d_equal'
d:\Sources\graphene-1.0.0\src\graphene-point3d.h:95: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                         const graphene_point3d_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-point3d.h:95: syntax error, unexpected ')', expecting ',' or ';' in '                                                                         const graphene_point3d_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-point3d.h:98: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                         const graphene_point3d_t *b,
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-point3d.h:99: syntax error, unexpected FLOAT, expecting identifier or '(' or '*' in '                                                                         float epsilon);
' at 'float'
d:\Sources\graphene-1.0.0\src\graphene-quad.h:64: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_quad_contains (const graphene_quad_t *q,
' at 'graphene_quad_contains'
d:\Sources\graphene-1.0.0\src\graphene-quad.h:65: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_point_t *p);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-quad.h:65: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_point_t *p);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-quaternion.h:99: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_quaternion_equal (const graphene_quaternion_t *a,
' at 'graphene_quaternion_equal'
d:\Sources\graphene-1.0.0\src\graphene-quaternion.h:100: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                                         const graphene_quaternion_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-quaternion.h:100: syntax error, unexpected ')', expecting ',' or ';' in '                                                                         const graphene_quaternion_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:91: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_rect_equal (const graphene_rect_t *a,
' at 'graphene_rect_equal'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:92: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_rect_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:92: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_rect_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:124: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_rect_intersection (const graphene_rect_t *a,
' at 'graphene_rect_intersection'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:125: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_rect_t *b,
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:126: syntax error, unexpected typedef-name, expecting identifier or '(' or '*' in '                                                         graphene_rect_t *res);
' at 'graphene_rect_t'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:126: syntax error, unexpected ')', expecting ',' or ';' in '                                                         graphene_rect_t *res);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:129: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_point_t *p);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:129: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_point_t *p);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:132: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_rect_t *b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-rect.h:132: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_rect_t *b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:146: syntax error, unexpected identifier, expecting ',' or ';' in 'bool graphene_simd4f_cmp_eq (const graphene_simd4f_t a,
' at 'graphene_simd4f_cmp_eq'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:147: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_simd4f_t b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:147: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_simd4f_t b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:150: syntax error, unexpected CONST, expecting identifier or '(' or '*' in '                                                         const graphene_simd4f_t b);
' at 'const'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:150: syntax error, unexpected ')', expecting ',' or ';' in '                                                         const graphene_simd4f_t b);
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1255: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot4 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot4 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1255: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot4 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot4 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1255: syntax error, unexpected '(' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot4 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot4 (v, v))), (__s)); })))); })))); })))); })); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1273: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot3 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot3 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1273: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot3 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot3 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1273: syntax error, unexpected '(' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot3 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot3 (v, v))), (__s)); })))); })))); })))); })); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1291: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot2 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot2 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1291: syntax error, unexpected '{' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot2 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot2 (v, v))), (__s)); })))); })))); })))); })); }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1291: syntax error, unexpected '(' in '  graphene_simd4f_t invlen = (__extension__ ({ const graphene_simd4f_t __half = (__extension__ ({ (graphene_simd4f_t) { (0.5f), (0.5f), (0.5f), (0.5f) }; })); const graphene_simd4f_t __three = (__extension__ ({ (graphene_simd4f_t) { (3.0f), (3.0f), (3.0f), (3.0f) }; })); graphene_simd4f_t __s = _mm_rsqrt_ps ((graphene_simd4f_dot2 (v, v))); (__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), (__half)); }))), ((__extension__ ({ (graphene_simd4f_t) _mm_sub_ps ((__three), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps ((__s), ((__extension__ ({ (graphene_simd4f_t) _mm_mul_ps (((graphene_simd4f_dot2 (v, v))), (__s)); })))); })))); })))); })); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1307: syntax error, unexpected identifier, expecting ',' or ';' in 'graphene_simd4f_is_zero4 (const graphene_simd4f_t v)
' at 'graphene_simd4f_is_zero4'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1307: syntax error, unexpected ')', expecting ',' or ';' in 'graphene_simd4f_is_zero4 (const graphene_simd4f_t v)
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1310: syntax error, unexpected RETURN in '  return (__extension__ ({ __m128i __res = (__m128i) _mm_cmpeq_ps ((v), (zero)); (bool) (_mm_movemask_epi8 (__res) == 0xffff); }));
' at 'return'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1325: syntax error, unexpected identifier, expecting ',' or ';' in 'graphene_simd4f_is_zero3 (const graphene_simd4f_t v)
' at 'graphene_simd4f_is_zero3'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1325: syntax error, unexpected ')', expecting ',' or ';' in 'graphene_simd4f_is_zero3 (const graphene_simd4f_t v)
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1327: syntax error, unexpected identifier in '  return (__extension__ ({ graphene_simd4f_union_t __u = { (v) }; __u.f[0]; })) == 0.f &&
' at '__u'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1328: syntax error, unexpected identifier in '         (__extension__ ({ graphene_simd4f_union_t __u = { (v) }; __u.f[1]; })) == 0.f &&
' at '__u'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1329: syntax error, unexpected identifier in '         (__extension__ ({ graphene_simd4f_union_t __u = { (v) }; __u.f[2]; })) == 0.f;
' at '__u'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1344: syntax error, unexpected identifier, expecting ',' or ';' in 'graphene_simd4f_is_zero2 (const graphene_simd4f_t v)
' at 'graphene_simd4f_is_zero2'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1344: syntax error, unexpected ')', expecting ',' or ';' in 'graphene_simd4f_is_zero2 (const graphene_simd4f_t v)
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1346: syntax error, unexpected identifier in '  return (__extension__ ({ graphene_simd4f_union_t __u = { (v) }; __u.f[0]; })) == 0.f &&
' at '__u'
d:\Sources\graphene-1.0.0\src\graphene-simd4f.h:1347: syntax error, unexpected identifier in '         (__extension__ ({ graphene_simd4f_union_t __u = { (v) }; __u.f[1]; })) == 0.f;
' at '__u'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:91: syntax error, unexpected '{' in '  *m = graphene_simd4x4f_init ((__extension__ ({ (graphene_simd4f_t) { (1.0f), (0.0f), (0.0f), (0.0f) }; })),
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:310: syntax error, unexpected '{' in '  transpose.w = (__extension__ ({ (graphene_simd4f_t) { (0.f), (0.f), (0.f), (0.f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:311: syntax error, unexpected '(' in '  (__extension__ ({ do { __v4sf __r0 = ((&transpose)->x), __r1 = ((&transpose)->y), __r2 = ((&transpose)->z), __r3 = ((&transpose)->w); __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); ((&transpose)->x) = __builtin_ia32_movlhps (__t0, __t1); ((&transpose)->y) = __builtin_ia32_movhlps (__t1, __t0); ((&transpose)->z) = __builtin_ia32_movlhps (__t2, __t3); ((&transpose)->w) = __builtin_ia32_movhlps (__t3, __t2); } while (0); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:339: syntax error, unexpected '{' in '  transpose.w = (__extension__ ({ (graphene_simd4f_t) { (0.f), (0.f), (0.f), (0.f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:340: syntax error, unexpected '(' in '  (__extension__ ({ do { __v4sf __r0 = ((&transpose)->x), __r1 = ((&transpose)->y), __r2 = ((&transpose)->z), __r3 = ((&transpose)->w); __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); ((&transpose)->x) = __builtin_ia32_movlhps (__t0, __t1); ((&transpose)->y) = __builtin_ia32_movhlps (__t1, __t0); ((&transpose)->z) = __builtin_ia32_movlhps (__t2, __t3); ((&transpose)->w) = __builtin_ia32_movhlps (__t3, __t2); } while (0); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:444: syntax error, unexpected '{' in '  m->x = (__extension__ ({ (graphene_simd4f_t) { (a), (0.0f), (0.0f), (0.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:484: syntax error, unexpected '{' in '  m->x = (__extension__ ({ (graphene_simd4f_t) { (a), (0.0f), (0.0f), (0.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:524: syntax error, unexpected '{' in '  m->w = (__extension__ ({ (graphene_simd4f_t) { (0.0f), (0.0f), (0.0f), (1.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:526: syntax error, unexpected '(' in '  (__extension__ ({ do { __v4sf __r0 = ((m)->x), __r1graphene-types.h:76:
graphene-types.h:65:
graphene-vec3.h:47:
graphene-matrix.h:43: Fatal: Graphene: Namespace conflict for ''
graphene-matrix.h:43: Fatal: Graphene: Namespace conflict for ''

 = ((m)->y), __r2 = ((m)->z), __r3 = ((m)->w); __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); ((m)->x) = __builtin_ia32_movlhps (__t0, __t1); ((m)->y) = __builtin_ia32_movhlps (__t1, __t0); ((m)->z) = __builtin_ia32_movlhps (__t2, __t3); ((m)->w) = __builtin_ia32_movhlps (__t3, __t2); } while (0); }));
' at '('
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:601: syntax error, unexpected '{' in '  *m = graphene_simd4x4f_init ((__extension__ ({ (graphene_simd4f_t) { (1.0f), (0.0f), (0.0f), (0.0f) }; })),
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:625: syntax error, unexpected '{' in '  *m = graphene_simd4x4f_init ((__extension__ ({ (graphene_simd4f_t) { (x), (0.0f), (0.0f), (0.0f) }; })),
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:672: syntax error, unexpected '{' in '  i = (__extension__ ({ (graphene_simd4f_t) { (tx + cosine * (1.0f - tx)), (ab - z * sine), (ca + y * sine), (0.f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:931: syntax error, unexpected identifier, expecting ',' or ';' in 'graphene_simd4x4f_is_identity (const graphene_simd4x4f_t *m)
' at 'graphene_simd4x4f_is_identity'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:931: syntax error, unexpected ')', expecting ',' or ';' in 'graphene_simd4x4f_is_identity (const graphene_simd4x4f_t *m)
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:933: syntax error, unexpected '{' in '  const graphene_simd4f_t r0 = (__extension__ ({ (graphene_simd4f_t) { (1.0f), (0.0f), (0.0f), (0.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:934: syntax error, unexpected '{' in '  const graphene_simd4f_t r1 = (__extension__ ({ (graphene_simd4f_t) { (0.0f), (1.0f), (0.0f), (0.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:935: syntax error, unexpected '{' in '  const graphene_simd4f_t r2 = (__extension__ ({ (graphene_simd4f_t) { (0.0f), (0.0f), (1.0f), (0.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:936: syntax error, unexpected '{' in '  const graphene_simd4f_t r3 = (__extension__ ({ (graphene_simd4f_t) { (0.0f), (0.0f), (0.0f), (1.0f) }; }));
' at '{'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:957: syntax error, unexpected identifier, expecting ',' or ';' in 'graphene_simd4x4f_is_2d (const graphene_simd4x4f_t *m)
' at 'graphene_simd4x4f_is_2d'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:957: syntax error, unexpected ')', expecting ',' or ';' in 'graphene_simd4x4f_is_2d (const graphene_simd4x4f_t *m)
' at ')'
d:\Sources\graphene-1.0.0\src\graphene-simd4x4f.h:961: syntax error, unexpected IF in '  if ((__extension__ ({ __m128i __res = (__m128i) _mm_cmpneq_ps ((m->z), ((__extension__ ({ (graphene_simd4f_t) { (0.f), (0.f), (1.f), (0.f) }; })))); (bool) (_mm_movemask_epi8 (__res) == 0xffff); })))
' at 'if'
graphene-matrix.h:43:
graphene-types.h:65:
graphene-vec3.h:47:
graphene-types.h:76: Fatal: Graphene: Namespace conflict for ''
graphene-types.h:76: Fatal: Graphene: Namespace conflict for ''
make[3]: *** [Graphene-1.0.gir] Error 1
make[3]: Leaving directory `/d/Sources/graphene-1.0.0/src'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/d/Sources/graphene-1.0.0/src'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/d/Sources/graphene-1.0.0/src'
make: *** [install-recursive] Error 1

Is it possible to use radian instead of degree

Hello,

it seems to me that it should be much efficient to use radian instread of degree at least internally.
so the rotation to quaternion convesion should avoir degree -> radian -> degree concersion all around

Cheers

Frederic

Mac OS X build error due to -Bsymbolic-functions

Experienced behavior

On Mac OS X El Capitan, the build process fails while generating libgraphene-1.0.dylib due to an unrecognized linker flag -Bsymbolic-functions, which is apparently not supported by clang.

Full output:

clang    -o src/libgraphene-1.0.dylib 'src/graphene-1.0@sha/graphene-alloc.c.o' 'src/graphene-1.0@sha/graphene-box.c.o' 'src/graphene-1.0@sha/graphene-euler.c.o' 'src/graphene-1.0@sha/graphene-frustum.c.o' 'src/graphene-1.0@sha/graphene-matrix.c.o' 'src/graphene-1.0@sha/graphene-plane.c.o' 'src/graphene-1.0@sha/graphene-point.c.o' 'src/graphene-1.0@sha/graphene-point3d.c.o' 'src/graphene-1.0@sha/graphene-quad.c.o' 'src/graphene-1.0@sha/graphene-quaternion.c.o' 'src/graphene-1.0@sha/graphene-ray.c.o' 'src/graphene-1.0@sha/graphene-rect.c.o' 'src/graphene-1.0@sha/graphene-size.c.o' 'src/graphene-1.0@sha/graphene-sphere.c.o' 'src/graphene-1.0@sha/graphene-triangle.c.o' 'src/graphene-1.0@sha/graphene-vectors.c.o' 'src/graphene-1.0@sha/graphene-gobject.c.o' 'src/graphene-1.0@sha/graphene-simd4f.c.o' 'src/graphene-1.0@sha/graphene-simd4x4f.c.o' '-shared' '-install_name' '/private/tmp/graphene-20161228-17028-1bw9frc/graphene-1.5.2/build/src/libgraphene-1.0.dylib' '-pthread' '-Wl,-Bsymbolic-functions' '-lm' '-L/usr/local/Cellar/glib/2.50.2/lib' '-L/usr/local/opt/gettext/lib' '-lgobject-2.0' '-lglib-2.0' '-lintl' '-Wl,-rpath,/private/tmp/graphene-20161228-17028-1bw9frc/graphene-1.5.2/build/src' 
clang: warning: argument unused during compilation: '-pthread'
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior

The correct building of libgraphene-1.0.dylib

Steps to reproduce

On Mac OS X, using graphene 1.5.2
Commands used:

mkdir build
cd build
meson ..
ninja

Operating system in use

Mac OS X El Capitan

SIMD implementation in use

No clue

GObject support: make the CamelCase types available in C

There is no typedefs in graphene-gobject.h, so the CamelCase types are not available in C, just for languages like Python, JS, etc. But when reading the documentation, I thought that the CamelCase types were also available in C.

I have a patch almost ready for this, the gtk-doc comments just need to be written and it should work fine.

When using only GLib-based libraries in an application, it's nice to have all types in CameCase, it makes the code consistent.

ARM Neon won't code does not build

Making all in src
make[1]: Entering directory '/home/nicolas/graphene/src'
make  all-recursive
make[2]: Entering directory '/home/nicolas/graphene/src'
Making all in .
make[3]: Entering directory '/home/nicolas/graphene/src'
  CC       libgraphene_1_0_la-graphene-box.lo
In file included from graphene-box.c:39:0:
graphene-simd4f.h:1050:3: warning: #warning "The ARM Neon implementation of graphene_simd4f_t is experimental." [-Wcpp]
 # warning "The ARM Neon implementation of graphene_simd4f_t is experimental."
   ^~~~~~~
graphene-box.c: In function 'graphene_box_intersection':
graphene-box.c:367:3: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
   if (graphene_simd4f_cmp_ge (min, max))
   ^~
In file included from graphene-box.c:39:0:
graphene-simd4f.h:1362:31: error: incompatible types when initializing type 'uint8x16_t' using type 'uint32x4_t'
     const uint8x16_t __mask = vcgeq_f32 ((a), (b)); \
                               ^
graphene-box.c:367:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
   if (graphene_simd4f_cmp_ge (min, max))
       ^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1309:19: error: void value not ignored as it ought to be
   (__extension__ ({ \
   ~~~~~~~~~~~~~~~~^~~
     const int8_t __attribute__ ((aligned (16))) __xr[8] = { -7,-6,-5,-4,-3,-2,-1,0 }; \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const uint8x8_t __mask_and = vdup_n_u8 (0x80); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const int8x8_t __mask_shift = vld1_s8 (__xr); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __lo = vget_low_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __hi = vget_high_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vand_u8 (__lo, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vshl_u8 (__lo, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vand_u8 (__hi, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vshl_u8 (__hi, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return ((__hi[0] << 8) | (__lo[0] & 0xff)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }))

graphene-simd4f.h:1363:13: note: in expansion of macro '_graphene_movemask'
(bool) (_graphene_movemask (__mask) != 0);
^~~~~~~~~~~~~~~~~~
graphene-box.c:367:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
if (graphene_simd4f_cmp_ge (min, max))
^~~~~~~~~~~~~~~~~~~~~~
graphene-box.c: In function 'graphene_box_contains_point':
graphene-simd4f.h:1362:31: error: incompatible types when initializing type 'uint8x16_t' using type 'uint32x4_t'
const uint8x16_t __mask = vcgeq_f32 ((a), (b));
^
graphene-box.c:554:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
if (graphene_simd4f_cmp_ge (p, box->min.value) &&
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1309:19: error: void value not ignored as it ought to be
(extension ({ \

     const int8_t __attribute__ ((aligned (16))) __xr[8] = { -7,-6,-5,-4,-3,-2,-1,0 }; \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const uint8x8_t __mask_and = vdup_n_u8 (0x80); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const int8x8_t __mask_shift = vld1_s8 (__xr); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __lo = vget_low_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __hi = vget_high_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vand_u8 (__lo, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vshl_u8 (__lo, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vand_u8 (__hi, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vshl_u8 (__hi, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return ((__hi[0] << 8) | (__lo[0] & 0xff)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }))

graphene-simd4f.h:1363:13: note: in expansion of macro '_graphene_movemask'
(bool) (_graphene_movemask (__mask) != 0);
^~~~~~~~~~~~~~~~~~
graphene-box.c:554:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
if (graphene_simd4f_cmp_ge (p, box->min.value) &&
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1356:31: error: incompatible types when initializing type 'uint8x16_t' using type 'uint32x4_t'
const uint8x16_t __mask = vcleq_f32 ((a), (b));
^
graphene-box.c:555:7: note: in expansion of macro 'graphene_simd4f_cmp_le'
graphene_simd4f_cmp_le (p, box->max.value))
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1309:19: error: void value not ignored as it ought to be
(extension ({ \

     const int8_t __attribute__ ((aligned (16))) __xr[8] = { -7,-6,-5,-4,-3,-2,-1,0 }; \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const uint8x8_t __mask_and = vdup_n_u8 (0x80); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const int8x8_t __mask_shift = vld1_s8 (__xr); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __lo = vget_low_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __hi = vget_high_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vand_u8 (__lo, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vshl_u8 (__lo, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vand_u8 (__hi, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vshl_u8 (__hi, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return ((__hi[0] << 8) | (__lo[0] & 0xff)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }))

graphene-simd4f.h:1357:13: note: in expansion of macro '_graphene_movemask'
(bool) (_graphene_movemask (__mask) != 0);
^~~~~~~~~~~~~~~~~~
graphene-box.c:555:7: note: in expansion of macro 'graphene_simd4f_cmp_le'
graphene_simd4f_cmp_le (p, box->max.value))
^~~~~~~~~~~~~~~~~~~~~~
graphene-box.c: In function 'graphene_box_contains_box':
graphene-simd4f.h:1362:31: error: incompatible types when initializing type 'uint8x16_t' using type 'uint32x4_t'
const uint8x16_t __mask = vcgeq_f32 ((a), (b));
^
graphene-box.c:578:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
if (graphene_simd4f_cmp_ge (b->min.value, a->min.value) &&
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1309:19: error: void value not ignored as it ought to be
(extension ({ \

     const int8_t __attribute__ ((aligned (16))) __xr[8] = { -7,-6,-5,-4,-3,-2,-1,0 }; \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const uint8x8_t __mask_and = vdup_n_u8 (0x80); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const int8x8_t __mask_shift = vld1_s8 (__xr); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __lo = vget_low_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __hi = vget_high_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vand_u8 (__lo, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vshl_u8 (__lo, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vand_u8 (__hi, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vshl_u8 (__hi, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return ((__hi[0] << 8) | (__lo[0] & 0xff)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }))

graphene-simd4f.h:1363:13: note: in expansion of macro '_graphene_movemask'
(bool) (_graphene_movemask (__mask) != 0);
^~~~~~~~~~~~~~~~~~
graphene-box.c:578:7: note: in expansion of macro 'graphene_simd4f_cmp_ge'
if (graphene_simd4f_cmp_ge (b->min.value, a->min.value) &&
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1356:31: error: incompatible types when initializing type 'uint8x16_t' using type 'uint32x4_t'
const uint8x16_t __mask = vcleq_f32 ((a), (b));
^
graphene-box.c:579:7: note: in expansion of macro 'graphene_simd4f_cmp_le'
graphene_simd4f_cmp_le (b->max.value, a->max.value))
^~~~~~~~~~~~~~~~~~~~~~
graphene-simd4f.h:1309:19: error: void value not ignored as it ought to be
(extension ({ \

     const int8_t __attribute__ ((aligned (16))) __xr[8] = { -7,-6,-5,-4,-3,-2,-1,0 }; \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const uint8x8_t __mask_and = vdup_n_u8 (0x80); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     const int8x8_t __mask_shift = vld1_s8 (__xr); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __lo = vget_low_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     uint8x8_t __hi = vget_high_u8 ((a)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vand_u8 (__lo, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vshl_u8 (__lo, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vand_u8 (__hi, __mask_and); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vshl_u8 (__hi, __mask_shift); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __lo = vpadd_u8 (__lo, __lo); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     __hi = vpadd_u8 (__hi, __hi); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return ((__hi[0] << 8) | (__lo[0] & 0xff)); \
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }))

graphene-simd4f.h:1357:13: note: in expansion of macro '_graphene_movemask'
(bool) (_graphene_movemask (__mask) != 0);
^~~~~~~~~~~~~~~~~~
graphene-box.c:579:7: note: in expansion of macro 'graphene_simd4f_cmp_le'
graphene_simd4f_cmp_le (b->max.value, a->max.value))
^~~~~~~~~~~~~~~~~~~~~~
Makefile:740: recipe for target 'libgraphene_1_0_la-graphene-box.lo' failed
make[3]: *** [libgraphene_1_0_la-graphene-box.lo] Error 1
make[3]: Leaving directory '/home/nicolas/graphene/src'
Makefile:1004: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/nicolas/graphene/src'
Makefile:596: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/nicolas/graphene/src'
Makefile:449: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

ppc64 build fails with 'unrecognizable insn' error

I'm trying to build graphene master for rawhide. The ppc64 build currently fails with:

FAILED: src/graphene-1.0@sha/graphene-simd4f.c.o 
cc  '-Isrc/graphene-1.0@sha' '-fdiagnostics-color=always' '-Isrc' '-I../src' '-pipe' '-Wall' '-Winvalid-pch' '-std=gnu99' '-O2' '-g' '-pipe' '-Wall' '-Werror=format-security' '-Wp,-D_FORTIFY_SOURCE=2' '-fexceptions' '-fstack-protector-strong' '--param=ssp-buffer-size=4' '-grecord-gcc-switches' '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' '-m64' '-fvisibility=hidden' '-ffast-math' '-fstrict-aliasing' '-Wall' '-Wpointer-arith' '-Wmissing-declarations' '-Wformat=2' '-Wstrict-prototypes' '-Wmissing-prototypes' '-Wnested-externs' '-Wold-style-definition' '-Wdeclaration-after-statement' '-Wunused' '-Wuninitialized' '-Wshadow' '-Wmissing-noreturn' '-Wmissing-format-attribute' '-Wredundant-decls' '-Wlogical-op' '-Wcast-align' '-Wno-unused-local-typedefs' '-Werror=implicit' '-Werror=init-self' '-Werror=main' '-Werror=missing-braces' '-Werror=return-type' '-Werror=array-bounds' '-Werror=write-strings' '-DGRAPHENE_ENABLE_DEBUG' '-DGRAPHENE_COMPILATION' '-DG_LOG_DOMAIN="Graphene"' '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_30' '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32' '-fPIC' '-I/usr/include/glib-2.0' '-I/usr/lib64/glib-2.0/include' '-pthread' '-MMD' '-MQ' 'src/graphene-1.0@sha/graphene-simd4f.c.o' '-MF' 'src/graphene-1.0@sha/graphene-simd4f.c.o.d' -o 'src/graphene-1.0@sha/graphene-simd4f.c.o' -c ../src/graphene-simd4f.c
../src/graphene-simd4f.c: In function ‘graphene_simd4f_min’:
../src/graphene-simd4f.c:1295:1: error: unrecognizable insn:
 }
 ^
(insn 63 62 64 2 (set (reg:SF 36 4)
        (if_then_else:SF (ge (reg:SF 206)
                (const_double:SF 0.0 [0x0.0p+0]))
            (reg:SF 7 7 [orig:6 b+12 ] [6])
            (reg:SF 5 5 [orig:4 a+12 ] [4]))) ../src/graphene-simd4f.c:1291 -1
     (expr_list:REG_DEAD (reg:SF 206)
        (expr_list:REG_DEAD (reg:SF 7 7 [orig:6 b+12 ] [6])
            (expr_list:REG_DEAD (reg:SF 5 5 [orig:4 a+12 ] [4])
                (nil)))))

Full log file is at https://kojipkgs.fedoraproject.org//work/tasks/780/16560780/build.log (short lived link)

Installing on Windows

After a bit of research and some help from the creator, I finally got it working on Windows

Documenting it so people don't suffer as much as I did...
1- Install MSYS2
2- cd
3- pacman -Sy
4- pacman -S pkg-config
5- pacman -S libtool
6- pacman -S automake
7- pacman -S gtk-doc
8- pacman -S autoconf
9- ./autogen.sh
And that's pretty much it...

Does not build on Android ARM

It unconditionally uses NEON it seems. Not all Android devices have NEON so we need to compile it in conditionally and detect at runtime.

libtool: compile: arm-linux-androideabi-gcc -fuse-ld=gold -DHAVE_CONFIG_H -I. -DGRAPHENE_COMPILATION=1 -DG_LOG_DOMAIN="Graphene" -I../src -I../src -DGRAPHENE_ENABLE_DEBUG --sysroot=/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm -I/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -DANDROID -DPIC -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -O3 -ffast-math -fstrict-aliasing -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/include/glib-2.0 -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/lib/glib-2.0/include -fvisibility=hidden -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/include/glib-2.0 -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/lib/glib-2.0/include -Wall -Wshadow -Wstrict-aliasing=2 -Wno-uninitialized -Wcast-align -Wstrict-prototypes -Werror=logical-op -Werror=pointer-arith -Werror=missing-declarations -Werror=redundant-decls -Werror=implicit-function-declaration -Werror=format=2 -Werror=missing-include-dirs -Werror=init-self -Werror=empty-body -Werror=declaration-after-statement -mfpu=neon -Wall -g -Os --sysroot=/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm -I/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -march=armv5te -mtune=xscale -msoft-float -DANDROID -DPIC -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wa,--noexecstack -g -MT libgraphene_1_0_la-graphene-point.lo -MD -MP -MF .deps/libgraphene_1_0_la-graphene-point.Tpo -c graphene-point.c -fPIC -DPIC -o .libs/libgraphene_1_0_la-graphene-point.o
graphene-alloc.c: In function 'graphene_alloc':
In file included from graphene-config.h:38:0,
from graphene-types.h:32,
from graphene-matrix.h:27,
from graphene-matrix.c:35:
/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
#error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h

Problem overriding libexecdir

For Debian, we want the installed tests to end up in /usr/lib/installed-tests/graphene-1.0/
So I used the meson flag -Dlibexecdir=/usr/lib but the tests were still installed to /usr/libexec/

More meson flags?

I am looking at converting Ubuntu's graphene package to meson.

There are 3 configure flags I use:
--enable-gtk-doc (not needed?)
--disable-sse2 (on non-64bit x86)
--disable-arm-neon (on armhf because at least Ubuntu's armhf builder doesn't support neon)

Tests fail on Ubuntu's i386

Experienced behavior

graphene 1.5.4 built successfully on Ubuntu 17.04 Alpha amd64 in the GNOME3 Staging PPA but the build tests failed on i386.

I used autotools for building. Here's my packaging.

https://launchpad.net/~gnome3-team/+archive/ubuntu/gnome3-staging/+packages?field.series_filter=zesty

https://launchpadlibrarian.net/302565653/buildlog_ubuntu-zesty-i386.graphene_1.5.4-0ubuntu0~zesty1_BUILDING.txt.gz

Here's a few of the test failures:

ERROR: box
==========
Segmentation fault (core dumped)
# random seed: R02S18d871e89fd01da7e808a8fd4b4334b5
1..13
# Start of box tests
ERROR: box - too few tests run (expected 13, got 0)
ERROR: box - exited with status 139 (terminated by signal 11?)

ERROR: euler
============
Segmentation fault (core dumped)
# random seed: R02Se82591a0fff08197538377f6b1697611
1..2
# Start of euler tests
ERROR: euler - too few tests run (expected 2, got 0)
ERROR: euler - exited with status 139 (terminated by signal 11?)

Explain a bit more the underlying maths?

I'm finally learning computer graphics with the Fundamentals of Computer Graphics book, by Shirley and Marshner. In parallel I'm looking at the graphene API and implementation.

I wonder if it makes sense to better explain the underlying maths in the graphene API. At least just a summary or examples.

For example for graphene_point_interpolate(), it could be explained that for a factor of 0 the result is the point a, for a factor of 1 it's the point b and 0.5 (for example) is at the middle of the line that goes through a and b.

Or is it considered too well-known to bother explaining that kind of thing?

MSYS2 build failures

Experienced behavior

Current master does not build on MSYS2 as documented.

$ ninja
[1/67] Compiling c object src/graphene-1.0@sha/graphene-alloc.c.obj
FAILED: src/graphene-1.0@sha/graphene-alloc.c.obj
cc @src/graphene-1.0@sha/graphene-alloc.c.obj.rsp
../src/graphene-alloc.c: In function 'graphene_aligned_alloc':
../src/graphene-alloc.c:94:11: error: implicit declaration of function 'posix_memalign' [-Werror=implicit-function-declaration]
   errno = posix_memalign (&res, alignment, real_size);
           ^~~~~~~~~~~~~~
cc1.exe: some warnings being treated as errors
[2/67] Compiling c object src/graphene-1.0@sha/graphene-euler.c.obj
[3/67] Compiling c object src/graphene-1.0@sha/graphene-box.c.obj
../src/graphene-box.c:53:0: warning: "_WIN32_WINNT" redefined
 #define _WIN32_WINNT 0x0600

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdlib.h:9,
                 from ../src/graphene-private.h:30,
                 from ../src/graphene-box.c:33:
C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:225:0: note: this is the location of the previous definition
 #define _WIN32_WINNT 0x502

../src/graphene-box.c:688:15: warning: no previous prototype for 'InitBoxFunc' [-Wmissing-prototypes]
 BOOL CALLBACK InitBoxFunc (PINIT_ONCE InitOnce,
               ^~~~~~~~~~~
ninja: build stopped: subcommand failed.

Expected behavior

Ninja completes the build so I can make you a nice mingw-w64-graphene-git package to allow the new GTK3 dependencies to be built on Windows.

Steps to reproduce

These also form updated build instructions for MSYS2.

From an MSYS2 environment:

  1. Build mingw-w64-meson with makepkg-mingw -sf (packages are not yet available in the repository because @Alexpux has been busy) Now just install them: pacman -S mingw-w64-i686-meson mingw-w64-x86_64-meson

  2. Install the resultant packages: pacman -U *.pkg.tar.xz

  3. Install ninja from the repository: pacman -S mingw-w64-{x86_64,i686}-ninja Now pulled in as a dependency.

  4. Install graphene's documented dependencies:

    pacman -Syyuu    # repeat as needed, closing the terminal when it tells you
    
    pacman -S automake autoconf libtool pkg-config gtk-doc
    pacman -S glib2   # why not native (mingw-w64-{x86_64,i686}) ?
    
  5. From a MINGW64 or a MINGW32 shell,

    cd /usr/src/
    git clone git://github.com/ebassi/graphene
    cd graphene/
    mkdir _build && cd _build
    meson.py ..     # note the different name on these platforms
    ninja
    

At which point it fails with the error above.

Operating system in use

Windows 7 Professional N (on Virtualbox on Debian)

SIMD implementation in use

Not a clue, I only care about getting graphene built sensibly so I can fix wacom stylus tilt in GTK master.

Plane: "normal vector pointing towards the origin" is confusing

As far as I understand, the normal vector of the plane can point in the reverse order than towards the origin.

In graphene_plane_init(), 'constant' is the negative distance. So should the value of 'constant' be positive or negative? Are both positive and negative allowed?

What does graphene_plane_normalize() do? I think it should be documented in the class description. I guess a normalized plane is when the normal vector really points to the origin.

For graphene_plane_negate(), "Negates the normal vector and constant" -> if both values are negated, the result is the same plane, no? Or I've misunderstood something, and it's related to the above comments.

Cannot build Graphene

OS: Ubuntu 15.04
Computer: Dell Inspiron 7520 64 bit 8GB RAM core I7
Netbeans:
build tools: GCC
cd '/home/belal/NetBeansProjects/B3DMSIM_netbeans'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/belal/NetBeansProjects/B3DMSIM_netbeans'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/b3dmsim_netbeans
make[2]: Entering directory '/home/belal/NetBeansProjects/B3DMSIM_netbeans'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/cg_exp.o.d"
gcc -I/usr/local/lib/graphene-1.0/include -c -g -std=c89 -MMD -MP -MF "build/Debug/GNU-Linux/cg_exp.o.d" -o build/Debug/GNU-Linux/cg_exp.o cg_exp.c
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/main.o.d"
gcc -I/usr/local/lib/graphene-1.0/include -c -g -std=c89 -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.c
In file included from /usr/local/include/graphene-1.0/graphene.h:35:0,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4f.h:1501:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1502:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_madd’
graphene_simd4f_madd (const graphene_simd4f_t m1,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1520:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1521:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_sum’
graphene_simd4f_sum (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1543:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘float’
static inline float
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1562:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1563:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_dot4’
graphene_simd4f_dot4 (const graphene_simd4f_t a,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1582:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1583:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_dot2’
graphene_simd4f_dot2 (const graphene_simd4f_t a,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1604:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1605:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_length4’
graphene_simd4f_length4 (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1621:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1622:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_length3’
graphene_simd4f_length3 (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1638:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1639:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_length2’
graphene_simd4f_length2 (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1655:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1656:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_normalize4’
graphene_simd4f_normalize4 (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1673:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1674:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_normalize3’
graphene_simd4f_normalize3 (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1691:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1692:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_normalize2’
graphene_simd4f_normalize2 (const graphene_simd4f_t v)
^
In file included from /usr/local/include/graphene-1.0/graphene-macros.h:74:0,
from /usr/local/include/graphene-1.0/graphene-types.h:32,
from /usr/local/include/graphene-1.0/graphene.h:29,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4f.h:1709:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1727:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1746:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
In file included from /usr/local/include/graphene-1.0/graphene.h:35:0,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4f.h:1766:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1767:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_interpolate’
graphene_simd4f_interpolate (const graphene_simd4f_t a,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1791:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1792:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_clamp’
graphene_simd4f_clamp (const graphene_simd4f_t v,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1814:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1815:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_clamp_scalar’
graphene_simd4f_clamp_scalar (const graphene_simd4f_t v,
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1835:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1836:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_min_val’
graphene_simd4f_min_val (const graphene_simd4f_t v)
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1857:8: error: unknown type name ‘inline’
static inline graphene_simd4f_t
^
/usr/local/include/graphene-1.0/graphene-simd4f.h:1858:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4f_max_val’
graphene_simd4f_max_val (const graphene_simd4f_t v)
^
In file included from /usr/local/include/graphene-1.0/graphene.h:36:0,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:71:8: error: unknown type name ‘inline’
static inline graphene_simd4x4f_t GRAPHENE_VECTORCALL
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:72:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘graphene_simd4x4f_init’
graphene_simd4x4f_init (graphene_simd4f_t x,
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:95:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:114:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:134:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:205:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:226:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:255:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:283:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:308:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:328:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:357:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:381:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:450:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:485:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:525:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:559:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:591:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:646:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:670:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:694:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:743:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:764:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:787:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:808:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
In file included from /usr/local/include/graphene-1.0/graphene-macros.h:74:0,
from /usr/local/include/graphene-1.0/graphene-types.h:32,
from /usr/local/include/graphene-1.0/graphene.h:29,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:830:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
In file included from /usr/local/include/graphene-1.0/graphene.h:36:0,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:931:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’
static inline void
^
In file included from /usr/local/include/graphene-1.0/graphene-macros.h:74:0,
from /usr/local/include/graphene-1.0/graphene-types.h:32,
from /usr/local/include/graphene-1.0/graphene.h:29,
from cg.h:15,
from api.h:21,
from main.c:9:
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:993:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
/usr/local/include/graphene-1.0/graphene-simd4x4f.h:1019:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_Bool’
static inline bool
^
nbproject/Makefile-Debug.mk:72: recipe for target 'build/Debug/GNU-Linux/main.o' failed
make[2]: *** [build/Debug/GNU-Linux/main.o] Error 1
make[2]: Leaving directory '/home/belal/NetBeansProjects/B3DMSIM_netbeans'
nbproject/Makefile-Debug.mk:60: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/belal/NetBeansProjects/B3DMSIM_netbeans'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2

column major

Hi

Is your matrix math column or row major ordering? I was wrangling with sony's vectormath library and while the math is good the api is really terrible [in my opinion]. You seem to have a reasonable api with neon and sse support. Do your matrices work with column major or row major?

Also do you provide a cmake build?

add matrix/vec3 transformation

we need a public facing version of graphene_simd4x4f_point3_mul(), likely using graphene_point3d_t.

we already have a graphene_matrix_transform_vec3(), which uses graphene_simd4x4f_vec3_mul(), so we cannot add a graphene_matrix_transform_vec3() using graphene_vec3_t. we could call it graphene_matrix_multiply_vec3(), but it gets slightly weird.

Failing tests for armhf

Experienced behavior

The build tests for graphene 1.5.4 are failing on the armhf architecture.

https://launchpad.net/ubuntu/+source/graphene/1.5.4-0ubuntu2

https://launchpadlibrarian.net/305028673/buildlog_ubuntu-zesty-armhf.graphene_1.5.4-0ubuntu2_BUILDING.txt.gz

Operating system in use

Ubuntu 17.04 Alpha

SIMD implementation in use

ARM Neon

Workaround

Use --disable-arm-neon when building for armhf

The builds works on arm64 because it does not use the ARM Neon instructions there.

graphene: FAILED: src/Graphene-1.0.gir

Experienced behavior

I was trying to build gtk 3.89.2 and noticed that I didn't have the graphene-gobject library installed after rebuilding graphene 1.5.2 with your fix from #91. By the way, this library was not checked for during gtk+'s configure invocation, it only showed up as compile-time error when the graphene-gobject headers were not found...

I retried then after passing the required options to meson but ended up with the following errors:

[64/65] 'Generating Graphene-1.0.gir with a custom command.'
FAILED: src/Graphene-1.0.gir 
'/usr/local/opt/gobject-introspection/bin/g-ir-scanner' '../src/graphene-box.h' '../src/graphene-euler.h' '../src/graphene-frustum.h' '../src/graphene-macros.h' '../src/graphene-matrix.h' '../src/graphene-plane.h' '../src/graphene-point.h' '../src/graphene-point3d.h' '../src/graphene-quad.h' '../src/graphene-quaternion.h' '../src/graphene-ray.h' '../src/graphene-rect.h' '../src/graphene-size.h' '../src/graphene-sphere.h' '../src/graphene-triangle.h' '../src/graphene-types.h' '../src/graphene-vec2.h' '../src/graphene-vec3.h' '../src/graphene-vec4.h' '../src/graphene-version-macros.h' '../src/graphene-gobject.h' '../src/graphene-alloc.c' '../src/graphene-box.c' '../src/graphene-euler.c' '../src/graphene-frustum.c' '../src/graphene-matrix.c' '../src/graphene-plane.c' '../src/graphene-point.c' '../src/graphene-point3d.c' '../src/graphene-quad.c' '../src/graphene-quaternion.c' '../src/graphene-ray.c' '../src/graphene-rect.c' '../src/graphene-size.c' '../src/graphene-sphere.c' '../src/graphene-triangle.c' '../src/graphene-vectors.c' '../src/graphene-gobject.c' '-D_REENTRANT' '-I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include' '-I/usr/local/Cellar/pcre/8.39/include' '-I/usr/local/Cellar/glib/2.50.2/include/glib-2.0' '-I/usr/local/Cellar/glib/2.50.2/lib/glib-2.0/include' '-I/usr/local/opt/gettext/include' '-I/usr/local/Cellar/gobject-introspection/1.50.0/include/gobject-introspection-1.0' '--no-libtool' '--namespace=Graphene' '--nsversion=1.0' '--warn-all' '--output' 'src/Graphene-1.0.gir' '--identifier-filter-cmd=/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/src/identfilter.py' '--c-include=graphene-gobject.h' '--accept-unprefixed' '-DGRAPHENE_COMPILATION' '--cflags-begin' '-I/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/src' '-I/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/build/src' '--cflags-end' '-I/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/src' '-I/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/build/src' '--include=GObject-2.0' '--symbol-prefix=graphene' '--identifier-prefix=Graphene' '--pkg-export=graphene-gobject-1.0' '-I/usr/local/opt/gettext/include' '-I/usr/local/Cellar/glib/2.50.2/include/glib-2.0' '-I/usr/local/Cellar/glib/2.50.2/lib/glib-2.0/include' '-I/usr/local/Cellar/pcre/8.39/include' '-L/private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/build/src' '-L/usr/local/opt/gettext/lib' '-L/usr/local/Cellar/glib/2.50.2/lib' '-lm' '-lglib-2.0' '-lintl' '-lgobject-2.0' '--library' 'graphene-1.0'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h:79: syntax error, unexpected identifier, expecting ')' in 'void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);' at 'bsd_signal'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h:79: syntax error, unexpected ')', expecting ',' or ';' in 'void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h:99: syntax error, unexpected identifier, expecting ')' in 'void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);' at 'sigset'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h:99: syntax error, unexpected ')', expecting ',' or ';' in 'void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:113: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  qos_class_t * _Nullable restrict __qos_class,' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:114: syntax error, unexpected INT, expecting identifier or '(' or '*' in '  int * _Nullable restrict __relative_priority);' at 'int'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:114: syntax error, unexpected ')', expecting ',' or ';' in '  int * _Nullable restrict __relative_priority);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:185: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  qos_class_t * _Nullable restrict __qos_class,' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:186: syntax error, unexpected INT, expecting identifier or '(' or '*' in '  int * _Nullable restrict __relative_priority);' at 'int'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:186: syntax error, unexpected ')', expecting ',' or ';' in '  int * _Nullable restrict __relative_priority);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:243: syntax error, unexpected '*', expecting ')' or ',' in '  void * _Nullable * _Nonnull restrict, size_t * restrict);' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:243: syntax error, unexpected ')', expecting identifier or '(' in '  void * _Nullable * _Nonnull restrict, size_t * restrict);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:247: syntax error, unexpected '*', expecting ')' or ',' in '  void * _Nullable * _Nonnull restrict);' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:295: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  const pthread_condattr_t * _Nullable restrict)' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:304: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  const struct timespec * _Nullable restrict)' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:326: syntax error, unexpected '*', expecting ')' or ',' in 'int pthread_create(pthread_t _Nullable * _Nonnull restrict,' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:327: syntax error, unexpected ',', expecting identifier or '(' or '*' or ';' in '  const pthread_attr_t * _Nullable restrict,' at ','
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:328: syntax error, unexpected '*' in '  void * _Nullable (* _Nonnull)(void * _Nullable),' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:328: syntax error, unexpected ')', expecting ',' or ';' in '  void * _Nullable (* _Nonnull)(void * _Nullable),' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:329: syntax error, unexpected ')', expecting identifier or '(' or '*' or ';' in '  void * _Nullable restrict);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:349: syntax error, unexpected RESTRICT, expecting ')' or ',' in 'int pthread_getschedparam(pthread_t , int * _Nullable restrict,' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:350: syntax error, unexpected ')', expecting identifier or '(' or '*' or ';' in '  struct sched_param * _Nullable restrict);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:353: syntax error, unexpected identifier, expecting ',' or ';' in 'void* _Nullable pthread_getspecific(pthread_key_t);' at 'pthread_getspecific'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:356: syntax error, unexpected '*', expecting ')' or ',' in 'int pthread_join(pthread_t , void * _Nullable * _Nullable)' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:374: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  const pthread_mutexattr_t * _Nullable restrict);' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:432: syntax error, unexpected RESTRICT, expecting ')' or ',' in '  const pthread_rwlockattr_t * _Nullable restrict)' at 'restrict'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:529: syntax error, unexpected '*', expecting ')' or ',' in '  pthread_t _Nullable * _Nonnull, const pthread_attr_t * _Nullable,' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:530: syntax error, unexpected VOID, expecting identifier or '(' or '*' in '  void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable);' at 'void'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:530: syntax error, unexpected '*' in '  void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable);' at '*'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:530: syntax error, unexpected ')', expecting ',' or ';' in '  void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:530: syntax error, unexpected ')', expecting ',' or ';' in '  void * _Nullable (* _Nonnull)(void * _Nullable), void * _Nullable);' at ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread.h:540: syntax error, unexpected identifier in '_Nullable pthread_t pthread_from_mach_thread_np(mach_port_t);' at '_Nullable'
In file included from /private/tmp/graphene-20170101-3369-w6flsg/graphene-1.5.2/build/tmp-introspectxBnQzD/Graphene-1.0.c:2:
In file included from /usr/local/Cellar/glib/2.50.2/include/glib-2.0/glib.h:30:
In file included from /usr/local/Cellar/glib/2.50.2/include/glib-2.0/glib/galloca.h:32:
/usr/local/Cellar/glib/2.50.2/include/glib-2.0/glib/gtypes.h:423:3: error: '_GStaticAssertCompileTimeAssertion_0' declared as an array with a negative size
  G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/glib/2.50.2/include/glib-2.0/glib/gmacros.h:232:103: note: expanded from macro 'G_STATIC_ASSERT'
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                                                                      ^~~~~~~~~~~~~~~
1 error generated.
Traceback (most recent call last):
  File "/usr/local/opt/gobject-introspection/bin/g-ir-scanner", line 66, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/scannermain.py", line 544, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/scannermain.py", line 419, in create_binary
    gdump_parser.get_error_quark_functions())
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/dumper.py", line 328, in compile_introspection_binary
    return dc.run()
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/dumper.py", line 167, in run
    introspection_obj = self._compile(c_path)
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/dumper.py", line 207, in _compile
    self._options.init_sections)
  File "/usr/local/Cellar/gobject-introspection/1.50.0/lib/gobject-introspection/giscanner/ccompiler.py", line 241, in compile
    source_str.rfind(os.sep)]))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile
    raise CompileError, msg
distutils.errors.CompileError: command 'clang' failed with exit status 1
ninja: build stopped: subcommand failed.

Expected behavior

The gobject-introspection command to produce the Gir file, followed by a build of the graphene-object shared library.

Steps to reproduce

On a Mac OS X El Capitan system (10.11.6) with Xcode 8.2.1 and an up-to-date Homebrew installation.
I am the maintainer of Homebrew's graphene Formula and used it to build graphene 1.5.2:

class Graphene < Formula
  desc "Thin layer of graphic data types"
  homepage "https://ebassi.github.io/graphene/"
  url "https://download.gnome.org/sources/graphene/1.2/graphene-1.2.10.tar.xz"
  sha256 "e7b58334a91ae75b776fda987c29867710008673040fc996949933f2c5f17fdb"

  devel do
    url "https://download.gnome.org/sources/graphene/1.5/graphene-1.5.2.tar.xz"
    sha256 "4b2fe2c3aad43416bb520e2b3f0e1f4535b0fa722291a14904b01765afe9416f"
    depends_on "meson" => :build
    depends_on "ninja" => :build
  end

  bottle do
    sha256 "fe4ea086531c7c99ac358bc5dcf7017dee230530cbb1c9ab5ff069ab16aa4f63" => :sierra
    sha256 "1a77fae74e84bbf8a5d2f49faf1a548d7aaf57fe2b85737a009143eb85bff333" => :el_capitan
    sha256 "27eca42a5917f791f1a7797575faa3a1952481ffe02295f4dcdcfc04028cd1f9" => :yosemite
    sha256 "2f648859da057200b6f056d45f4041a8e055049b5123b9ded4fdd76967f3dd28" => :mavericks
    sha256 "8072477f15c69a336a63cb86c75610ab6e1b1d11eadb9b05244a4f565abf6b79" => :mountain_lion
  end

  depends_on "pkg-config" => :build
  depends_on "glib"
  depends_on "gobject-introspection"

  def install
    if build.devel?
      inreplace "src/meson.build", "'-Wl,-Bsymbolic-functions'", "" 
      mkdir "build" do
        system "meson", "--prefix=#{prefix}", "-Denable-introspection=true", "-Denable-gobject-types=true", ".."
        system "ninja"
        system "ninja", "test"
        system "ninja", "install"
      end
    else 
      system "./configure", "--disable-debug",
                            "--disable-dependency-tracking",
                            "--disable-silent-rules",
                            "--prefix=#{prefix}"
      system "make"
      system "make", "check"
      system "make", "install"
    end
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <graphene-gobject.h>

      int main(int argc, char *argv[]) {
      GType type = graphene_point_get_type();
        return 0;
      }
    EOS
    gettext = Formula["gettext"]
    glib = Formula["glib"]
    flags = %W[
      -I#{gettext.opt_include}
      -I#{glib.opt_include}/glib-2.0
      -I#{glib.opt_lib}/glib-2.0/include
      -I#{include}/graphene-1.0
      -I#{lib}/graphene-1.0/include
      -L#{lib}
      -lgraphene-1.0
    ]
    system ENV.cc, "test.c", "-o", "test", *flags
    system "./test"
  end
end

The build itself was subsequently started as:

brew install graphene --devel -v

Operating system in use

Mac OS X El Capitan 10.11.6

SIMD implementation in use

No idea sorry.

I noticed that your Travis-CI configuration explicitly excludes the gobject-introspection build: is there are particular reason for this? Also, would it be a good idea to add a Travis-CI Mac OS X build to the yaml file? I could add a PR for this.

Thanks for looking into this and best wishes for 2017!

X86 32bits builds fails

We observe build failures on X86 32 bits platform. The problem is that to use SSE2 intrinsic, you need to enable SSE2 in compiler flags. Though, you don't want to do this globally, as we want to choose the right routine at run-time base on CPU flags. The solution sens in pixman, is to split the SSE2 code into it's own .c and set flags for the compilation of that object only.

https://ci.gstreamer.net/view/All/job/cerbero-cross-mingw32/1755/console

Note it's very similar to issue #21 though it's a wider issue, as it affect iOS and Android builds too.

Are there any prebuilt binary packages?

I'm having a lot of trouble getting through a successful build (see my other issue). Are you aware of any prebuilt binary packages (i.e. libs+headers I can compile and link against) available anywhere for download? I'm developing on Windows but also wish to offer builds of my application for OSX and Linux. Support for ARM and others is not important to me at this stage.

Allow Graphene to be Built With Visual Studio

Hi,

As Graphene is going to be a dependency of GDK (or so) in the near future, I thought it might be good to make the code buildable and usable with Visual Studio, eventually coming up with Projects or NMake Makefiles to build the library, which I spent the last few days figuring out, with SSE intrinistics support for x64 builds.

matrix test fails on MinGW

Experienced behavior

 4/18 matrix                                  FAIL     1.40 s
--- command ---
 c:\Users\nirbheek\projects\graphene\build2\src\tests\matrix.exe --tap -k
--- stdout ---
# random seed: R02Sd87d390696408afb383b0a5127818c3b
1..14
# Start of matrix tests
ok 1 /matrix/identity
ok 2 /matrix/scale
ok 3 /matrix/rotation
ok 4 /matrix/translation
ok 5 /matrix/neutral_element
ok 6 /matrix/look_at
ok 7 /matrix/invert
ok 8 /matrix/interpolate
# Start of rotation tests
ok 9 /matrix/rotation/euler-quaternion
# End of rotation tests
# Start of 2d tests
ok 10 /matrix/2d/identity
ok 11 /matrix/2d/transforms
ok 12 /matrix/2d/round-trip
ok 13 /matrix/2d/interpolate
# Graphene-Test:ERROR:../src/tests/matrix.c:497:matrix_2d_transform_bound: &((&res)->origin) == &((&r2)->origin) (+/- 0.01): { x:0, y:0 } == { x:100, y:100 }

Expected behavior

Test should pass.

Steps to reproduce

Build with GCC 4.7.3, i686-w64-mingw32-gcc and run ninja test.

Operating system in use

Windows 8.1 64-bit on x86-64

SIMD implementation in use

SSE2 intrinsics weren't found and the GCC version is too old for vectors intrinsics.

Remove hard dependency on GLib

even if we're a C library, we don't use GLib very much: little to no data types; no API except in the test and benchmark suites; just a handful of macros that can be fairly easily replaced with our own.

ideally, a de-GLib-ified Graphene can be used as a dependency on constrained devices, or devices where getting GLib running is not trivial.

the current work exists in the de-glib-ification branch. it should not go out of sync easily: after all, it's just a search and replace job plus some build environment glue to disable the various bits and pieces.

the only GLib data type we currently use, and expose in the API, is gboolean, and we can effectively replace it with stdbool.h and bool. the only downside is that we'd drop compatibility with non-C99 compilers (hi, I'm looking at you MSVC). I'm literally failing to conjure enough care, but that's the main reason why I just didn't go ahead and merged this work.

we clearly want to keep the test and benchmark suites, and this means using GLib; I don't want to re-implement GTest.

we also want to provide GObject types for GObject-based libraries depending on Graphene, but that's already optional and can be disabled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.