Hi,
I’m attempting to use the HDF5 library to read a texture to use with my CUDA code. I am NOT using Visual Studio. I try and compile with nvcc through the command line, but the paths are not being recognized and I have no idea of why. I attempted so many random things, nothing works. Here’s a few attempts and their output. I ran out of ideas! If anyone can point me to how these paths are intertwined and where it is looking for these libraries, I would appreciate it.
Thanks,
Simplified version of the code:
#include
#include <H5Cpp.h> // HDF5 library. Using v1.10.9 here.
int main() {
string H5_Filename = “mixing.h5”;
// Open HDF5 file handle, read only
H5File H5_File(H5_Filename.c_str(),H5F_ACC_RDONLY);
DataSet dataset = H5_File.openDataSet("Density_1000");
DataSpace dataspace = dataset.getSpace();
hsize_t rank;
hsize_t dims[1];
rank = dataspace.getSimpleExtentDims(dims); //
std::cout << "Data size: "<< dims[0] << std::endl; //
std::cout << "Data rank: "<< rank << std::endl; //
///I don't even know if this code works, because I can't compile the damn thing!
return 0;
}
Attempt 1 (no compiler options)
nvcc X.cu -o X
X.cu
X.cu(27): fatal error C1083: Cannot open include file: ‘H5Cpp.h’: No such file or directory
Attempt 2 (adding the HDF5 path)
nvcc X.cu -o CudaRaytracer11 -I “C:\Program Files\HDF_Group\HDF5\1.10.9\include” -I “C:\Program Files\HDF_Group\HDF5\1.10.9\bin” -I “C:\Program Files\HDF_Group\HDF5\1.10.9\lib”
X.cu
Creating library X.lib and object X.exp
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol H5open referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol H5check_version referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol "public: int __cdecl H5::DataSpace::getSimpleExtentDims(unsigned __int64 *,unsigned __int64 *)const " (?getSimpleExtentDims@DataSpace@H5@@QEBAHPEA_K0@Z) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: virtual __cdecl H5::DataSpace::~DataSpace(void)” (??1DataSpace@H5@@UEAA@XZ) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol "public: class H5::DataSet __cdecl H5::H5Location::openDataSet(char const *,class H5::DSetAccPropList const &)const " (?openDataSet@H5Location@H5@@QEBA?AVDataSet@2@PEBDAEBVDSetAccPropList@2@@Z) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol "public: virtual class H5::DataSpace __cdecl H5::DataSet::getSpace(void)const " (?getSpace@DataSet@H5@@UEBA?AVDataSpace@2@XZ) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: virtual __cdecl H5::DataSet::~DataSet(void)” (??1DataSet@H5@@UEAA@XZ) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: __cdecl H5::H5File::H5File(char const *,unsigned int,class H5::FileCreatPropList const &,class H5::FileAccPropList const &)” (??0H5File@H5@@QEAA@PEBDIAEBVFileCreatPropList@1@AEBVFileAccPropList@1@@Z) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: virtual __cdecl H5::H5File::~H5File(void)” (??1H5File@H5@@UEAA@XZ) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: static class H5::FileAccPropList const & const H5::FileAccPropList::DEFAULT” (?DEFAULT@FileAccPropList@H5@@2AEBV12@EB) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: static class H5::FileCreatPropList const & const H5::FileCreatPropList::DEFAULT” (?DEFAULT@FileCreatPropList@H5@@2AEBV12@EB) referenced in function main
tmpxft_00001a7c_00000000-19_CUDA_Raytracer_R11.obj : error LNK2019: unresolved external symbol “public: static class H5::DSetAccPropList const & const H5::DSetAccPropList::DEFAULT” (?DEFAULT@DSetAccPropList@H5@@2AEBV12@EB) referenced in function main
X.exe : fatal error LNK1120: 12 unresolved externals