Closed jay3d closed 5 months ago
Hi! I can't reproduce this error. Any way I hope that fixed it in place where it can happen.
I'm doing a much simpler internal cmake compile instructions because the project cmake file doesn't support Ninja generator with VS
add_compile_definitions(
SIMD_VERSION="unknown"
SIMD_AVX512BW_DISABLE
SIMD_AVX512VNNI_DISABLE
SIMD_AVX512BF16_DISABLE
SIMD_AMXBF16_DISABLE
SIMD_INT8_DEBUG_DISABLE
)
file(GLOB_RECURSE SIMD_BASE_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdBase*.cpp)
if (WIN32)
file(GLOB_RECURSE SIMD_SSE41_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdSse41*.cpp)
file(GLOB_RECURSE SIMD_AVX1_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdAvx1*.cpp)
file(GLOB_RECURSE SIMD_AVX2_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdAvx2*.cpp)
set(SIMD_ALG_SRC ${SIMD_BASE_SRC} ${SIMD_SSE41_SRC} ${SIMD_AVX1_SRC} ${SIMD_AVX2_SRC})
elseif (APPLE)
file(GLOB_RECURSE SIMD_NEON_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdNeon*.cpp)
set(SIMD_ALG_SRC ${SIMD_BASE_SRC} ${SIMD_NEON_SRC})
endif ()
file(GLOB_RECURSE SIMD_LIB_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdLib.cpp)
add_library(Simd STATIC ${SIMD_LIB_SRC} ${SIMD_ALG_SRC})
target_include_directories(Simd PRIVATE ${Simd_SOURCE_DIR}/src)
Anything I'm missing here?
Also I can't just use the solution file in my project.
Do you add compiler specific CPU extensions options to corresponding sources?
I have added those:
add_compile_options(
/arch:AVX
/arch:AVX2
)
But still same error
Strange everything compiles file except this
Do you set /arch:AVX only for SIMD_AVX1_SRC and /arch:AVX2 only for SIMD_AVX2_SRC ?
file(GLOB_RECURSE SIMD_SSE41_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdSse41*.cpp)
file(GLOB_RECURSE SIMD_AVX1_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdAvx1*.cpp)
file(GLOB_RECURSE SIMD_AVX2_SRC ${Simd_SOURCE_DIR}/src/Simd/SimdAvx2*.cpp)
set_source_files_properties(${SIMD_AVX1_SRC} PROPERTIES COMPILE_OPTIONS "/arch:AVX")
set_source_files_properties(${SIMD_AVX2_SRC} PROPERTIES COMPILE_OPTIONS "/arch:AVX2")
set(SIMD_ALG_SRC ${SIMD_BASE_SRC} ${SIMD_SSE41_SRC} ${SIMD_AVX1_SRC} ${SIMD_AVX2_SRC})
Same error
Ok you have a missing include:
#include "Simd/SimdInit.h"
#include "Simd/SimdSet.h"
#include "Simd/SimdMath.h"
#include "Simd/SimdUnpack.h"
#include "Simd/SimdLog.h"
#include "Simd/SimdLoad.h" // <-- It was missing
Sometimes VS IDE is permissive where it should not be, this would make portability a problem, so using a different IDE will have issues like that. Adding the above include solves the problem.
Ah I see this is fixed in the master, or you just fixed it?! Thanks!!
Compiling this file getting those errors: