Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] cmake does not search for libblosc or libszip #2254

Closed
bmcandr opened this issue Mar 21, 2022 · 0 comments
Closed

[Bug] cmake does not search for libblosc or libszip #2254

bmcandr opened this issue Mar 21, 2022 · 0 comments

Comments

@bmcandr
Copy link

bmcandr commented Mar 21, 2022

Currently, cmake does not search for Blosc or SZip libraries due to use of bang (!) rather than NOT for negation on lines 1072 and 1084 of CMakeLists.txt:

netcdf-c/CMakeLists.txt

Lines 1071 to 1081 in 5265520

# See if we have libblosc
IF(!MSVC)
FIND_PACKAGE(Blosc)
ENDIF()
# Define a test flag for have blosc library
IF(Blosc_FOUND)
INCLUDE_DIRECTORIES(${Blosc_INCLUDE_DIRS})
SET(ENABLE_BLOSC TRUE)
ELSE()
SET(ENABLE_BLOSC FALSE)
ENDIF()

netcdf-c/CMakeLists.txt

Lines 1084 to 1095 in 5265520

IF(!MSVC)
#FIND_PACKAGE(SZIP)
#FIND_LIBRARY(SZIP PATH NAMES szip sz)
SET(SZIP_LIBRARY ${SZIP})
ENDIF()
# Define a test flag for have szip library
IF(SZIP_FOUND)
INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIRS})
SET(ENABLE_SZIP TRUE)
ELSE()
SET(ENABLE_SZIP FALSE)
ENDIF()

cmake's docs indicate negation is performed with the unary operator NOT: https://cmake.org/cmake/help/latest/command/if.html

I will open a pull request shortly to fix this.

Related to #2234 and Unidata/netcdf-fortran#328


Version: master branch (5265520)
OS: Mac OS 11.6.4 + 12.3, SUSE Linux Enterprise Server 12.3
Compiler: GCC 11.2.0

bmcandr added a commit to bmcandr/netcdf-c that referenced this issue Mar 21, 2022
cmake does not search for Blosc or SZip libraries due to use of bang (!) rather
than NOT for negation on lines 1072 and 1084 of CMakeLists.txt. This commit
fixes this issue.

Resolves Unidata#2254
@bmcandr bmcandr closed this as completed Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant