[simd] Add new port (#28163)

* Added new port for Simd

Created new port for Simd from
https://github.com/ermig1979/Simd

* Added new port for Simd

Created/updated new port for Simd from
https://github.com/ermig1979/Simd

* Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg"

This reverts commit 789c93e81a6ea996649e314eca852180035361ef, reversing
changes made to c87a8183bd518b77b4092bfc27d24ad35686d4d7.

* portfile.cmake fixes

Update x64-windows-static* and fixes

* Update simd.json

* Added missing define

Set "#define in SIMD_STATIC/src/Simd/SimdConfig.h"

* Update simd.json

* Update simd.json

* Revert "Revert "Merge branch 'master' of https://github.com/erdogan61/vcpkg""

This reverts commit a97bdb05f4cd0590002ca953fbd158cab8db045c.

* Added Linux support

* Update simd.json

* Added Cmake install patch

Otherwise build error:
"ninja: error: unknown target 'install'"

* Update simd.json

* Added supports in vcpkg.json

* Update simd.json

* Removed unsupported builds

* x64_uwp failes

UWP builds are failing, since not supported,
Reason:
The following DLLs do not have the App Container bit set:

    D:/packages/simd_x64-uwp/debug/bin/Simd.dll
    D:/packages/simd_x64-uwp/bin/Simd.dll

* Update vcpkg.json

* Update simd.json

* Try ARM support, OSX not running

Osx build failed, arm maybe supported

* Update simd.json

* Fix syntax error and optimize

* Update simd.json

* Fix syntax

* Update simd.json

* Added SIMD_TARGET="aarch64"

* Update simd.json

* Seperated arm64 cmake

Check failes:
#if defined(_MSC_VER) && !defined(__clang__) && (defined(SIMD_X64_ENABLE) || defined(SIMD_X86_ENABLE))

#define SIMD_INIT_AS_CHAR

#elif defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && defined(SIMD_NEON_ENABLE))

#define SIMD_INIT_AS_LONGLONG

#else

#error This platform is unsupported!

#endif

* Update simd.json

* Syntax Error

* Update simd.json

* Update to latest release 5.2.120

*fix bug: MSVS compiler bug (Windows, Arm64).
commit b39197e00a902cbbc5ad397de92f086be994549b

* Baseline Updates

* Include arm64 fix

* Update SHA512

* Update simd.json

* Arm64 with msvc compiler not supported

* Update simd.json

* Updated supports field

* Baseline update

* Update ci.baseline.txt

* Github action fix

Replaced vcpkg_configure_cmake by vcpkg_cmake_configure

* Update simd.json

Co-authored-by: dtmen <dtmen@gmx.de>
This commit is contained in:
erdogan61 2022-12-14 01:36:18 +01:00 committed by GitHub
parent 5ed17f6b22
commit e05c925db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 142 additions and 0 deletions

View File

@ -0,0 +1,30 @@
diff --git "a/prj/cmake/arm.cmake" "b/prj/cmake/arm.cmake"
index 791acf2..858b636 100644
--- "a/prj/cmake/arm.cmake"
+++ "b/prj/cmake/arm.cmake"
@@ -27,6 +27,10 @@ file(GLOB_RECURSE SIMD_LIB_SRC ${SIMD_ROOT}/src/Simd/SimdLib.cpp)
set_source_files_properties(${SIMD_LIB_SRC} PROPERTIES COMPILE_FLAGS "${COMMON_CXX_FLAGS} ${CXX_NEON_FLAG}")
add_library(Simd ${SIMD_LIB_TYPE} ${SIMD_LIB_SRC} ${SIMD_BASE_SRC} ${SIMD_NEON_SRC})
+set_target_properties(Simd PROPERTIES PUBLIC_HEADER "${SIMD_ROOT}/src/Simd/SimdLib.h;${SIMD_ROOT}/src/Simd/SimdLib.hpp")
+install(TARGETS Simd EXPORT simdtargets LIBRARY DESTINATION "lib" PUBLIC_HEADER DESTINATION "include")
+install(EXPORT simdtargets DESTINATION share/simd)
+
if(SIMD_TEST)
file(GLOB_RECURSE TEST_SRC_C ${SIMD_ROOT}/src/Test/*.c)
file(GLOB_RECURSE TEST_SRC_CPP ${SIMD_ROOT}/src/Test/*.cpp)
diff --git "a/prj/cmake/x86.cmake" "b/prj/cmake/x86.cmake"
index c6799a6..7e80255 100644
--- "a/prj/cmake/x86.cmake"
+++ "b/prj/cmake/x86.cmake"
@@ -83,6 +83,10 @@ file(GLOB_RECURSE SIMD_LIB_SRC ${SIMD_ROOT}/src/Simd/SimdLib.cpp)
set_source_files_properties(${SIMD_LIB_SRC} PROPERTIES COMPILE_FLAGS "${SIMD_LIB_FLAGS}")
add_library(Simd ${SIMD_LIB_TYPE} ${SIMD_LIB_SRC} ${SIMD_ALG_SRC})
+set_target_properties(Simd PROPERTIES PUBLIC_HEADER "${SIMD_ROOT}/src/Simd/SimdLib.h;${SIMD_ROOT}/src/Simd/SimdLib.hpp")
+install(TARGETS Simd EXPORT simdtargets LIBRARY DESTINATION "lib" PUBLIC_HEADER DESTINATION "include")
+install(EXPORT simdtargets DESTINATION share/simd)
+
if(SIMD_TEST)
file(GLOB_RECURSE TEST_SRC_C ${SIMD_ROOT}/src/Test/*.c)
if((CMAKE_CXX_COMPILER MATCHES "clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))

82
ports/simd/portfile.cmake Normal file
View File

@ -0,0 +1,82 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ermig1979/Simd
REF e61df320747449322767e67534bd7bb6a9a6d2c8 # v5.1.119
SHA512 9dfce424af8600aaa2c0eac8bbb8f20b12cbd086d495c7e9e1ce2a45ae60242ee893608fc41c88ff6caa960821188e4cffd586b416ab891ee86d6e28aad54726
HEAD_REF master
PATCHES
fix-CMakeLists-install.patch
)
if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64"))
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(SIMD_PLATFORM "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(SIMD_PLATFORM "x64")
endif()
if(VCPKG_PLATFORM_TOOLSET MATCHES "v140")
set(SOLUTION_TYPE vs2015)
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(SOLUTION_TYPE vs2017)
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v142")
set(SOLUTION_TYPE vs2019)
else()
set(SOLUTION_TYPE vs2022)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${SOURCE_PATH}/src/Simd/SimdConfig.h"
"//#define SIMD_STATIC"
"#define SIMD_STATIC")
vcpkg_replace_string("${SOURCE_PATH}/prj/${SOLUTION_TYPE}/Simd.vcxproj"
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
"<ConfigurationType>StaticLibrary</ConfigurationType>")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
file(GLOB_RECURSE PROJ_FILES "${SOURCE_PATH}/prj/${SOLUTION_TYPE}/*.vcxproj")
foreach(PROJ_FILE ${PROJ_FILES})
vcpkg_replace_string(${PROJ_FILE}
" </ClCompile>"
" <RuntimeLibrary Condition=\"'$(Configuration)'=='Debug'\">MultiThreadedDebugDLL</RuntimeLibrary>\n <RuntimeLibrary Condition=\"'$(Configuration)'=='Release'\">MultiThreadedDLL</RuntimeLibrary>\n </ClCompile>")
endforeach()
endif()
endif()
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH "/prj/${SOLUTION_TYPE}/Simd.sln"
PLATFORM ${SIMD_PLATFORM}
TARGET Simd
RELEASE_CONFIGURATION "Release"
DEBUG_CONFIGURATION "Debug"
)
file(COPY "${SOURCE_PATH}/src/Simd/SimdLib.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(FATAL_ERROR "Arm64 building with MSVC is currently not supported.")
else()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/prj/cmake"
OPTIONS
-DSIMD_TARGET="aarch64"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
endif()
else()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/prj/cmake"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
endif()
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

18
ports/simd/vcpkg.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "simd",
"version": "5.1.119",
"description": "Simd image processing and machine learning library, designed for C and C++ programmers",
"homepage": "https://github.com/ermig1979/Simd",
"license": "MIT",
"supports": "!(uwp | osx | (arm64 & windows))",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -6960,6 +6960,10 @@
"baseline": "2022-01-04",
"port-version": 2
},
"simd": {
"baseline": "5.1.119",
"port-version": 0
},
"simde": {
"baseline": "0.7.2",
"port-version": 0

8
versions/s-/simd.json Normal file
View File

@ -0,0 +1,8 @@
{
"versions": [
{
"git-tree": "56af2de7152865b9e3ede88a7604dd54ba4251d9",
"version": "5.1.119"
}
]
}