Commit dc54e4a4 authored by Jan Kotanski's avatar Jan Kotanski
Browse files

New upstream version 1.10.6

parent 2ef980bd
*.swp
build
\ No newline at end of file
This diff is collapsed.
......@@ -9,21 +9,21 @@ set (CTEST_NIGHTLY_START_TIME "18:00:00 CST")
set (CTEST_DROP_METHOD "http")
if (CDASH_LOCAL)
set (CTEST_DROP_SITE "10.10.10.82")
set (CTEST_DROP_SITE "cdash-internal.hdfgroup.org")
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5PLUGINS")
else (CDASH_LOCAL)
else ()
set (CTEST_DROP_SITE "cdash.hdfgroup.org")
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5PLUGINS")
endif (CDASH_LOCAL)
endif ()
set (CTEST_DROP_SITE_CDASH TRUE)
set (UPDATE_TYPE svn)
set (UPDATE_TYPE git)
set (VALGRIND_COMMAND "/usr/bin/valgrind")
set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
set (CTEST_TEST_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
set (DART_TESTING_TIMEOUT 3600 CACHE STRING
set (CTEST_TEST_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
set (DART_TESTING_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test." FORCE)
set (CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING
......
Building this filter/example requires knowledge of the hdf5 and the blosc
Building this filter/example requires knowledge of the hdf5 and the blosc
installation.
For autotools configure, you must supply these using
For autotools configure, you must supply these using
--with-hdf5 and --with-blosclib.
Example (in the build folder):
../configure --with-hdf5=/temp/hdf5 --with-blosclib=/temp/blosc
For CMake, you must supply the location of the cmake configuration files
in environment variables. Also, h5dump will need the location of the
hdf5 and blosc libraries.
For CMake, you must supply the location of the cmake configuration files
in environment variables.
In addition, CMake options "BUILD_EXAMPLES" and "BUILD_TESTING" must
be set "ON" in order to build the example and run the tests.
Example:
......@@ -16,9 +15,8 @@ Example:
set(ENV{BLOSC_DIR} "/temp/blosc/share/cmake/blosc")
set(ENV{LD_LIBRARY_PATH} "/temp/blosc/lib:/temp/hdf5/lib")
set(ADD_BUILD_OPTIONS "-DBUILD_EXAMPLES:BOOL=ON -DBUILD_TESTING:BOOL=ON")
For non-cmake built hdf5 or blosc, use the location of the include/lib
folders:
set(ENV{HDF5_ROOT} "/temp/hdf5")
set(ENV{BLOSC_ROOT} "/temp/blosc")
\ No newline at end of file
This diff is collapsed.
......@@ -16,11 +16,11 @@
# blosc currently uses the following versions of the autotools:
AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.69"
AUTOMAKE_VERSION="automake (GNU automake) 1.12.3"
AUTOMAKE_VERSION="automake (GNU automake) 1.14.1"
AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.69"
ACLOCAL_VERSION="aclocal (GNU automake) 1.12.3"
ACLOCAL_VERSION="aclocal (GNU automake) 1.14.1"
LIBTOOL_VERSION="(GNU libtool) 2.4.2"
M4_VERSION="m4 (GNU M4) 1.4.16"
M4_VERSION="m4 (GNU M4) 1.4.17"
#
# When upgrading automake's version, don't forget to also update its
......@@ -34,19 +34,19 @@ if test -z ${AUTOCONF}; then
AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoconf
fi
if test -z ${AUTOMAKE}; then
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.12.3/bin/automake-1.12
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.14.1/bin/automake-1.14
fi
if test -z ${AUTOHEADER}; then
AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoheader
fi
if test -z ${ACLOCAL}; then
ACLOCAL=/mnt/hdf/packages/automake/automake-1.12.3/bin/aclocal-1.12
ACLOCAL=/mnt/hdf/packages/automake/automake-1.14.1/bin/aclocal-1.14
fi
if test -z ${LIBTOOL}; then
LIBTOOL=/mnt/hdf/packages/libtool/libtool-2.4.2/bin/libtool
fi
if test -z ${M4}; then
M4=/mnt/hdf/packages/m4/m4-1.4.16/bin/m4
M4=/mnt/hdf/packages/m4/m4-1.4.17/bin/m4
fi
# Check version numbers of all autotools against the "correct" versions
......
/*
* Dynamically loaded filter plugin for HDF5 blosc filter.
* Copyright (C) 2016 The THG Group
* Author: Francesc Alted
* Date: 2016-09-27
*
*/
#ifndef BLOSC_VERSION_H
#define BLOSC_VERSION_H
/* Version numbers */
#define BLOSC_PLUGIN_VERSION_MAJOR 1 /* for major interface/format changes */
#define BLOSC_PLUGIN_VERSION_MINOR 0 /* for minor interface/format changes */
#define BLOSC_PLUGIN_VERSION_INTERFACE 0 /* */
#define BLOSC_PLUGIN_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */
#define BLOSC_PLUGIN_VERSION_STRING "1.0.0-dev" /* string version. Sync with above! */
#define BLOSC_PLUGIN_VERSION_DATE "2016-09-03 #$" /* date version */
#endif // BLOSC_VERSION_H
#-----------------------------------------------------------------------------
# Include all the necessary files for macros
#-----------------------------------------------------------------------------
include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake)
if(CMAKE_CXX_COMPILER)
include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
endif(CMAKE_CXX_COMPILER)
include (CheckFunctionExists)
include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckVariableExists)
include (TestBigEndian)
#-----------------------------------------------------------------------------
# APPLE/Darwin setup
......@@ -25,30 +22,30 @@ if (APPLE)
"and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'"
"variable has been set to a blank value which will build the default architecture for this system.")
endif ()
set (${H5BLOSC_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0)
endif (APPLE)
set (AC_APPLE_UNIVERSAL_BUILD 0)
endif ()
# Check for Darwin (not just Apple - we also want to catch OpenDarwin)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (${H5BLOSC_PREFIX}_HAVE_DARWIN 1)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (HAVE_DARWIN 1)
endif ()
# Check for Solaris
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (${H5BLOSC_PREFIX}_HAVE_SOLARIS 1)
endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (HAVE_SOLARIS 1)
endif ()
#-----------------------------------------------------------------------------
# This MACRO checks IF the symbol exists in the library and IF it
# does, it appends library to the list.
#-----------------------------------------------------------------------------
set (LINK_LIBS "")
MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE})
if (${VARIABLE})
set (LINK_LIBS ${LINK_LIBS} ${LIBRARY})
endif (${VARIABLE})
ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT)
endif ()
endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
......@@ -57,169 +54,158 @@ ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT)
set (WINDOWS)
if (WIN32)
if (MINGW)
set (${H5BLOSC_PREFIX}_HAVE_MINGW 1)
set (HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
endif (MINGW)
set (${H5BLOSC_PREFIX}_HAVE_WIN32_API 1)
set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
endif ()
set (HAVE_WIN32_API 1)
set (LINK_LIBS "ws2_32.lib;wsock32.lib")
if (NOT UNIX AND NOT MINGW)
set (WINDOWS 1)
set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
if (MSVC)
set (${H5BLOSC_PREFIX}_HAVE_VISUAL_STUDIO 1)
endif (MSVC)
endif (NOT UNIX AND NOT MINGW)
endif (WIN32)
set (HAVE_VISUAL_STUDIO 1)
endif ()
endif ()
endif ()
if (WINDOWS)
set (${H5BLOSC_PREFIX}_HAVE_STDDEF_H 1)
set (${H5BLOSC_PREFIX}_HAVE_SYS_STAT_H 1)
set (${H5BLOSC_PREFIX}_HAVE_SYS_TYPES_H 1)
set (${H5BLOSC_PREFIX}_HAVE_LIBM 1)
set (${H5BLOSC_PREFIX}_HAVE_STRDUP 1)
set (${H5BLOSC_PREFIX}_HAVE_SYSTEM 1)
set (${H5BLOSC_PREFIX}_HAVE_LONGJMP 1)
set (HAVE_STDDEF_H 1)
set (HAVE_SYS_STAT_H 1)
set (HAVE_SYS_TYPES_H 1)
set (HAVE_LIBM 1)
set (HAVE_SYSTEM 1)
if (NOT MINGW)
set (${H5BLOSC_PREFIX}_HAVE_GETHOSTNAME 1)
endif (NOT MINGW)
set (${H5BLOSC_PREFIX}_HAVE_FUNCTION 1)
set (${H5BLOSC_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
set (${H5BLOSC_PREFIX}_HAVE_TIMEZONE 1)
set (${H5BLOSC_PREFIX}_HAVE_GETTIMEOFDAY 1)
set (HAVE_GETHOSTNAME 1)
endif ()
if (MINGW)
set (${H5BLOSC_PREFIX}_HAVE_WINSOCK2_H 1)
endif (MINGW)
set (${H5BLOSC_PREFIX}_HAVE_LIBWS2_32 1)
set (${H5BLOSC_PREFIX}_HAVE_LIBWSOCK32 1)
endif (WINDOWS)
set (HAVE_WINSOCK2_H 1)
endif ()
set (HAVE_LIBWS2_32 1)
set (HAVE_LIBWSOCK32 1)
endif ()
# ----------------------------------------------------------------------
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
if (NOT WINDOWS)
TEST_BIG_ENDIAN (WORDS_BIGENDIAN)
endif ()
#-----------------------------------------------------------------------------
# Check IF header file exists and add it to the list.
#-----------------------------------------------------------------------------
macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
if (${VARIABLE})
set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
endif ()
endmacro ()
#-----------------------------------------------------------------------------
# Check for the existence of certain header files
#-----------------------------------------------------------------------------
CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("stddef.h" HAVE_STDDEF_H)
CHECK_INCLUDE_FILE_CONCAT ("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" HAVE_UNISTD_H)
# IF the c compiler found stdint, check the C++ as well. On some systems this
# file will be found by C but not C++, only do this test IF the C++ compiler
# has been initialized (e.g. the project also includes some c++)
if (HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
CHECK_INCLUDE_FILE_CXX ("stdint.h" HAVE_STDINT_H_CXX)
if (NOT HAVE_STDINT_H_CXX)
set (HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
endif ()
endif ()
# Windows
CHECK_INCLUDE_FILE_CONCAT ("io.h" HAVE_IO_H)
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" HAVE_WINSOCK_H)
endif ()
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" HAVE_PTHREAD_H)
CHECK_INCLUDE_FILE_CONCAT ("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILE_CONCAT ("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" HAVE_DLFCN_H)
CHECK_INCLUDE_FILE_CONCAT ("fcntl.h" HAVE_FCNTL_H)
CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" HAVE_INTTYPES_H)
#-----------------------------------------------------------------------------
# Check for the math library "m"
#-----------------------------------------------------------------------------
if (NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${H5BLOSC_PREFIX}_HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${H5BLOSC_PREFIX}_HAVE_LIBWS2_32)
CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${H5BLOSC_PREFIX}_HAVE_LIBWSOCK32)
endif (NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup HAVE_LIBWS2_32)
CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname HAVE_LIBWSOCK32)
endif ()
# UCB (BSD) compatibility library
CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB)
# For other tests to use the same libraries
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS})
CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname HAVE_LIBUCB)
set (USE_INCLUDES "")
if (WINDOWS)
set (USE_INCLUDES ${USE_INCLUDES} "windows.h")
endif (WINDOWS)
endif ()
# For other other specific tests, use this MACRO.
MACRO (H5BLOSC_FUNCTION_TEST OTHER_TEST)
if ("${H5BLOSC_PREFIX}_${OTHER_TEST}" MATCHES "^${H5BLOSC_PREFIX}_${OTHER_TEST}$")
# For other specific tests, use this MACRO.
macro (H5BLOSC_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
set (OTHER_TEST_ADD_LIBRARIES)
if (CMAKE_REQUIRED_LIBRARIES)
set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif (CMAKE_REQUIRED_LIBRARIES)
foreach (def ${H5BLOSC_EXTRA_TEST_DEFINITIONS})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}")
endforeach (def)
endforeach ()
foreach (def
HAVE_SYS_TIME_H
HAVE_UNISTD_H
HAVE_SYS_TYPES_H
HAVE_SYS_SOCKET_H
)
if ("${${H5BLOSC_PREFIX}_${def}}")
if ("${${def}}")
set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}")
endif ("${${H5BLOSC_PREFIX}_${def}}")
endforeach (def)
endif ()
endforeach ()
if (LARGEFILE)
set (MACRO_CHECK_FUNCTION_DEFINITIONS
"${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif (LARGEFILE)
endif ()
#message (STATUS "Performing ${OTHER_TEST}")
try_compile (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${H5BLOSC_RESOURCES_DIR}/H5BLOSCTests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${OTHER_TEST_ADD_LIBRARIES}"
${H5BLOSC_RESOURCES_DIR}/H5PLTests.c
COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
LINK_LIBRARIES "${LINK_LIBS}"
OUTPUT_VARIABLE OUTPUT
)
if (${OTHER_TEST})
set (${H5BLOSC_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}")
set (${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}")
message (STATUS "Performing Other Test ${OTHER_TEST} - Success")
else (${OTHER_TEST})
else ()
message (STATUS "Performing Other Test ${OTHER_TEST} - Failed")
set (${H5BLOSC_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}")
set (${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Other Test ${OTHER_TEST} failed with the following output:\n"
"${OUTPUT}\n"
)
endif (${OTHER_TEST})
endif ("${H5BLOSC_PREFIX}_${OTHER_TEST}" MATCHES "^${H5BLOSC_PREFIX}_${OTHER_TEST}$")
ENDMACRO (H5BLOSC_FUNCTION_TEST)
endif ()
endif ()
endmacro ()
H5BLOSC_FUNCTION_TEST (STDC_HEADERS)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Check IF header file exists and add it to the list.
#-----------------------------------------------------------------------------
MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
if (${VARIABLE})
set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
endif (${VARIABLE})
ENDMACRO (CHECK_INCLUDE_FILE_CONCAT)
#-----------------------------------------------------------------------------
# Check for the existence of certain header files
#-----------------------------------------------------------------------------
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${H5BLOSC_PREFIX}_HAVE_UNISTD_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${H5BLOSC_PREFIX}_HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${H5BLOSC_PREFIX}_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${H5BLOSC_PREFIX}_HAVE_STDDEF_H)
CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${H5BLOSC_PREFIX}_HAVE_STDINT_H)
# IF the c compiler found stdint, check the C++ as well. On some systems this
# file will be found by C but not C++, only do this test IF the C++ compiler
# has been initialized (e.g. the project also includes some c++)
if (${H5BLOSC_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
CHECK_INCLUDE_FILE_CXX ("stdint.h" ${H5BLOSC_PREFIX}_HAVE_STDINT_H_CXX)
if (NOT ${H5BLOSC_PREFIX}_HAVE_STDINT_H_CXX)
set (${H5BLOSC_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H")
set (USE_INCLUDES ${USE_INCLUDES} "stdint.h")
endif (NOT ${H5BLOSC_PREFIX}_HAVE_STDINT_H_CXX)
endif (${H5BLOSC_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
# Windows
CHECK_INCLUDE_FILE_CONCAT ("io.h" ${H5BLOSC_PREFIX}_HAVE_IO_H)
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${H5BLOSC_PREFIX}_HAVE_WINSOCK_H)
endif (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${H5BLOSC_PREFIX}_HAVE_PTHREAD_H)
CHECK_INCLUDE_FILE_CONCAT ("string.h" ${H5BLOSC_PREFIX}_HAVE_STRING_H)
CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${H5BLOSC_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("time.h" ${H5BLOSC_PREFIX}_HAVE_TIME_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${H5BLOSC_PREFIX}_HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${H5BLOSC_PREFIX}_HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${H5BLOSC_PREFIX}_HAVE_DLFCN_H)
CHECK_INCLUDE_FILE_CONCAT ("fcntl.h" ${H5BLOSC_PREFIX}_HAVE_FCNTL_H)
CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${H5BLOSC_PREFIX}_HAVE_INTTYPES_H)
#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
......@@ -230,76 +216,56 @@ set (LINUX_LFS 0)
set (H5BLOSC_EXTRA_C_FLAGS)
set (H5BLOSC_EXTRA_FLAGS)
if (NOT WINDOWS)
if (NOT ${H5BLOSC_PREFIX}_HAVE_SOLARIS)
if (NOT HAVE_SOLARIS)
# Linux Specific flags
# This was originally defined as _POSIX_SOURCE which was updated to
# _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
# functionality so clock_gettime and CLOCK_MONOTONIC are defined
# correctly.
# POSIX feature information can be found in the gcc manual at:
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
set (H5BLOSC_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L)
# _BSD_SOURCE deprecated in GLIBC >= 2.20
try_run (HAVE_DEFAULT_SOURCE_RUN HAVE_DEFAULT_SOURCE_COMPILE
${CMAKE_BINARY_DIR}
${H5BLOSC_RESOURCES_DIR}/H5BLOSCTests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DHAVE_DEFAULT_SOURCE
OUTPUT_VARIABLE OUTPUT
)
if (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
set (H5BLOSC_EXTRA_FLAGS -D_DEFAULT_SOURCE)
else (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
set (H5BLOSC_EXTRA_FLAGS -D_BSD_SOURCE)
endif (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
set (H5BLOSC_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L)
option (H5BLOSC_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
if (H5BLOSC_ENABLE_LARGE_FILE)
if (H5BLOSC_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN)
set (msg "Performing TEST_LFS_WORKS")
try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${H5BLOSC_RESOURCES_DIR}/H5BLOSCTests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
OUTPUT_VARIABLE OUTPUT
${H5BLOSC_RESOURCES_DIR}/H5PLTests.c
COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
)
if (TEST_LFS_WORKS_COMPILE)
if (TEST_LFS_WORKS_RUN MATCHES 0)
if (TEST_LFS_WORKS_RUN MATCHES 0)
set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg})
set (LARGEFILE 1)
set (H5BLOSC_EXTRA_FLAGS ${H5BLOSC_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
message (STATUS "${msg}... yes")
else (TEST_LFS_WORKS_RUN MATCHES 0)
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n"
"Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
)
endif (TEST_LFS_WORKS_RUN MATCHES 0)
else (TEST_LFS_WORKS_COMPILE )
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
message (STATUS "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n"
"Test TEST_LFS_WORKS Compile failed\n"
)
endif (TEST_LFS_WORKS_COMPILE)
endif (H5BLOSC_ENABLE_LARGE_FILE)
set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
endif (NOT ${H5BLOSC_PREFIX}_HAVE_SOLARIS)
endif (NOT WINDOWS)
endif ()
endif ()
set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${H5BLOSC_EXTRA_FLAGS})
endif ()
endif ()
add_definitions (${H5BLOSC_EXTRA_FLAGS})
#-----------------------------------------------------------------------------
# Check for some functions that are used
#
CHECK_FUNCTION_EXISTS (vprintf HAVE_VPRINTF)
CHECK_FUNCTION_EXISTS (_doprnt HAVE_DOPRNT)
CHECK_FUNCTION_EXISTS (memset HAVE_MEMSET)
if (NOT WINDOWS)
foreach (test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
CXX_HAVE_OFFSETOF
)
H5BLOSC_FUNCTION_TEST (${test})
endforeach (test)
endif (NOT WINDOWS)
endforeach ()
endif ()
find_path(LZ4_INCLUDE_DIR lz4.h)
find_library(LZ4_LIBRARY NAMES lz4)
if (LZ4_INCLUDE_DIR AND LZ4_LIBRARY)
set(LZ4_FOUND TRUE)
message(STATUS "Found LZ4 library: ${LZ4_LIBRARY}")
else ()
message(STATUS "No lz4 found. Using internal sources.")
endif ()
This diff is collapsed.
# Check if SSE/AVX instructions are available on the machine where
# the project is compiled.
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)
STRING(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE)
IF (SSE2_TRUE)
set(SSE2_FOUND true CACHE BOOL "SSE2 available on host")
ELSE (SSE2_TRUE)
set(SSE2_FOUND false CACHE BOOL "SSE2 available on host")
ENDIF (SSE2_TRUE)
# /proc/cpuinfo apparently omits sse3 :(
STRING(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE)
IF (NOT SSE3_TRUE)
STRING(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE)
ENDIF (NOT SSE3_TRUE)
STRING(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE)
IF (SSE3_TRUE OR SSSE3_TRUE)
set(SSE3_FOUND true CACHE BOOL "SSE3 available on host")
ELSE (SSE3_TRUE OR SSSE3_TRUE)
set(SSE3_FOUND false CACHE BOOL "SSE3 available on host")
ENDIF (SSE3_TRUE OR SSSE3_TRUE)
IF (SSSE3_TRUE)