Hello All,
I wrote a program for data visualization in Python, for which data are stored in *.h5 format, and right now it’s working with h5py
python package. When I’m running my code however, loading data is the most time consuming part, so I was thinking about moving this part to c++ (with which I have basic experience).
My first question would be: is it actually worth the effort? Or h5py package is already well optimized and I won’t gain much?
Second issue: I already made an attempt, but hit the wall at very beginning. I was trying to write a code that just opens a file based on an example here, but I have a problem with includes and libraries.
I installed the HDF5 package using MacPorts (hdf5 version 1.12.0) and when I’m compiling I’m using:
clang++ -g -I<path_to_inlcude> -c main.cpp -o <project_path>/main.o
(for building)
clang++ -L<path_to_libs> -o <project_path>/bin/dl <project_path>/main.o <path_to_libs>/libhdf5_cpp.200.dylib
(for linking)
The above works when I’m not doing anything, but only I’ll try to open file using:
H5File file( FILE_NAME, H5F_ACC_RDONLY );
it returns while linking:
Undefined symbols for architecture x86_64:
"_H5check_version", referenced from:
_main in main.o
"_H5open", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know where is the mistake, or have a better example to follow?
Thank in advance for all help!