Skip to content

Fixed broken build on OS X. #6 #8

New issue

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

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

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
May 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ Or to build with what's on your path, just:

make

If you're building on OS X with `clang` as the default C/C++ compiler, you'll need to specify `gcc` as your compiler:

make CC=gcc CXX=gcc

Or for the debug build:

DEBUG=1 make
Expand Down
6 changes: 6 additions & 0 deletions hll.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@

#include <postgres.h> // Needs to be first.

#if defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define bswap_64 OSSwapInt64
#else
#include <byteswap.h>
#endif

#include <funcapi.h>
#include <math.h>
#include <stdlib.h>
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_comprehensive.ref
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_rhswkjtc
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_rhswkjtc v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_rhswkjtc
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -101,14 +101,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_rhswkjtc
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_rhswkjtc v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_rhswkjtc
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

-- Window function which calls final functions more then once.
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_comprehensive.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_rhswkjtc
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_rhswkjtc v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -78,7 +78,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_rhswkjtc
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_rhswkjtc v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_explicit_explicit.ref
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_swlnhisq
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_swlnhisq v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_swlnhisq
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -101,14 +101,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_swlnhisq
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_swlnhisq v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_swlnhisq
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_swlnhisq;
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_explicit_explicit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_swlnhisq
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_swlnhisq v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -78,7 +78,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_swlnhisq
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_swlnhisq v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_explicit_promotion.ref
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_wsdiietv
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_wsdiietv v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_wsdiietv
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -110,14 +110,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_wsdiietv
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_wsdiietv v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_wsdiietv
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_wsdiietv;
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_explicit_promotion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_wsdiietv
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_wsdiietv v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -83,7 +83,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_wsdiietv
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_wsdiietv v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_probabilistic_probabilistic.ref
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_mpuahgwy
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_mpuahgwy v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_mpuahgwy
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -104,14 +104,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_mpuahgwy
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_mpuahgwy v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_mpuahgwy
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_mpuahgwy;
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_probabilistic_probabilistic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_mpuahgwy
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_mpuahgwy v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -78,7 +78,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_mpuahgwy
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_mpuahgwy v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_sparse_full_representation.ref
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_tagumlbl
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_tagumlbl v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_tagumlbl
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -110,14 +110,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_tagumlbl
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_tagumlbl v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_tagumlbl
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_tagumlbl;
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_sparse_full_representation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_tagumlbl
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_tagumlbl v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -83,7 +83,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_tagumlbl
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_tagumlbl v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_sparse_promotion.ref
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_bsnvqefe
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_bsnvqefe v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_bsnvqefe
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -110,14 +110,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_bsnvqefe
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_bsnvqefe v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_bsnvqefe
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_bsnvqefe;
Expand Down
4 changes: 2 additions & 2 deletions regress/cumulative_union_sparse_promotion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_bsnvqefe
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_bsnvqefe v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
Expand All @@ -83,7 +83,7 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_bsnvqefe
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_bsnvqefe v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
Expand Down
12 changes: 6 additions & 6 deletions regress/cumulative_union_sparse_sparse.ref
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ SELECT v1.recno,
v1.union_compressed_multiset,
(select hll_union_agg(compressed_multiset)
from test_bmbffonl
where recno <= v1.recno)
where recno <= v1.recno) as hll_union_agg
FROM test_bmbffonl v1
WHERE v1.union_compressed_multiset !=
(select hll_union_agg(compressed_multiset)
from test_bmbffonl
where recno <= v1.recno);
recno | union_compressed_multiset | ?column?
-------+---------------------------+----------
recno | union_compressed_multiset | hll_union_agg
-------+---------------------------+---------------
(0 rows)

-- Test aggregate accumulation with cardinality
Expand All @@ -101,14 +101,14 @@ SELECT v1.recno,
ceil(v1.union_cardinality),
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_bmbffonl
where recno <= v1.recno)
where recno <= v1.recno) as ceiling
FROM test_bmbffonl v1
WHERE ceil(v1.union_cardinality) !=
(select ceiling(hll_cardinality(hll_union_agg(compressed_multiset)))
from test_bmbffonl
where recno <= v1.recno);
recno | ceil | ?column?
-------+------+----------
recno | ceil | ceiling
-------+------+---------
(0 rows)

DROP TABLE test_bmbffonl;
Expand Down
Loading