pola-rs / tpch

MIT License
64 stars 36 forks source link

Add potential quick fix for macOS compilation error in README #54

Closed IndexSeek closed 1 year ago

IndexSeek commented 1 year ago

When trying to compile the tpch-dbgen tool on macOS, users may encounter the documented error related to the malloc.h header file. This is a known issue and is mentioned in the README.

To help to save time and effort for macOS users who encounter this issue and improve usability, would it be beneficial to provide this command as a shortcut?

sed -i.bak 's/#include <malloc.h>/#include <sys\/malloc.h>/g' tpch-dbgen/bm_utils.c tpch-dbgen/varsub.c

This command replaces the #include <malloc.h> line with #include <sys/malloc.h> in the bm_utils.c and varsub.c files.

ritchie46 commented 1 year ago

Does that have any implications for non-macos users? If it keeps working, it seems fine.

IndexSeek commented 1 year ago

If non-macOS users were to run the command, I believe they would need to discard the changes.

It may not be worthwhile to implement or mention; I just found myself using the shortcut. Just a shortcut to achieve the same result as this note in the README:

To fix this, change the import statement #include 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.