Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run SZ API code #114

Open
clodiamery opened this issue Aug 4, 2023 · 3 comments
Open

How to run SZ API code #114

clodiamery opened this issue Aug 4, 2023 · 3 comments

Comments

@clodiamery
Copy link

Hello,
I install SZ in this way

  1. mkdir build && cd build
    
  2. cmake .. -DCMAKE_INSTALL_PREFIX:PATH=[INSTALL_DIR]
    
  3. make
    
  4. make install
    

Then
cd example .
I need to use SZ API in my project.
If I use this command to compress the .dat file, it works correctly :
./testdouble_compress sz.config testdata/x86/testdouble_8_8_128.dat 8 8 128
Or
./testdouble_compress sz.config testdata/x86/testdouble_8_8_128.dat 8192

My problem I can't use txt file as input, if I use
./testdouble_compress sz.config testdata/x86/testdouble_8_8_128.txt 8 8 128

I got on Failed to open input file
Error: file testdata/x86/testdouble_8_8_128.txt 8 8 128 cannot be read.

Now I have two question:
1- How can I use txt file as input?
2- How can run (.c) program?
because I need to run (testdouble_compress.c) as .c file

Any help please?
Thanks,

@disheng222
Copy link
Collaborator

disheng222 commented Aug 6, 2023 via email

@clodiamery
Copy link
Author

Thanks Sheng,
I wanted to run the code in this issue
#93

I put the code writeCompressedDatatoTxt.c in example folder

I have no lib folder inside SZ directory why? how can build it correctly ?

@disheng222
Copy link
Collaborator

Well. You need to modify Makefile.am. The corresponding knowledge/skill is automake (or autotool). You can learn it from google. The basic steps are as follows:

  1. modify Makefile.am by adding the following line:
    writeCompressedDatatoTxt_SOURCES=writeCompressedDatatoTxt.c
    writeCompressedDatatoTxt_LDADD=../sz/.libs/libSZ.a ../zlib/.libs/libzlib.a ../zstd/.libs/libzstd.a -lm
  2. Create an executable file called autogen.sh under the root directory of the SZ project, and copy the following lines into it:
    #!/bin/bash

aclocal
libtoolize -f -c
autoconf
autoheader
automake -a
(You can use the following command make it executable: chmod +x autogen.sh)
3. Then, in the SZ root directory, run "./configure;make". You should be able to see the compiled file for writeCompressedDatatoTxt.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants