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

build: use relative paths to tfhe-rs #11

Merged
merged 1 commit into from
Oct 13, 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
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +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=${CGO_CFLAGS} CGO_LDFLAGS=${CGO_LDFLAGS} go build .
cd fhevm && go build .

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

.PHONY: build-tfhe-rs-capi
build-tfhe-rs-capi:
cd tfhe-rs && make build_c_api_experimental_deterministic_fft

.PHONY: clean
clean:
cd tfhe-rs && cargo clean
4 changes: 2 additions & 2 deletions fhevm/tfhe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package fhevm

/*
#cgo CFLAGS: -O3 -I.
#cgo LDFLAGS: -l:libtfhe.a -lm
#cgo CFLAGS: -O3 -I../tfhe-rs/target/release
#cgo LDFLAGS: -L../tfhe-rs/target/release -l:libtfhe.a -lm

#include <tfhe.h>

Expand Down