chipsalliance / VeeR-ISS

Apache License 2.0
114 stars 33 forks source link

ld error when make whisper. #17

Closed MasterJerryZh closed 2 years ago

MasterJerryZh commented 2 years ago

Hello, there are some error occur when I clone latest code and build it. I just use linux cmd "make" to build and install.

My OS version: ubuntu 18.04 g++ version: 7.5.0 boost lib version: 1.74 src version git hash: 6bbe3cd621e50e893fbe7d828e94dc76a6de8aef

The error info:

g++ -MMD -MP -mfma -std=c++17 -O3 -I. -fPIC -pedantic -Wall -Wextra -c -o build-Linux/SparseMem.cpp.o SparseMem.cpp g++ -MMD -MP -mfma -std=c++17 -O3 -I. -fPIC -pedantic -Wall -Wextra -c -o build-Linux/wideint.cpp.o wideint.cpp g++ -MMD -MP -mfma -std=c++17 -O3 -I. -fPIC -pedantic -Wall -Wextra -c -o build-Linux/PmpManager.cpp.o PmpManager.cpp gdb.cpp: In function ‘void sendPacketToGdb(const string&, int)’: gdb.cpp:215:12: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] write(fd, packet.data(), packet.size());


ar cr build-Linux/librvcore.a build-Linux/IntRegs.cpp.o build-Linux/CsRegs.cpp.o build-Linux/FpRegs.cpp.o build-Linux/instforms.cpp.o build-Linux/Memory.cpp.o build-Linux/Hart.cpp.o build-Linux/InstEntry.cpp.o build-Linux/Triggers.cpp.o build-Linux/PerfRegs.cpp.o build-Linux/gdb.cpp.o build-Linux/HartConfig.cpp.o build-Linux/Server.cpp.o build-Linux/Interactive.cpp.o build-Linux/decode.cpp.o build-Linux/disas.cpp.o build-Linux/Syscall.cpp.o build-Linux/PmaManager.cpp.o build-Linux/DecodedInst.cpp.o build-Linux/snapshot.cpp.o build-Linux/PmpManager.cpp.o build-Linux/VirtMem.cpp.o build-Linux/Core.cpp.o build-Linux/System.cpp.o build-Linux/Cache.cpp.o build-Linux/Tlb.cpp.o build-Linux/VecRegs.cpp.o build-Linux/vector.cpp.o build-Linux/wideint.cpp.o build-Linux/float.cpp.o build-Linux/bitmanip.cpp.o build-Linux/amo.cpp.o build-Linux/SparseMem.cpp.o build-Linux/InstProfile.cpp.o
g++ -o build-Linux/whisper build-Linux/whisper.cpp.o build-Linux/librvcore.a  -l:libboost_program_options.a -lpthread -lz -static-libstdc++ -lstdc++fs
build-Linux/librvcore.a(Hart.cpp.o): In function `void addToFpHistogram<float>(std::vector<unsigned long, std::allocator<unsigned long> >&, float)':
Hart.cpp:(.text._Z16addToFpHistogramIfEvRSt6vectorImSaImEET_[_Z16addToFpHistogramIfEvRSt6vectorImSaImEET_]+0x1e): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<float>(float)'
build-Linux/librvcore.a(Hart.cpp.o): In function `void addToFpHistogram<double>(std::vector<unsigned long, std::allocator<unsigned long> >&, double)':
Hart.cpp:(.text._Z16addToFpHistogramIdEvRSt6vectorImSaImEET_[_Z16addToFpHistogramIdEvRSt6vectorImSaImEET_]+0x1e): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<double>(double)'
build-Linux/librvcore.a(vector.cpp.o): In function `WdRiscv::Hart<unsigned int>::execVfclass_v(WdRiscv::DecodedInst const*)':
vector.cpp:(.text._ZN7WdRiscv4HartIjE13execVfclass_vEPKNS_11DecodedInstE[_ZN7WdRiscv4HartIjE13execVfclass_vEPKNS_11DecodedInstE]+0x3ce): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<float>(float)'
vector.cpp:(.text._ZN7WdRiscv4HartIjE13execVfclass_vEPKNS_11DecodedInstE[_ZN7WdRiscv4HartIjE13execVfclass_vEPKNS_11DecodedInstE]+0x44e): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<double>(double)'
build-Linux/librvcore.a(vector.cpp.o): In function `WdRiscv::Hart<unsigned long>::execVfclass_v(WdRiscv::DecodedInst const*)':
vector.cpp:(.text._ZN7WdRiscv4HartImE13execVfclass_vEPKNS_11DecodedInstE[_ZN7WdRiscv4HartImE13execVfclass_vEPKNS_11DecodedInstE]+0x3ce): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<float>(float)'
vector.cpp:(.text._ZN7WdRiscv4HartImE13execVfclass_vEPKNS_11DecodedInstE[_ZN7WdRiscv4HartImE13execVfclass_vEPKNS_11DecodedInstE]+0x44e): undefined reference to `unsigned int WdRiscv::fpClassifyRiscv<double>(double)'
collect2: error: ld returned 1 exit status
GNUmakefile:109: recipe for target 'build-Linux/whisper' failed
make: *** [build-Linux/whisper] Error 1

I have try to build in other two history that Sep 29, 2021 88fdb9c63308ac2cd5e4d977acee5a18848dbc65 and Aug 24, 2021 980353a1f9372da37ddb9f1355875d83d888c6c1, it can passed and there is no error and whipser can be used normally. Could you help me solve my problem? Please.
aprnath commented 2 years ago

The build completes cleanly for us using Ubuntu 20.4 and g++ 9.3.0 We will try to figure out the issue.

MasterJerryZh commented 2 years ago

I look forward to your early settlement of this error. Thanks.

aprnath commented 2 years ago

We were able to reproduce the error on Ubuntu 18.04 and gcc 7.4. We will update a fix soon.

aprnath commented 2 years ago

Fix has been pushed.