mirror of
https://github.com/simon987/fastimagehash.git
synced 2025-04-04 09:23:00 +00:00
Update build
This commit is contained in:
parent
8e025a6416
commit
54f7fc5613
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import timeit
|
||||
import sys
|
||||
|
||||
@ -6,9 +6,11 @@ IMAGE = sys.argv[1]
|
||||
COUNT = 20
|
||||
SIZE = 8
|
||||
|
||||
|
||||
def print_result(method, time):
|
||||
print("%s_%s,%d" % (IMAGE, method, time / COUNT * 1000000000))
|
||||
|
||||
|
||||
print_result("phash", timeit.timeit(
|
||||
setup="from imagehash import phash \n"
|
||||
"from PIL import Image",
|
||||
@ -36,4 +38,3 @@ print_result("ahash", timeit.timeit(
|
||||
stmt="average_hash(Image.open('%s'), hash_size=%d)" % (IMAGE, SIZE),
|
||||
number=COUNT
|
||||
))
|
||||
|
||||
|
@ -15,7 +15,7 @@ files = (
|
||||
)
|
||||
|
||||
for f in files:
|
||||
out = check_output(["python", "benchmark.py", f])
|
||||
out = check_output(["python3", "benchmark.py", f])
|
||||
print(out.decode(), end="")
|
||||
|
||||
print()
|
||||
|
152
cmake/FindFFTW.cmake
vendored
152
cmake/FindFFTW.cmake
vendored
@ -37,28 +37,28 @@
|
||||
# TODO: put on conda-forge
|
||||
|
||||
|
||||
if( NOT FFTW_ROOT AND DEFINED ENV{FFTWDIR} )
|
||||
set( FFTW_ROOT $ENV{FFTWDIR} )
|
||||
endif()
|
||||
if (NOT FFTW_ROOT AND DEFINED ENV{FFTWDIR})
|
||||
set(FFTW_ROOT $ENV{FFTWDIR})
|
||||
endif ()
|
||||
|
||||
# Check if we can use PkgConfig
|
||||
find_package(PkgConfig)
|
||||
|
||||
#Determine from PKG
|
||||
if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
|
||||
pkg_check_modules( PKG_FFTW QUIET "fftw3" )
|
||||
endif()
|
||||
if (PKG_CONFIG_FOUND AND NOT FFTW_ROOT)
|
||||
pkg_check_modules(PKG_FFTW QUIET "fftw3")
|
||||
endif ()
|
||||
|
||||
#Check whether to search static or dynamic libs
|
||||
set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
if( ${FFTW_USE_STATIC_LIBS} )
|
||||
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
|
||||
else()
|
||||
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
|
||||
endif()
|
||||
if (${FFTW_USE_STATIC_LIBS})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
else ()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV})
|
||||
endif ()
|
||||
|
||||
if( FFTW_ROOT )
|
||||
if (FFTW_ROOT)
|
||||
# find libs
|
||||
|
||||
find_library(
|
||||
@ -85,6 +85,14 @@ if( FFTW_ROOT )
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_DOUBLE_MPI_LIB
|
||||
NAMES "fftw3_mpi"
|
||||
PATHS ${FFTW_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib64"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_FLOAT_LIB
|
||||
NAMES "fftw3f" libfftw3f-3
|
||||
@ -109,6 +117,14 @@ if( FFTW_ROOT )
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_FLOAT_MPI_LIB
|
||||
NAMES "fftw3f_mpi"
|
||||
PATHS ${FFTW_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib64"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_LONGDOUBLE_LIB
|
||||
NAMES "fftw3l" libfftw3l-3
|
||||
@ -133,6 +149,14 @@ if( FFTW_ROOT )
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_LONGDOUBLE_MPI_LIB
|
||||
NAMES "fftw3l_mpi"
|
||||
PATHS ${FFTW_ROOT}
|
||||
PATH_SUFFIXES "lib" "lib64"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
#find includes
|
||||
find_path(FFTW_INCLUDE_DIRS
|
||||
NAMES "fftw3.h"
|
||||
@ -141,7 +165,7 @@ if( FFTW_ROOT )
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
else()
|
||||
else ()
|
||||
|
||||
find_library(
|
||||
FFTW_DOUBLE_LIB
|
||||
@ -161,6 +185,12 @@ else()
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_DOUBLE_MPI_LIB
|
||||
NAMES "fftw3_mpi"
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_FLOAT_LIB
|
||||
NAMES "fftw3f"
|
||||
@ -179,6 +209,12 @@ else()
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_FLOAT_MPI_LIB
|
||||
NAMES "fftw3f_mpi"
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(
|
||||
FFTW_LONGDOUBLE_LIB
|
||||
NAMES "fftw3l"
|
||||
@ -196,12 +232,17 @@ else()
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(FFTW_LONGDOUBLE_MPI_LIB
|
||||
NAMES "fftw3l_mpi"
|
||||
PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_path(FFTW_INCLUDE_DIRS
|
||||
NAMES "fftw3.h"
|
||||
PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
endif( FFTW_ROOT )
|
||||
endif (FFTW_ROOT)
|
||||
|
||||
#--------------------------------------- components
|
||||
|
||||
@ -213,9 +254,9 @@ if (FFTW_DOUBLE_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_DOUBLE_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_DOUBLE_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_FLOAT_LIB)
|
||||
set(FFTW_FLOAT_LIB_FOUND TRUE)
|
||||
@ -225,9 +266,9 @@ if (FFTW_FLOAT_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_FLOAT_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_FLOAT_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_LONGDOUBLE_LIB)
|
||||
set(FFTW_LONGDOUBLE_LIB_FOUND TRUE)
|
||||
@ -237,9 +278,9 @@ if (FFTW_LONGDOUBLE_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_LONGDOUBLE_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_LONGDOUBLE_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_DOUBLE_THREADS_LIB)
|
||||
set(FFTW_DOUBLE_THREADS_LIB_FOUND TRUE)
|
||||
@ -247,11 +288,11 @@ if (FFTW_DOUBLE_THREADS_LIB)
|
||||
add_library(FFTW::DoubleThreads INTERFACE IMPORTED)
|
||||
set_target_properties(FFTW::DoubleThreads
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_DOUBLETHREADS_LIB}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_DOUBLE_THREADS_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_DOUBLE_THREADS_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_FLOAT_THREADS_LIB)
|
||||
set(FFTW_FLOAT_THREADS_LIB_FOUND TRUE)
|
||||
@ -261,9 +302,9 @@ if (FFTW_FLOAT_THREADS_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_FLOAT_THREADS_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_FLOAT_THREADS_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_LONGDOUBLE_THREADS_LIB)
|
||||
set(FFTW_LONGDOUBLE_THREADS_LIB_FOUND TRUE)
|
||||
@ -273,9 +314,9 @@ if (FFTW_LONGDOUBLE_THREADS_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_LONGDOUBLE_THREADS_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_LONGDOUBLE_THREADS_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_DOUBLE_OPENMP_LIB)
|
||||
set(FFTW_DOUBLE_OPENMP_LIB_FOUND TRUE)
|
||||
@ -285,9 +326,9 @@ if (FFTW_DOUBLE_OPENMP_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_DOUBLE_OPENMP_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_DOUBLE_OPENMP_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_FLOAT_OPENMP_LIB)
|
||||
set(FFTW_FLOAT_OPENMP_LIB_FOUND TRUE)
|
||||
@ -297,9 +338,9 @@ if (FFTW_FLOAT_OPENMP_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_FLOAT_OPENMP_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_FLOAT_OPENMP_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_LONGDOUBLE_OPENMP_LIB)
|
||||
set(FFTW_LONGDOUBLE_OPENMP_LIB_FOUND TRUE)
|
||||
@ -309,13 +350,49 @@ if (FFTW_LONGDOUBLE_OPENMP_LIB)
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_LONGDOUBLE_OPENMP_LIB}"
|
||||
)
|
||||
else()
|
||||
else ()
|
||||
set(FFTW_LONGDOUBLE_OPENMP_LIB_FOUND FALSE)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
if (FFTW_DOUBLE_MPI_LIB)
|
||||
set(FFTW_DOUBLE_MPI_LIB_FOUND TRUE)
|
||||
set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTW_DOUBLE_MPI_LIB})
|
||||
add_library(FFTW::DoubleMPI INTERFACE IMPORTED)
|
||||
set_target_properties(FFTW::DoubleMPI
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_DOUBLE_MPI_LIB}"
|
||||
)
|
||||
else ()
|
||||
set(FFTW_DOUBLE_MPI_LIB_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
if (FFTW_FLOAT_MPI_LIB)
|
||||
set(FFTW_FLOAT_MPI_LIB_FOUND TRUE)
|
||||
set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTW_FLOAT_MPI_LIB})
|
||||
add_library(FFTW::FloatMPI INTERFACE IMPORTED)
|
||||
set_target_properties(FFTW::FloatMPI
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_FLOAT_MPI_LIB}"
|
||||
)
|
||||
else ()
|
||||
set(FFTW_FLOAT_MPI_LIB_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
if (FFTW_LONGDOUBLE_MPI_LIB)
|
||||
set(FFTW_LONGDOUBLE_MPI_LIB_FOUND TRUE)
|
||||
set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTW_LONGDOUBLE_MPI_LIB})
|
||||
add_library(FFTW::LongDoubleMPI INTERFACE IMPORTED)
|
||||
set_target_properties(FFTW::LongDoubleMPI
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FFTW_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFTW_LONGDOUBLE_MPI_LIB}"
|
||||
)
|
||||
else ()
|
||||
set(FFTW_LONGDOUBLE_MPI_LIB_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
#--------------------------------------- end components
|
||||
|
||||
set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
@ -336,4 +413,7 @@ mark_as_advanced(
|
||||
FFTW_FLOAT_OPENMP_LIB
|
||||
FFTW_DOUBLE_OPENMP_LIB
|
||||
FFTW_LONGDOUBLE_OPENMP_LIB
|
||||
)
|
||||
FFTW_FLOAT_MPI_LIB
|
||||
FFTW_DOUBLE_MPI_LIB
|
||||
FFTW_LONGDOUBLE_MPI_LIB
|
||||
)
|
2
thirdparty/benchmark
vendored
2
thirdparty/benchmark
vendored
@ -1 +1 @@
|
||||
Subproject commit 0811f1d782455b3c80285bebf934a7045d845ed3
|
||||
Subproject commit 604f6fd3f4b34a84ec4eb4db81d842fa4db829cd
|
Loading…
x
Reference in New Issue
Block a user