HDF5 linking errors

This commit is contained in:
jingang 2019-06-05 15:19:24 -04:00
parent 970aa6ea9a
commit 12b5f337d4
2 changed files with 8 additions and 0 deletions

View file

@ -272,6 +272,12 @@ if(GIT_SHA1_SUCCESS EQUAL 0)
target_compile_definitions(libopenmc PRIVATE -DGIT_SHA1="${GIT_SHA1}")
endif()
# To use the shared HDF5 libraries on Windows with Visual Studio,
# the H5_BUILT_AS_DYNAMIC_LIB compile definition must be specified.
if(MSVC)
target_compile_definitions(libopenmc PRIVATE -DH5_BUILT_AS_DYNAMIC_LIB)
endif()
# target_link_libraries treats any arguments starting with - but not -l as
# linker flags. Thus, we can pass both linker flags and libraries together.
target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}

View file

@ -792,6 +792,8 @@ const hid_t H5TypeMap<int>::type_id = H5T_NATIVE_INT;
template<>
const hid_t H5TypeMap<unsigned long>::type_id = H5T_NATIVE_ULONG;
template<>
const hid_t H5TypeMap<unsigned long long>::type_id = H5T_NATIVE_ULLONG;
template<>
const hid_t H5TypeMap<unsigned int>::type_id = H5T_NATIVE_UINT;
template<>
const hid_t H5TypeMap<int64_t>::type_id = H5T_NATIVE_INT64;