From 04156bcd04e75ea4dd2fef69376b149093c110ee Mon Sep 17 00:00:00 2001 From: Florent Hivert Date: Thu, 11 Jan 2018 17:14:37 +0100 Subject: [PATCH] Building release --- AUTHORS | 1 + CMakeLists.txt | 39 ++++++++++++++++++++++++++++++--------- VERSION.in | 1 + doc/CMakeLists.txt | 2 +- include/perm16.hpp | 3 +++ list_intrin.txt | 15 +++++++++++++++ src/CMakeLists.txt | 21 ++++++++++++++++----- 7 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 AUTHORS create mode 100644 VERSION.in create mode 100644 list_intrin.txt diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..4cd64267 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Florent Hivert diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e85f27d..2a1eae42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,15 +37,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS OFF) # -std=c++11 instead of -std=gnu++11 +add_definitions(-DHPCOMBI_HAVE_CONFIG) + message(STATUS "*** Compiler id is ${CMAKE_CXX_COMPILER_ID}") if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) # Workaround of CMAKE bug https://stackoverflow.com/questions/47213356/ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++11) add_compile_options( -std=c++11 -Wall ) endif ( ) -if ( MSVC ) - add_compile_options( /W1 ) -endif ( MSVC ) ################### # Project Structure @@ -70,14 +69,36 @@ ENDIF(BUILD_TESTING) ##################### # config.h file stuff configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/HPCombi-config.h) - +# install (FILES ${CMAKE_CURRENT_BINARY_DIR}/HPCombi-config.h +# DESTINATION include/${CMAKE_PROJECT_NAME}) +configure_file(${CMAKE_SOURCE_DIR}/VERSION.in ${CMAKE_BINARY_DIR}/VERSION) + +#################### +# Install Misc +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ".") +install (FILES ${CMAKE_SOURCE_DIR}/AUTHORS DESTINATION ".") +install (FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ".") +install (FILES ${CMAKE_SOURCE_DIR}/list_intrin.txt DESTINATION ".") ################### # pkgconfig stuff -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hpcombi.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/hpcombi.pc @ONLY) -install (FILES ${CMAKE_CURRENT_BINARY_DIR}/hpcombi.pc - DESTINATION lib/pkgconfig/) - +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hpcombi.pc.in +# ${CMAKE_CURRENT_BINARY_DIR}/hpcombi.pc @ONLY) + + +################# +# Packing stuff +# +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${DESCRIPTION}") +set(CPACK_PACKAGE_VENDOR "Florent Hivert ") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") +set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") + +set(CPACK_GENERATOR "TGZ") +SET(CPACK_PACKAGE_FILE_NAME + "HPCombi-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") +include(CPack) ######################## # Custom target for TAGS diff --git a/VERSION.in b/VERSION.in new file mode 100644 index 00000000..7033e92c --- /dev/null +++ b/VERSION.in @@ -0,0 +1 @@ +@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 48327362..de386e13 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -29,6 +29,6 @@ else() ) install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html - DESTINATION share/doc/${CMAKE_PROJECT_NAME}) + DESTINATION doc) endif() diff --git a/include/perm16.hpp b/include/perm16.hpp index d4658fd9..8edf2d65 100644 --- a/include/perm16.hpp +++ b/include/perm16.hpp @@ -23,7 +23,9 @@ #include #include +#ifdef HPCOMBI_HAVE_CONFIG #include "HPCombi-config.h" +#endif #if __cplusplus <= 201103L #include "fallback/seq.hpp" @@ -33,6 +35,7 @@ #define HPCOMBI_CONSTEXPR constexpr #define HPCOMBI_CONSTEXPR_CONSTRUCTOR constexpr #else + #pragma message "Using a constexpr broken compiler ! Performance may not be optimal" #define HPCOMBI_CONSTEXPR const #define HPCOMBI_CONSTEXPR_CONSTRUCTOR #endif diff --git a/list_intrin.txt b/list_intrin.txt new file mode 100644 index 00000000..26056d47 --- /dev/null +++ b/list_intrin.txt @@ -0,0 +1,15 @@ +_mm_blendv_epi8 +_mm_cmpeq_epi8 +_mm_cmpestri +_mm_cmpestrm +_mm_cmplt_epi8 +_mm_extract_epi64 +_mm_max_epi8 +_mm_max_epu8 +_mm_min_epi8 +_mm_min_epu8 +_mm_movemask_epi8 +_mm_popcnt_u32 +_mm_set_epi64x +_mm_shuffle_epi8 +_mm_slli_epi32 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e712499f..356ef233 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,14 +39,25 @@ check_cxx_source_compiles( set(AUTOGENERATED_WARNING "WARNING: THIS IS A CMAKE AUTO-GENERATED FILE.") include_directories(${CMAKE_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}) - add_library(testtools SHARED testtools.cpp) -install (TARGETS testtools DESTINATION lib) +# set_target_properties(testtools PROPERTIES PUBLIC_HEADER +# "../include/hpcombi.hpp;../include/perm16.hpp;../include/perm16_impl.hpp;../include/perm_generic.hpp;../include/power.hpp;../include/testtools.hpp") +# set_target_properties(testtools PROPERTIES PRIVATE_HEADER +# "../include/fallback/gcdlcm.hpp;../include/fallback/seq.hpp" +# ) + +# install (TARGETS testtools +# LIBRARY DESTINATION lib +# PUBLIC_HEADER DESTINATION "include/${CMAKE_PROJECT_NAME}" +# PRIVATE_HEADER DESTINATION "include/${CMAKE_PROJECT_NAME}/fallback" +# ) + +install ( + DIRECTORY ${CMAKE_SOURCE_DIR}/include/ + DESTINATION include + FILES_MATCHING PATTERN "*.h*") if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) target_compile_options(testtools PUBLIC -mavx -mtune=native -funroll-loops -flax-vector-conversions) endif () - -install(FILES ${headers} - DESTINATION include/${CMAKE_PROJECT_NAME})