byronknoll / cmix

cmix is a lossless data compression program aimed at optimizing compression ratio at the cost of high CPU/memory usage.
http://www.byronknoll.com/cmix.html
GNU General Public License v3.0
601 stars 44 forks source link

how to run CMIX on linux #49

Closed science-fiktion closed 3 years ago

science-fiktion commented 3 years ago

Hi Knoll, CMIX is very impressed, compress ratio is several times than rar I have a short question, how to run CMIX on linux? read the doc, it only mentioned how to compile cmix on windows and I tried sudo apt install cmix , but it does not work. I am not a c++ coder, how can I compile cmix source code on linux system? thanks!

byronknoll commented 3 years ago

If you already have clang (a C++ compiler), you just need to cd into the cmix directory and type "make".

science-fiktion commented 3 years ago

CMIX is complied after install gcc, gdb, base-devel,clang. the compress and decompress process on linux looks faster than Win10

thanks byronknoll !

science-fiktion commented 3 years ago

I compressed a small txt(100k) file on win10( e.g cmix -c english.dic aaa.txt bbb.cmx ), I tried to decompress the file bbb.cmx on linux (arch 5.9.16-1) (e.g cmix -d english.dic bbb.cmx aaa_1.txt) it took 15 minutes decompress, got aaa_1.txt, but the aaa_1.txt is not matched with original aaa.txt, aaa_1.txt is filled with junk code, can not readable. on win10 I used "Windows Executable cmix-v18-windows.zip", on linux I used "Source Code cmix-v18.zip"

image

byronknoll commented 3 years ago

I think this is because the Windows executable and Linux executable were compiled with different options. In the makefile, "-Ofast -march=native" will make cmix run faster, but it might not be compatible with other executables. Compile with "-O3" to fix compatibility issues (at the cost of slower performance).

science-fiktion commented 3 years ago

after re-compiled CMIX with "-O3", tried to decompress the file bbb.cmx again on linux (arch 5.9.16-1) (e.g cmix -d english.dic bbb.cmx aaa_2.txt) it took more than 30 minutes(almost twice slower than early version ), got file aaa_2.txt, aaa_2.txt same as aaa_1.txt, it is still not readable

image

byronknoll commented 3 years ago

A couple other ideas: 1) Recompile the Windows executable to match the -O3 used for the Linux one. 2) Try testing compression+decompression both in Linux to see if that works.

science-fiktion commented 3 years ago

tried compile with diff parameter, it looks only win10‘s cmix compessed file can be decompressed on win10, arch linux can not decompress correctlly

byronknoll commented 3 years ago

That is unfortunate. I am not sure if you want to keep trying to get it working, but another idea is that the compiler is creating the issue:

1) Try compiling in g++ in both Windows and Linux, both with -O3 2) Try compiling with clang++ in both Windows and Linux, both with -O3

There should definitely be some method to get this compatible between computers, but it might be difficult.