Patman86 / x265-Mod-by-Patman

Patman's mod of x265
GNU General Public License v2.0
57 stars 2 forks source link

strtok_r cmake error #3

Closed yukkodesu closed 3 years ago

yukkodesu commented 3 years ago

using visual studio 2019 cmake shows Looking for strtok_r - not found and then stop pretty weird that cmake works no problem when compile msg7086's x265 which shows Looking for strtok_r - not found as well

Patman86 commented 3 years ago

Do you only have the error with my version or also with Msg7086's version of x265? Have you ever tested DJATOM's version? I think it's a problem with Visual Studio, something seems to be missing or a shortcut is incorrect. Which script or which file do you use to compile?

Can you post a log?

yukkodesu commented 3 years ago

I use file in vc15-x86_64 folder and manually change to visual studio 16 msg7086's x265 works perfectly in the same way

Patman86 commented 3 years ago

Can you post your log? For me it works without problems.

yukkodesu commented 3 years ago

CMakeError.log

CMakeOutput.log

yukkodesu commented 3 years ago

Commandline output

-- cmake version 3.20.1
CMake Deprecation Warning at CMakeLists.txt:10 (cmake_policy):
  The OLD behavior for policy CMP0025 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.28.29914.0
-- The CXX compiler identification is MSVC 19.28.29914.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Program Files/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:20 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Detected x86_64 target processor
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (nasm) does
  not match the name of the calling package (Nasm).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindNasm.cmake:23 (find_package_handle_standard_args)
  CMakeLists.txt:367 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found nasm: C:/Users/VonBrank/AppData/Local/bin/NASM/nasm.exe (found version "2.15.05")
-- Found Nasm 2.15.05 to build assembly primitives
-- GIT_EXECUTABLE C:/Program Files/Git/cmd/git.exe
-- GIT LIVE REPO VERSION RETRIEVED
-- X265 RELEASE VERSION unknown
-- The ASM_NASM compiler identification is NASM
-- Found assembler: C:/Users/VonBrank/AppData/Local/bin/NASM/nasm.exe
-- Looking for strtok_r
-- Looking for strtok_r - not found
CMake Error at CMakeLists.txt:638 (list):
  list GET given empty list

CMake Error at CMakeLists.txt:639 (list):
  list GET given empty list

-- Configuring incomplete, errors occurred!
See also "D:/Users/VonBrank/Documents/GitHub/x265-Mod-by-Patman/build/vc15-x86_64/12bit/CMakeFiles/CMakeOutput.log".
See also "D:/Users/VonBrank/Documents/GitHub/x265-Mod-by-Patman/build/vc15-x86_64/12bit/CMakeFiles/CMakeError.log".
Patman86 commented 3 years ago

Can you please post your your multilib.bat? i can't reproduce...

a similar bug was also reported to the developers... look here

yukkodesu commented 3 years ago

I simply copy multilib.bat command to terminal use exactly same file from this repository and change it a bit, it should be like this

cmake -G "Visual Studio 16" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
Patman86 commented 3 years ago

yeah i know, i use my own script and it works without problem

@echo off

if NOT -%1-==-- call :args %*

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars%bit%.bat"

@cd /d H:\repos\x265\%source%

if exist build_%mk%\MSVC (
echo "Directory already exists"
) else (
@mkdir build_%mk%\MSVC
)

@cd build_%mk%\MSVC

@mkdir 12bit
@mkdir 10bit
@mkdir 8bit

@cd 12bit
cmake -G "Visual Studio 16" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON %asm% %avs% %vpy% -DCMAKE_CXX_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_GENERATOR_PLATFORM="%os%"
if exist x265.sln (
  MSBuild /p:Configuration="Release" /p:Platform="%os%" x265.sln
  copy/y Release\x265-static.lib ..\8bit\x265-static-main12.lib
)

@cd ..\10bit
cmake -G "Visual Studio 16" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DENABLE_HDR10_PLUS=ON %asm% %avs% %vpy% -DCMAKE_CXX_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_GENERATOR_PLATFORM="%os%"
if exist x265.sln (
  MSBuild /p:Configuration="Release" /p:Platform="%os%" x265.sln
  copy/y Release\x265-static.lib ..\8bit\x265-static-main10.lib
)

@cd ..\8bit
if not exist x265-static-main10.lib (
  msg "%username%" "10bit build failed"
  exit 1
)
if not exist x265-static-main12.lib (
  msg "%username%" "12bit build failed"
  exit 1
)
cmake -G "Visual Studio 16" ../../../source -DEXTRA_LIB="x265-static-main10.lib;x265-static-main12.lib" -DENABLE_SHARED=OFF -DLINKED_10BIT=ON -DLINKED_12BIT=ON %avs% %vpy% -DCMAKE_CXX_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="/MD /O2 /Ob3 /Gw /GL /DNDEBUG" -DCMAKE_GENERATOR_PLATFORM="%os%"
  MSBuild /p:Configuration="Release" /p:Platform="%os%" x265.sln
  :: combine static libraries (ignore warnings caused by winxp.cpp hacks)
  move Release\x265-static.lib x265-static-main.lib
  copy Release\x265.exe H:\repos\x265\%mk%\%source%\MSVC\x265.exe
  LIB.EXE /ignore:4006 /ignore:4221 /OUT:Release\x265-static.lib x265-static-main.lib x265-static-main10.lib x265-static-main12.lib
)

@cd H:\FUPX\upx\396
upx%bit%.exe -qq --force -9 H:\repos\x265\%mk%\%source%\MSVC\x265.exe

:args
if -%1-==-- (
    exit /b
) else if /I "%1"=="32" (
    set "mk=x86"
    set "bit=32"
    set "os=win32"
    set "asm=-DENABLE_ASSEMBLY=OFF"
    shift
) else if /I "%1"=="64" (
    set "mk=x64"
    set "bit=64"
    set "os=x64"
    shift
) else if /I "%1"=="O" (
    set "source=x265"
    shift
) else if /I "%1"=="M" (
    set "source=x265M"
    set "avs=-DENABLE_AVISYNTH=ON"
    set "vpy=-DENABLE_VAPOURSYNTH=ON"
    shift
)  else (
    echo Unknown argument "%1"
    exit
)
goto :args

pause
yukkodesu commented 3 years ago

maybe this is a weird problem caused by system environmenrt or system language probably

Patman86 commented 3 years ago

It's possibly a reason.

Patman86 commented 3 years ago

Can I close the issue? It's not reproducible for me.

yukkodesu commented 3 years ago

of course