mirror of
https://github.com/luxfhe/torus.git
synced 2026-10-30 17:07:26 +00:00
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI, ConcreteToLLVM), the optimizer component, the compiler binary, the Rust crate and the program_info parameter file all still carried the upstream project's name. They now carry this one's. Two things deliberately keep the word, because in them it is not the name. mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled Derived and OpTy — LLVM's other conventional spelling for the same idiom. concreteShape is a capnp field: renaming it would change the serialized protocol, and the prose describing it is ordinary English. This also repairs references the earlier partial rename left dangling: Security.cpp included concrete/curves.gen.h and the directory is torus/, torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages for a "concrete" package that no longer exists — so it built without the package it ships.
51 lines
1.8 KiB
Makefile
51 lines
1.8 KiB
Makefile
# dev or release
|
|
CARGO_PROFILE ?= release
|
|
# debug or release
|
|
PROFILE_SUBDIR ?= release
|
|
|
|
MAKEFILE_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
ROOT = $(realpath $(MAKEFILE_DIR)/..)
|
|
CXXBRIDGE_DIR = $(ROOT)/target/cxxbridge/torus-optimizer-cpp/src
|
|
|
|
# In target intermediate files
|
|
INTERFACE_LIB_ORIG = $(ROOT)/target/$(PROFILE_SUBDIR)/libtorus_optimizer_cpp.a
|
|
INTERFACE_HEADER_ORIG = $(CXXBRIDGE_DIR)/torus-optimizer.rs.h
|
|
INTERFACE_CPP_ORIG = $(CXXBRIDGE_DIR)/torus-optimizer.rs.cc
|
|
|
|
# Final files
|
|
INTERFACE_LIB = $(ROOT)/target/libtorus_optimizer_cpp.a
|
|
INTERFACE_HEADER = src/cpp/torus-optimizer.hpp
|
|
INTERFACE_CPP = src/cpp/torus-optimizer.cpp
|
|
|
|
SOURCES = $(shell find $(ROOT)/torus-optimizer/src) \
|
|
$(shell find $(ROOT)/torus-optimizer-cpp/src -name '*.rs')
|
|
|
|
build: $(INTERFACE_LIB) $(INTERFACE_CPP) $(INTERFACE_HEADER)
|
|
|
|
$(INTERFACE_LIB_ORIG) $(INTERFACE_HEADER_ORIG) $(INTERFACE_CPP_ORIG): $(SOURCES)
|
|
cd $(ROOT) && cargo build -p torus-optimizer-cpp --profile $(CARGO_PROFILE)
|
|
|
|
$(INTERFACE_HEADER): $(INTERFACE_HEADER_ORIG)
|
|
cp $< $@
|
|
|
|
$(INTERFACE_CPP): $(INTERFACE_CPP_ORIG)
|
|
cp $< $@
|
|
|
|
$(INTERFACE_LIB): $(INTERFACE_LIB_ORIG)
|
|
cp $< $@
|
|
|
|
TESTS_SOURCES = tests/src/main.cpp
|
|
TEST_DEP_LIBS = -l pthread -ldl
|
|
tests/tests_exe: $(INTERFACE_LIB) $(INTERFACE_HEADER) $(INTERFACE_CPP) $(TESTS_SOURCES)
|
|
g++ -Wall -Werror -Wextra -std=c++17 -o $@ $(TESTS_SOURCES) $(INTERFACE_CPP) $(INTERFACE_LIB) -I $(shell dirname $(INTERFACE_HEADER)) $(TEST_DEP_LIBS)
|
|
chmod +x $@
|
|
|
|
test: tests/tests_exe
|
|
./tests/tests_exe
|
|
|
|
test-ci:
|
|
# force regeneration of sources
|
|
rm -rf $(INTERFACE_HEADER) $(INTERFACE_CPP) $(INTERFACE_HEADER_ORIG) $(INTERFACE_CPP_ORIG)
|
|
$(MAKE) CARGO_PROFILE=dev PROFILE_SUBDIR=debug test
|
|
git diff --exit-code src/cpp || (echo Please commit the new version of generated files && exit 1)
|