Search code examples
gem5

Having hdf5.cc causes errors in Gem5 build?


I moved my Gem5 simulations from my system to a server. My system does not have HDF5 libraries, but the server has, and I am met with this error:

/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.

How can I fix this? Is there an yway I can avoid the build from using HDF5? I cannot do much at the server as I do not have admin access.


Solution

  • I don't know the root cause of this issue, some one who is working on Gem5 could possibly answer that.

    But as a workaround, since I have no admin access to the server ,and even then removing a library just for the sake of one build doesn't feel right, I edited the SConstruct file in gem5/, where the environment variables are gathered and passed:

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

    This seems to work for the build.