<commit_before>Index: config/FindHDF5.cmake
===================================================================
--- config/FindHDF5.cmake	(revision 7814)
+++ config/FindHDF5.cmake	(working copy)
@@ -82,7 +82,7 @@
 ENDIF(Hdf5_INCLUDE_DIRS)
 
 IF (WIN32 AND NOT UNIX)
-  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_" CACHE STRING "HDF5 defintions")
+  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_ -DH5_BUILT_AS_DYNAMIC_LIB" CACHE STRING "HDF5 defintions")
 ENDIF (WIN32 AND NOT UNIX)
 
 
Index: applications/dmrg/mps/CMakeLists.txt
===================================================================
--- applications/dmrg/mps/CMakeLists.txt	(revision 7814)
+++ applications/dmrg/mps/CMakeLists.txt	(working copy)
@@ -18,6 +18,9 @@
 
   list(APPEND ALPS_MPS_DEFINITIONS "-DDISABLE_MATRIX_ELEMENT_ITERATOR_WARNING")
   list(APPEND ALPS_MPS_DEFINITIONS "-DALPS_DISABLE_MATRIX_ELEMENT_ITERATOR_WARNING")
+  if(HDF5_DEFINITIONS)
+    list(APPEND ALPS_MPS_DEFINITIONS ${HDF5_DEFINITIONS})
+  endif(HDF5_DEFINITIONS)
 
   set(ALPS_MPS_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
 
Index: applications/dmrg/tebd/CMakeLists.txt
===================================================================
--- applications/dmrg/tebd/CMakeLists.txt	(revision 7814)
+++ applications/dmrg/tebd/CMakeLists.txt	(working copy)
@@ -11,6 +11,9 @@
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}")
   add_executable(tebd ${SOURCES})
   target_link_libraries(tebd ${HDF5_STATIC_LIBRARIES} ${HDF5_LIBRARIES} ${LAPACK_LIBRARY} ${BLAS_LIBRARY})
+  if(HDF5_DEFINITIONS)
+    set_target_properties(tebd PROPERTIES COMPILE_DEFINITIONS "${HDF5_DEFINITIONS}")
+  endif(HDF5_DEFINITIONS)
   install(TARGETS tebd RUNTIME DESTINATION bin COMPONENT applications)
 else(LAPACK_FOUND AND ALPS_BUILD_FORTRAN)
   message(STATUS "tebd will not be built")
Index: src/alps/CMakeLists.txt
===================================================================
--- src/alps/CMakeLists.txt	(revision 7814)
+++ src/alps/CMakeLists.txt	(working copy)
@@ -102,11 +102,16 @@
 endif (Boost_FOUND)
 
 if(BUILD_SHARED_LIBS)
-  set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS}")
+  if(HDF5_DEFINITIONS)
+    set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS} ${HDF5_DEFINITIONS}")
+  else(HDF5_DEFINITIONS)
+    set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS}")
+  endif(HDF5_DEFINITIONS)
 else(BUILD_SHARED_LIBS)<commit_msg>correct escape of hdf5 definitions<commit_after>Index: config/FindHDF5.cmake
===================================================================
--- config/FindHDF5.cmake	(revision 7814)
+++ config/FindHDF5.cmake	(working copy)
@@ -82,7 +82,7 @@
 ENDIF(Hdf5_INCLUDE_DIRS)
 
 IF (WIN32 AND NOT UNIX)
-  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_" CACHE STRING "HDF5 defintions")
+  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_;-DH5_BUILT_AS_DYNAMIC_LIB" CACHE STRING "HDF5 defintions")
 ENDIF (WIN32 AND NOT UNIX)
 
 
Index: applications/dmrg/mps/CMakeLists.txt
===================================================================
--- applications/dmrg/mps/CMakeLists.txt	(revision 7814)
+++ applications/dmrg/mps/CMakeLists.txt	(working copy)
@@ -18,6 +18,9 @@
 
   list(APPEND ALPS_MPS_DEFINITIONS "-DDISABLE_MATRIX_ELEMENT_ITERATOR_WARNING")
   list(APPEND ALPS_MPS_DEFINITIONS "-DALPS_DISABLE_MATRIX_ELEMENT_ITERATOR_WARNING")
+  if(HDF5_DEFINITIONS)
+    list(APPEND ALPS_MPS_DEFINITIONS ${HDF5_DEFINITIONS})
+  endif(HDF5_DEFINITIONS)
 
   set(ALPS_MPS_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
 
Index: applications/dmrg/tebd/CMakeLists.txt
===================================================================
--- applications/dmrg/tebd/CMakeLists.txt	(revision 7814)
+++ applications/dmrg/tebd/CMakeLists.txt	(working copy)
@@ -11,6 +11,13 @@
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}")
   add_executable(tebd ${SOURCES})
   target_link_libraries(tebd ${HDF5_STATIC_LIBRARIES} ${HDF5_LIBRARIES} ${LAPACK_LIBRARY} ${BLAS_LIBRARY})
+  if(HDF5_DEFINITIONS)
+    foreach (_hdf5_def ${HDF5_DEFINITIONS})
+      string(REPLACE "-D" "" _escaped_def ${_hdf5_def})
+      list(APPEND ALPS_TEBD_DEFINITIONS ${_escaped_def})
+    endforeach(_hdf5_def)
+    set_target_properties(tebd PROPERTIES COMPILE_DEFINITIONS "${ALPS_TEBD_DEFINITIONS}")
+  endif(HDF5_DEFINITIONS)
   install(TARGETS tebd RUNTIME DESTINATION bin COMPONENT applications)
 else(LAPACK_FOUND AND ALPS_BUILD_FORTRAN)
   message(STATUS "tebd will not be built")
Index: src/alps/CMakeLists.txt
===================================================================
--- src/alps/CMakeLists.txt	(revision 7814)
+++ src/alps/CMakeLists.txt	(working copy)
@@ -102,11 +102,19 @@
 endif (Boost_FOUND)
 
 if(BUILD_SHARED_LIBS)
+  if(HDF5_DEFINITIONS)
+    foreach (_hdf5_def ${HDF5_DEFINITIONS})
+      string(REPLACE "-D" "" _escaped_def ${_hdf5_def})
+      list(APPEND ALPS_SHARED_CPPFLAGS ${_escaped_def})
+    endforeach(_hdf5_def)
+  endif(HDF5_DEFINITIONS)
+  
   set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS}")
 else(BUILD_SHARED_LIBS)
{'fraction_non_alphanumeric': 0.21330991412958625, 'fraction_numerical': 0.029078844652615145, 'mean_word_length': 7.070866141732283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '940204', 'n_tokens_mistral': 2119, 'n_tokens_neox': 1925, 'n_words': 272}