kubo / snzip

Snzip, a compression/decompression tool based on snappy
Other
217 stars 30 forks source link

Unknown file format name raw #31

Open RoccoMathijn opened 1 year ago

RoccoMathijn commented 1 year ago

Hi!

I'm working on an Apple M2. I have snappy 1.1.10 and snzip 1.0.5 installed via Homebrew, When I try to run a command using raw format I get an error. For example:

λ ~ snzip -t raw
Unknown file format name raw

Readme says The raw format support is enabled only when snzip is compiled for snappy 1.1.3 or upper. so I tried to compile from source but also then it's not working.

λ ~/Downloads/snzip-1.0.5 ./configure --with-snappy=/opt/homebrew/Cellar/snappy/1.1.10`
...
checking snappy::Uncompress(snappy::Source*, snappy::Sink*)... no
configure: WARNING: raw format is not supported with this snappy version.
...

Any ideas?

kubo commented 1 year ago

Could you post config.log to gist? It is created in the current directory when configure runs.

RoccoMathijn commented 1 year ago

Here you go 🙏 https://gist.github.com/RoccoMathijn/f0604a1ff2e21cefd59a6fc4d16afde1

kubo commented 1 year ago

Could you run the configure with CXXFLAGS=-std=c++11?

$ ./configure CXXFLAGS=-std=c++11

In config.log:

configure:5688: checking snappy::Uncompress(snappy::Source*, snappy::Sink*)
configure:5701: g++ -o conftest -g -O2 -Wall -I/opt/homebrew/Cellar/snappy/1.1.10/include   -L/opt/homebrew/Cellar/snappy/1.1.10/lib conftest.cpp -lsnappy  >&5
In file included from conftest.cpp:38:
/opt/homebrew/Cellar/snappy/1.1.10/include/snappy.h:212:10: error: unknown type name 'constexpr'
  static constexpr int kBlockLog = 16;
         ^

constexpr requires C++11 or later.

RoccoMathijn commented 1 year ago

Yes now it works!

For my understanding: Is this a bug in the Homebrew formula? Should that flag be set there?