Skip to content

Commit

Permalink
Fix some compilation/setup issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Jun 11, 2024
1 parent 7765dac commit 420cb5d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ cd tpch/tpch-dbgen
make
```

Notes:

- For MacOS, the above `make` command will result in an error while compiling like below,

```shell
bm_utils.c:71:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^~~~~~~~~~
1 error generated.
make: *** [bm_utils.o] Error 1
```
To fix this, change the import statement `#include <malloc.h>` to `#include <sys/malloc.h>` in the files where error
is reported (`bm_utils.c` and `varsub.c`) and then re-run the command `make`.

### Execute

```shell
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export RUN_LOG_TIMINGS=1
export SCALE_FACTOR=1
export SCALE_FACTOR=1.0

echo run with cached IO
make tables
Expand Down
6 changes: 5 additions & 1 deletion tpch-dbgen/bm_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
#include <ctype.h>
#include <math.h>
#ifndef _POSIX_SOURCE
#include <malloc.h>
#ifdef __APPLE__
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif
#endif /* POSIX_SOURCE */
#include <fcntl.h>
#include <sys/types.h>
Expand Down
6 changes: 5 additions & 1 deletion tpch-dbgen/varsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
*/
#include <stdio.h>
#ifndef _POSIX_SOURCE
#include <malloc.h>
#ifdef __APPLE__
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif
#endif /* POSIX_SOURCE */
#if (defined(_POSIX_)||!defined(WIN32))
#include <unistd.h>
Expand Down

0 comments on commit 420cb5d

Please sign in to comment.