Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Static link tfhe-rs #9

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TFHE_RS_FOLDER=${ROOT_DIR}/tfhe-rs/
CGO_CFLAGS="-I${TFHE_RS_FOLDER}/target/release/"
CGO_LDFLAGS="-L${TFHE_RS_FOLDER}/target/release/"

.PHONY: build
build: build-tfhe-rs-capi
cd fhevm && CGO_CFLAGS="-I${TFHE_RS_FOLDER}/target/release/ -L${TFHE_RS_FOLDER}/target/release/" go build .
cd fhevm && CGO_CFLAGS=${CGO_CFLAGS} CGO_LDFLAGS=${CGO_LDFLAGS} go build .

.PHONY: test
test:
cd fhevm && go test -v .
cd fhevm && CGO_CFLAGS=${CGO_CFLAGS} CGO_LDFLAGS=${CGO_LDFLAGS} go test -v .

.PHONY: build-tfhe-rs-capi
build-tfhe-rs-capi:
Expand Down
2 changes: 1 addition & 1 deletion fhevm/tfhe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package fhevm

/*
#cgo CFLAGS: -O3 -I.
#cgo LDFLAGS: -Llib -ltfhe
#cgo LDFLAGS: -l:libtfhe.a -lm

#include <tfhe.h>

Expand Down