hdf5.cc 导致 Gem5 构建错误?
Having hdf5.cc causes errors in Gem5 build?
我将我的 Gem5 模拟从我的系统转移到服务器。我的系统没有 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?我不能在服务器上做很多事情,因为我没有管理员权限。
我不知道这个问题的根本原因,可能有人在做 Gem5 可以回答这个问题。
但作为一种解决方法,由于我没有服务器的管理员访问权限,即使只是为了一个构建而删除库也感觉不对,我编辑了 gem5/ 中的 SConstruct 文件,其中收集并传递环境变量:
have_hdf5 = 0 #check_hdf5() #line number 951 in the SConstruct file
这似乎适用于构建。
解决以下问题后:https://askubuntu.com/questions/1187343/installation-of-gem5-on-ubuntu-19-10-on-my-laptop-i5-cpu-m520-64bit 在 gem5 b383997d4a9c642dd4356bfc4554ac7ae183ae62(2020 年 3 月)中 Ubuntu 19.10 (GCC 9) 构建对我有效:
scons -j `nproc` build/ARM/gem5.opt
如果您发现任何其他构建错误,请在 Jira 问题跟踪器上提出问题。
在 https://gem5-review.googlesource.com/c/public/gem5/+/34777 gem5 should be building every time with HDF5 on the upstream testing system see also https://askubuntu.com/questions/350475/how-can-i-install-gem5/1275773#1275773 之后,所以我认为它不会轻易再次破裂。
如果您 运行 在像 Debian 10 或 Ubuntu 16.04 这样的旧系统上,错误是由于 hdf5
库路径不在默认系统库路径中.我通过手动(粗暴地)解决了它 linking gem5 ...
添加的 link 标志是:
-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
我将我的 Gem5 模拟从我的系统转移到服务器。我的系统没有 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?我不能在服务器上做很多事情,因为我没有管理员权限。
我不知道这个问题的根本原因,可能有人在做 Gem5 可以回答这个问题。
但作为一种解决方法,由于我没有服务器的管理员访问权限,即使只是为了一个构建而删除库也感觉不对,我编辑了 gem5/ 中的 SConstruct 文件,其中收集并传递环境变量:
have_hdf5 = 0 #check_hdf5() #line number 951 in the SConstruct file
这似乎适用于构建。
解决以下问题后:https://askubuntu.com/questions/1187343/installation-of-gem5-on-ubuntu-19-10-on-my-laptop-i5-cpu-m520-64bit 在 gem5 b383997d4a9c642dd4356bfc4554ac7ae183ae62(2020 年 3 月)中 Ubuntu 19.10 (GCC 9) 构建对我有效:
scons -j `nproc` build/ARM/gem5.opt
如果您发现任何其他构建错误,请在 Jira 问题跟踪器上提出问题。
在 https://gem5-review.googlesource.com/c/public/gem5/+/34777 gem5 should be building every time with HDF5 on the upstream testing system see also https://askubuntu.com/questions/350475/how-can-i-install-gem5/1275773#1275773 之后,所以我认为它不会轻易再次破裂。
如果您 运行 在像 Debian 10 或 Ubuntu 16.04 这样的旧系统上,错误是由于 hdf5
库路径不在默认系统库路径中.我通过手动(粗暴地)解决了它 linking gem5 ...
添加的 link 标志是:
-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