Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,9 @@ ELSEIF(ENABLE_NCZARR)
ENDIF()
IF (ENABLE_FILTER_BZ2)
FIND_PACKAGE(Bz2)
IF(NOT Bz2_FOUND)
FIND_PACKAGE(BZip2)
ENDIF(NOT Bz2_FOUND)
Comment on lines 1148 to +1151
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Bz2" exists neither in this repo (after this PR) nor in CMake nor in Bzip2 (as CMake config).

Suggested change
FIND_PACKAGE(Bz2)
IF(NOT Bz2_FOUND)
FIND_PACKAGE(BZip2)
ENDIF(NOT Bz2_FOUND)
FIND_PACKAGE(BZip2)

ENDIF()
IF (ENABLE_FILTER_BLOSC)
FIND_PACKAGE(Blosc)
Expand All @@ -1154,22 +1157,26 @@ IF (ENABLE_FILTER_ZSTD)
FIND_PACKAGE(Zstd)
ENDIF()


# Accumulate standard filters
set(STD_FILTERS "deflate") # Always have deflate*/
set_std_filter(Szip)
SET(HAVE_SZ ${Szip_FOUND})
set_std_filter(Blosc)
IF(Zstd_FOUND)
set_std_filter(Zstd)

ENDIF()
Comment on lines +1168 to 1169
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cruft.

Suggested change
ENDIF()
ENDIF()

IF(Bz2_FOUND)
set_std_filter(Bz2)
ELSEIF(BZIP2_FOUND)
set_std_filter(BZIP2)
Comment on lines 1170 to +1173
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what set_std_filter does but it doesn't look like something I would change when I touch the dependency lookup. And there shouldn't be Bz2_FOUND after the other suggestion. Last not least the result variable has a different spelling.

Suggested change
IF(Bz2_FOUND)
set_std_filter(Bz2)
ELSEIF(BZIP2_FOUND)
set_std_filter(BZIP2)
IF(BZip2_FOUND)
set_std_filter(Bz2)

ELSE()
# The reason we use a local version is to support a more comples test case
MESSAGE("libbz2 not found using built-in version")
SET(HAVE_LOCAL_BZ2 ON)
SET(HAVE_BZ2 ON)
set(STD_FILTERS "${STD_FILTERS} bz2")
SET(HAVE_LOCAL_BZIP2 ON)
SET(HAVE_BZIP2 ON)
set(STD_FILTERS "${STD_FILTERS} bzip2")
Comment on lines +1177 to +1179
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less intrusive:

Suggested change
SET(HAVE_LOCAL_BZIP2 ON)
SET(HAVE_BZIP2 ON)
set(STD_FILTERS "${STD_FILTERS} bzip2")
SET(HAVE_LOCAL_BZ2 ON)
SET(HAVE_BZ2 ON)
set(STD_FILTERS "${STD_FILTERS} bz2")

ENDIF()

# If user wants, then install selected plugins (default on)
Expand Down Expand Up @@ -2604,7 +2611,8 @@ is_enabled(HAVE_SZ HAS_SZIP)
is_enabled(HAVE_SZ HAS_SZLIB_WRITE)
is_enabled(HAVE_ZSTD HAS_ZSTD)
is_enabled(HAVE_BLOSC HAS_BLOSC)
is_enabled(HAVE_BZ2 HAS_BZ2)
is_enabled(HAVE_BZIP2 HAS_BZIP2)
is_enabled(HAVE_BZIP2 HAS_BZ2)
Comment on lines +2614 to +2615
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
is_enabled(HAVE_BZIP2 HAS_BZIP2)
is_enabled(HAVE_BZIP2 HAS_BZ2)
is_enabled(HAVE_BZ2 HAS_BZ2)

is_enabled(ENABLE_REMOTE_FUNCTIONALITY DO_REMOTE_FUNCTIONALITY)

if(ENABLE_S3_INTERNAL)
Expand Down
64 changes: 0 additions & 64 deletions cmake/modules/FindBz2.cmake

This file was deleted.

64 changes: 0 additions & 64 deletions cmake/modules/FindBzip2.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions liblib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ ENDIF()
IF(Zstd_FOUND)
SET(TLL_LIBS ${TLL_LIBS} ${Zstd_LIBRARIES})
ENDIF()
IF(Bz2_FOUND)
SET(TLL_LIBS ${TLL_LIBS} ${Bz2_LIBRARIES})
IF(BZIP2_FOUND)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IF(BZIP2_FOUND)
IF(BZip2_FOUND)

SET(TLL_LIBS ${TLL_LIBS} ${BZIP2_LIBRARIES})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FindBzip2 module defines an imported library, so might be better to use that, as it will take care of the header locations too:

Suggested change
SET(TLL_LIBS ${TLL_LIBS} ${BZIP2_LIBRARIES})
SET(TLL_LIBS ${TLL_LIBS} BZip2::BZip2)

(and below on the buildplugin line)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it doesn't belong into TLL_LIBS at all: It is only used in the bzip2 "MODULE".

ENDIF()
IF(SZIP_FOUND)
SET(TLL_LIBS ${TLL_LIBS} ${SZIP_LIBRARIES})
Expand Down
6 changes: 3 additions & 3 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ IF(HAVE_SZ)
buildplugin(h5szip "h5szip" ${Szip_LIBRARIES})
ENDIF()

IF(HAVE_LOCAL_BZ2)
IF(HAVE_LOCAL_BZIP2)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IF(HAVE_LOCAL_BZIP2)
IF(HAVE_LOCAL_BZ2)

SET(h5bzip2_SOURCES H5Zbzip2.c blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c bzlib.h bzlib_private.h)
buildplugin(h5bzip2 "h5bzip2")
ELSE()
SET(h5bzip2_SOURCES H5Zbzip2.c)
buildplugin(h5bzip2 "h5bzip2" ${Bzip2_LIBRARIES})
buildplugin(h5bzip2 "h5bzip2" ${BZIP2_LIBRARIES})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
buildplugin(h5bzip2 "h5bzip2" ${BZIP2_LIBRARIES})
buildplugin(h5bzip2 "h5bzip2" BZip2::BZip2)

ENDIF()


Expand All @@ -117,7 +117,7 @@ MACRO(installplugin PLUG)
ENDMACRO()

install(DIRECTORY DESTINATION ${PLUGIN_INSTALL_DIR})
IF(Bzip2_FOUND)
IF(BZIP2_FOUND)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IF(BZIP2_FOUND)
IF(BZip2_FOUND)

installplugin(h5bzip2)
ENDIF()
IF(Zstd_FOUND)
Expand Down