拥有hdf5.cc会导致Gem5构建出错?

时间:2019-11-19 10:45:04

标签: gem5

我将Gem5模拟从系统移至服务器。我的系统没有HDF5库,但是服务器具有HDF5库,并且遇到此错误:

/usr/local/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/space/src/Python-2.7/./Modules/posixmodule.c:7275: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/space/src/Python-2.7/./Modules/posixmodule.c:7230: warning: the use of `tempnam' is dangerous, better use `mkstemp'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, double)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:312: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::vector<char const*, std::allocator<char const*> > const&)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:280: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/X86/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::string const&)':
/net/nasstore/students/GRAD/ECE/febinps/home/Paper3/gem5/build/X86/base/stats/hdf5.cc:302: undefined reference to `H5::H5Object::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
collect2: error: ld returned 1 exit status
scons: *** [build/X86/gem5.opt] Error 1
scons: building terminated because of errors.

我该如何解决?是否可以避免使用HDF5进行构建?我无法在服务器上做很多事,因为我没有管理员权限。

3 个答案:

答案 0 :(得分:1)

在gem5 b383997d4a9c642dd4356bfc4554ac7ae183ae62(2020年3月)中的https://askubuntu.com/questions/1187343/installation-of-gem5-on-ubuntu-19-10-on-my-laptop-i5-cpu-m520-64bit解析之后,Ubuntu 19.10(GCC 9)构建对我有用:

scons -j `nproc` build/ARM/gem5.opt

如果您发现任何其他构建错误,请在Jira问题跟踪器上打开一个问题。

https://gem5-review.googlesource.com/c/public/gem5/+/34777之后,gem5应该每次在upstream testing system上使用HDF5进行构建,另请参见https://askubuntu.com/questions/350475/how-can-i-install-gem5/1275773#1275773,所以我认为它不会轻易再次损坏。

答案 1 :(得分:0)

我不知道此问题的根本原因,某些从事Gem5研究的人可能会回答。

但是作为一种解决方法,由于我没有对该服务器的管理员访问权限,并且即使只是为了一个构建而删除一个库也感觉不对,所以我在gem5 /中编辑了SConstruct文件,其中环境变量收集并通过:

have_hdf5 = 0 #check_hdf5() #line number 951 in the SConstruct file

这似乎适用于构建。

答案 2 :(得分:0)

如果您在Debian 10或Ubuntu 16.04等较旧的系统上运行,则错误是由于hdf5库路径不在默认系统库路径中这一事实造成的。我通过手动(残酷地)链接gem5解决了它。

添加的链接标志是: -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5_cpp -lhdf5

g++ -o /gem5/default/build/X86/gem5.opt \
    -Wl,--as-needed -fuse-ld=gold -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib \
    -Xlinker -export-dynamic \
    -Wl,-O1 -Wl,-Bsymbolic-functions -z origin -O3 \
    /gem5/default/build/X86/sim/main.o \
    /gem5/default/build/X86/dev/net/lib.o.partial \
    /gem5/default/build/X86/base/lib.o.partial \
    /gem5/default/build/X86/dev/i2c/lib.o.partial \
    /gem5/default/build/X86/cpu/testers/traffic_gen/lib.o.partial \
    /gem5/default/build/X86/mem/cache/tags/indexing_policies/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/slicc_interface/lib.o.partial \
    /gem5/default/build/X86/mem/probes/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/network/simple/lib.o.partial \
    /gem5/default/build/X86/dev/x86/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/network/fault_model/lib.o.partial \
    /gem5/default/build/X86/systemc/utils/lib.o.partial \
    /gem5/default/build/X86/systemc/dt/int/lib.o.partial \
    /gem5/default/build/X86/cpu/kvm/lib.o.partial \
    /gem5/default/build/X86/cpu/simple/probes/lib.o.partial \
    /gem5/default/build/X86/base/filters/lib.o.partial \
    /gem5/default/build/X86/dev/serial/lib.o.partial \
    /gem5/default/build/X86/sim/power/lib.o.partial \
    /gem5/default/build/X86/mem/cache/tags/lib.o.partial \
    /gem5/default/build/X86/arch/x86/bios/lib.o.partial \
    /gem5/default/build/X86/systemc/dt/fx/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/common/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/network/garnet2.0/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/structures/lib.o.partial \
    /gem5/default/build/X86/cpu/testers/garnet_synthetic_traffic/lib.o.partial \
    /gem5/default/build/X86/mem/cache/prefetch/lib.o.partial \
    /gem5/default/build/X86/cpu/trace/lib.o.partial \
    /gem5/default/build/X86/sim/probe/lib.o.partial \
    /gem5/default/build/X86/sim/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/protocol/lib.o.partial \
    /gem5/default/build/X86/systemc/tlm_core/2/quantum/lib.o.partial \
    /gem5/default/build/X86/cpu/simple/lib.o.partial \
    /gem5/default/build/X86/base/vnc/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/system/lib.o.partial \
    /gem5/default/build/X86/mem/cache/lib.o.partial \
    /gem5/default/build/X86/arch/x86/lib.o.partial \
    /gem5/default/build/X86/dev/storage/lib.o.partial \
    /gem5/default/build/X86/mem/protocol/lib.o.partial \
    /gem5/default/build/X86/systemc/core/lib.o.partial \
    /gem5/default/build/X86/systemc/tlm_core/2/generic_payload/lib.o.partial \
    /gem5/default/build/X86/cpu/testers/directedtest/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/profiler/lib.o.partial \
    /gem5/default/build/X86/arch/x86/regs/lib.o.partial \
    /gem5/default/build/X86/dev/pci/lib.o.partial \
    /gem5/default/build/X86/cpu/o3/probe/lib.o.partial \
    /gem5/default/build/X86/mem/cache/compressors/lib.o.partial \
    /gem5/default/build/X86/cpu/lib.o.partial \
    /gem5/default/build/X86/learning_gem5/part2/lib.o.partial \
    /gem5/default/build/X86/mem/cache/replacement_policies/lib.o.partial \
    /gem5/default/build/X86/dev/virtio/lib.o.partial \
    /gem5/default/build/X86/proto/lib.o.partial \
    /gem5/default/build/X86/cpu/testers/rubytest/lib.o.partial \
    /gem5/default/build/X86/mem/qos/lib.o.partial \
    /gem5/default/build/X86/cpu/pred/lib.o.partial \
    /gem5/default/build/X86/python/lib.o.partial \
    /gem5/default/build/X86/arch/generic/lib.o.partial \
    /gem5/default/build/X86/systemc/tlm_bridge/lib.o.partial \
    /gem5/default/build/X86/dev/lib.o.partial \
    /gem5/default/build/X86/kern/lib.o.partial \
    /gem5/default/build/X86/mem/lib.o.partial \
    /gem5/default/build/X86/cpu/testers/memtest/lib.o.partial \
    /gem5/default/build/X86/systemc/dt/misc/lib.o.partial \
    /gem5/default/build/X86/systemc/tlm_utils/lib.o.partial \
    /gem5/default/build/X86/cpu/o3/lib.o.partial \
    /gem5/default/build/X86/mem/ruby/network/lib.o.partial \
    /gem5/default/build/X86/systemc/dt/bit/lib.o.partial \
    /gem5/default/build/X86/dev/ps2/lib.o.partial \
    /gem5/default/build/X86/unittest/lib.o.partial \
    /gem5/default/build/X86/systemc/channel/lib.o.partial \
    /gem5/default/build/X86/systemc/dt/lib.o.partial \
    /gem5/default/build/X86/base/date.o \
    -L/gem5/default/build/libelf -L/gem5/default/build/fputils -L/gem5/default/build/libfdt -L/gem5/default/build/drampower -L/gem5/default/build/iostream3 -L/gem5/default/build/nomali -L/gem5/default/build/googletest -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ \
    -lpython2.7 -lpthread -ldl -lutil -lm -lz -lprotobuf -lrt -ltcmalloc -lnomali -liostream3 \
    -ldrampower -lfdt -lfputils -lelf -lhdf5_cpp -lhdf5