Commit f4a28c4b by Liangfu Chen Committed by Thierry Moreau

[VTA] Fix TSIM compile error in Linux (add missing -fPIC flag) (#3876)

* [VTA] Fix TSIM compile error in Linux (add missing -fPIC flag);

* [VTA] Fix TSIM compile error in Linux (add missing -fPIC flag);

* fix indentation problem;
parent 6b0359b4
......@@ -82,7 +82,6 @@ cxx_flags += -I$(tvm_dir)/3rdparty/dlpack/include
ld_flags = -fPIC -shared
cxx_objs = $(verilator_build_dir)/verilated.o $(verilator_build_dir)/verilated_dpi.o $(verilator_build_dir)/tsim_device.o
cxx_objs += $(patsubst %.cpp,%.o,$(wildcard $(verilator_build_dir)/*.cpp))
ifneq ($(USE_TRACE), 0)
verilator_opt += --trace
......@@ -108,13 +107,16 @@ default: lib
lib: $(lib_path)
$(verilator_build_dir)/%.o: %.cpp
$(CXX) -c $(cxx_flags) $^ -o $@
$(CXX) -fPIC $(cxx_flags) -c $^ -o $@
$(verilator_build_dir)/tsim_device.o: tsim_device.cc
$(CXX) -c $(cxx_flags) $^ -o $@
$(CXX) -fPIC $(cxx_flags) -c $^ -o $@
$(lib_path): $(verilator_build_dir)/V$(TOP_TEST).cpp $(cxx_objs)
$(CXX) $(cxx_flags) $(ld_flags) $(cxx_objs) -o $@
for f in $(shell find $(verilator_build_dir)/*.cpp); do \
$(CXX) -fPIC $(cxx_flags) -c $${f} -o $${f}.o ; \
done
$(CXX) $(ld_flags) $(cxx_flags) $(cxx_objs) $(patsubst %.cpp,%.cpp.o,$(shell find $(verilator_build_dir)/*.cpp)) -o $@
verilator: $(verilator_build_dir)/V$(TOP_TEST).cpp
$(verilator_build_dir)/V$(TOP_TEST).cpp: $(chisel_build_dir)/$(TOP_TEST).$(CONFIG).v
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment