szcompressor / SZ

Error-bounded Lossy Data Compressor (for floating-point/integer datasets)
http://szcompressor.org
Other
155 stars 56 forks source link

Undefined symbol _deflateInit_ when linking to SZ after make install #23

Closed williamfgc closed 6 years ago

williamfgc commented 6 years ago
mbpwfg:bin wfg$ ./TestBPWriteReadSZ 
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from BPWriteReadSZ
[ RUN      ] BPWriteReadSZ.ADIOS2BPWriteRead1D
debugMode:1
accuracy => 0.001
sz.max_quant_intervals: 65536
sz.quantization_intervals: 0
sz.sol_ID: 101
sz.sampleDistance: 100
sz.predThreshold: 0.99
sz.szMode: 1
sz.gzipMode: 1
sz.errorBoundMode: 0
sz.absErrBound: 0.001
sz.relBoundRatio: 0.001
sz.psnr: 80
sz.pw_relBoundRatio: 1e-05
sz.segment_size: 5
sz.pwr_type: 0
dyld: lazy symbol binding failed: Symbol not found: _deflateInit_
  Referenced from: /opt/sz/2.0.2.0/lib//libSZ.1.dylib
  Expected in: flat namespace

dyld: Symbol not found: _deflateInit_
  Referenced from: /opt/sz/2.0.2.0/lib//libSZ.1.dylib
  Expected in: flat namespace

Trace/BPT trap: 5

In fact, the symbols are undefined:

mbpwfg:bin wfg$ nm /opt/sz/2.0.2.0/lib/libSZ.dylib | grep deflateInit
                 U _deflateInit2_
                 U _deflateInit_
mbpwfg:bin wfg$ nm /opt/sz/2.0.2.0/lib/libSZ.1.dylib | grep deflateInit
                 U _deflateInit2_
                 U _deflateInit_
disheng222 commented 6 years ago

This error is likely because you didn't include zlib or zstd dynamic link. That is, you need to link libzlib.so and libzstd.so or something like this. They can be found in [SZ_INSTALL_PATH]/lib Hope this can solve the issue.