Closed nhz2 closed 2 months ago
With help from @mkitti I figured out how to compile the example.
$ cd ../examples
$ gcc -O3 -msse2 simple.c -I../blosc -o simple -Wl,-rpath=../build/blosc -L../build/blosc -lblosc
Note the added -lblosc
and -Wl,-rpath=../build/blosc
compared to the instructions in "simple.c"After these steps I get the expected output:
$ ./simple
Blosc version info: 1.21.7.dev ($Date:: 2024-06-24 #$)
Compression: 4000000 -> 36321 (110.1x)
Decompression successful!
Successful roundtrip!
A simpler variant, not using shared libraries, is
$ gcc simple.c -I../blosc -o simple ../build/libblosc.a
I also removed the unnecessary optimization flags in this example.
(The -Wl,rpath variant will pick up the system-wide installed libblosc.so for me)
That doesn't work for me, but
$ gcc simple.c -I../blosc -o simple ../build/blosc/libblosc.a
does.
Hello,
I am trying to run the example: "examples/simple.c" but I am having compiler errors.
I am new to using C libraries with
gcc
so I am probably missing something obvious.Here are the commands I ran.
I am trying to run the command in https://github.com/Blosc/c-blosc/blob/4f8541c8885bcba7d141ac1a270a9b5a6afe97d3/examples/simple.c#L12-L14
Is there a step I missed?