Skip to content

Commit

Permalink
statically link libblosc2 and libzstd to libzmat.a
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Sep 15, 2022
1 parent 9009aa1 commit ad4605d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ script:
octave-cli --eval "addpath(pwd);cd test;run_zmat_test";
fi
- ${MAKE} -C src lib
- ${MAKE} -C example/c static

- ${MAKE} -C src dll
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then
ls -lt lib;
cp lib/*.dll example/c;
cp lib/* example/c;
fi
- ${MAKE} -C example/c all
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
Expand Down
4 changes: 3 additions & 1 deletion example/c/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
LIBTYPE ?= dynamic

all:
$(CC) -g -Wall -pedantic testzmat.c -o testzmat -I../../include -L../../lib -lzmat -lz -lpthread
$(CC) -g -Wall -pedantic testzmat.c -o testzmat -I../../include -L../../lib -Wl,-B$(LIBTYPE) -lzmat -Wl,-Bdynamic -lz -lpthread
clean:
-rm -f testzmat
5 changes: 2 additions & 3 deletions example/c/testzmat.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
#include <string.h>

/**
* if only zlib/gzip/base64 is used, one only need to add -I/path/to/zmatlib.h
* if lzma/lzip is used, one must add -I/path/to/src/easylzma/
* if lz4/lz4hc is used, one must add -I/path/to/src/lz4
* to compile, one should add -I/path/to/zmatlib.h to the compilation command and
* -L/path/to/libzmat.so(or .a) -lzmat -lz -lpthread to the linking command
*/

#include "zmatlib.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ifeq ($(MAKECMDGOALS),lib)
ARFLAGS :=cr
BINARY :=libzmat.a
AROUTPUT :=
LINKOPT :=
LINKOPT :=blosc2/lib/libblosc2.a blosc2/internal-complibs/zstd-1.5.2/libzstd.a
OUTPUT_DIR :=$(LIBDIR)
ifeq ($(findstring Darwin,$(PLATFORM)), Darwin)
OUTPUTFLAG :=
Expand Down

0 comments on commit ad4605d

Please sign in to comment.