sighthoundinc / SighthoundVideo

Open Source version of Sighthound Video
Other
14 stars 11 forks source link

cl-lang.exe is not able to compile simple test program. #5

Closed mufaawan closed 1 year ago

mufaawan commented 1 year ago

hello, I have been trying to build on windows 11 and I am using VIsual Studio 2017, LLVM10 and Cmake 3.17.1. I am getting the following error.

./svpython/Tools/versioncheck/
./svpython/Tools/versioncheck/checkversions.py
./svpython/Tools/versioncheck/pyversioncheck.py
./svpython/Tools/versioncheck/README.txt
./svpython/Tools/versioncheck/_checkversion.py
./svpython/Tools/webchecker/
./svpython/Tools/webchecker/README.txt
./svpython/Tools/webchecker/tktools.py
./svpython/Tools/webchecker/wcgui.py
./svpython/Tools/webchecker/wcmac.py
./svpython/Tools/webchecker/webchecker.py
./svpython/Tools/webchecker/websucker.py
./svpython/Tools/webchecker/wsgui.py
SV3RDPARTYDIR=/tmp/svbuild/win/libs
Building launch from /c/Users/mufaa/Documents/Work/Sighthound/SighthoundVideo-main/launch into /tmp/svbuild/win/install
/tmp/svbuild/win/launch/.build ~/Documents/Work/Sighthound/SighthoundVideo-main
Building /c/Users/mufaa/Documents/Work/Sighthound/SighthoundVideo-main/launch for Windows
-- The C compiler identification is Clang 10.0.0 with MSVC-like command-line
-- The CXX compiler identification is Clang 10.0.0 with MSVC-like command-line
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/Program Files/LLVM/bin/clang-cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/mufaa/AppData/Local/Temp/svbuild/win/launch/.build/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/ninja-win/ninja.exe cmTC_a4498 && [1/2] Building C object CMakeFiles\cmTC_a4498.dir\testCCompiler.c.obj
    [2/2] Linking C executable cmTC_a4498.exe
    FAILED: cmTC_a4498.exe
    cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_a4498.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_a4498.dir\testCCompiler.c.obj  /out:cmTC_a4498.exe /implib:cmTC_a4498.lib /pdb:cmTC_a4498.pdb /version:0.0  /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
    LINK Pass 1: command "C:\PROGRA~1\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_a4498.dir\testCCompiler.c.obj /out:cmTC_a4498.exe /implib:cmTC_a4498.lib /pdb:cmTC_a4498.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_a4498.dir/intermediate.manifest CMakeFiles\cmTC_a4498.dir/manifest.res" failed (exit code 1) with the following output:
    lld-link: error: <root>: undefined symbol: mainCRTStartup
    ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "C:/Users/mufaa/AppData/Local/Temp/svbuild/win/launch/.build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/mufaa/AppData/Local/Temp/svbuild/win/launch/.build/CMakeFiles/CMakeError.log".
Failed to build /c/Users/mufaa/Documents/Work/Sighthound/SighthoundVideo-main/launch (cmake)

C:\Users\mufaa\Documents\Work\Sighthound\SighthoundVideo-main>
w3sip commented 1 year ago

Could you please provide the entire log, starting from the command you've ran, as well as the output of bash -c "which make" and bash -c "make --version" ?

mufaawan commented 1 year ago

Commands results.

C:\Users\usman\Documents\Umar\Sighthound\SighthoundVideo>bash -c "which make"
/mingw64/bin/make

and

C:\Users\usman\Documents\Umar\Sighthound\SighthoundVideo>bash -c "make --version"
GNU Make 4.4.1
Built for x86_64-pc-msys
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

The log is too long to match the allowed character lenght of github comment. I have attached a text file. Command-prompt-log.txt

Here's list of all environment variables. image

mufaawan commented 1 year ago

I am using the make from msys2 as per instructions in this comment. https://github.com/sighthoundinc/SighthoundVideo/issues/3#issuecomment-1507486157

w3sip commented 1 year ago

Okay, I've attempted to reproduce -- but no luck, seems to build. This is the script I've used:

set PATH=u:\cmake-3.17.1\bin;u:\git\bin;u:\git\usr\bin;%PATH%;u:\llvm10\bin;u:\make
echo "=============================="
bash -c "which make"
echo "=============================="
bash -c "make --version"
echo "=============================="
ninja --version
echo "=============================="
set
bash buildSV.sh

Your make version seems to be correct (and matching mine)

w3sip commented 1 year ago

This is the output I'm seeing:

u:\code\SighthoundVideo>echo "=============================="
"=============================="

u:\code\SighthoundVideo>bash -c "make --version"
GNU Make 4.4.1
Built for x86_64-pc-msys
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

u:\code\SighthoundVideo>echo "=============================="
"=============================="

u:\code\SighthoundVideo>ninja --version
1.11.0

Just to confirm -- you're running from the MSVC command prompt (i.e. this):

Screen Shot 2023-08-07 at 1 22 29 PM
w3sip commented 1 year ago

One thing that I see -- you have .\Git\mingw64\bin on PATH. That has a chance of introducing mingw toolchain utilities into the mix (with the outcome being a mixup not unlike the one you're seeing).

mufaawan commented 1 year ago

This is the output I'm seeing:

u:\code\SighthoundVideo>echo "=============================="
"=============================="

u:\code\SighthoundVideo>bash -c "make --version"
GNU Make 4.4.1
Built for x86_64-pc-msys
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

u:\code\SighthoundVideo>echo "=============================="
"=============================="

u:\code\SighthoundVideo>ninja --version
1.11.0

Just to confirm -- you're running from the MSVC command prompt (i.e. this):

Screen Shot 2023-08-07 at 1 22 29 PM

I am using the mentioned cmd prompt.

My ninja version is 1.11.1

Also my bash -c "make --version" shows exact output as yours.

mufaawan commented 1 year ago

One thing that I see -- you have .\Git\mingw64\bin on PATH. That has a chance of introducing mingw toolchain utilities into the mix (with the outcome being a mixup not unlike the one you're seeing).

What solution do you recommend here? I have collected make.exe and placed in my ./git/mingw64/bin as per instrctions here.

image
w3sip commented 1 year ago

This mirrors my setup here -- except I don't have anything mingw64-related on PATH. Git bash seems to be able to locate make without added entries, and having mingw compiler toolchain on PATH seems to interfere with CMake/MSVC ability to build.

mufaawan commented 1 year ago

Seems like the C:/Program Files(x86)/Inno Setup 5 has been hard coded somewhere?

w3sip commented 1 year ago

You're correct

Seems like the C:/Program Files(x86) Inno Setup 5 has been hard coded somewhere?

You're correct: here it is - https://github.com/sighthoundinc/SighthoundVideo/blob/main/frontEnd/WinInstaller.py#L500

w3sip commented 1 year ago

I will create PR. Are you accepting PRs by any chance?

While it will not be merged immediately, since published version of SV is a derivative of a closed source SV, with some things like cloud connectivity (bug reporting, licensing, etc) and proprietary models being stripped out, we will definitely accept code contributions and integrate them for future updates after vetting.

mufaawan commented 1 year ago

Thank you so much. I will make a proper guide with right link to resources and create a PR. I am closing the issue.

PS: Sorry for a deleted comment mentioning the PR of updated readme.md.

mufaawan commented 1 year ago

Issue resolved.

mufaawan commented 1 year ago

@w3sip log says the installer file has been generated. But I couldn't find the file on path. C:\Users\usman\AppData\Local\Temp\.build-obs\installer-out\frontEnd-Win\Sighthound Video Setup.exe

Does it has to do something with signing with Inno?

image

w3sip commented 1 year ago

No, signing is optional. I'll need to see why, but the installer ends up in ./build/installer-out/frontEnd-Win/:

u:\code\SighthoundVideo>dir .\build\installer-out\frontEnd-Win
 Volume in drive U is WORK_M2
 Volume Serial Number is 889D-1D0A

 Directory of u:\code\SighthoundVideo\build\installer-out\frontEnd-Win

08/07/2023  01:03 PM    <DIR>          .
08/07/2023  01:03 PM    <DIR>          ..
08/07/2023  01:04 PM       451,375,061 Sighthound Video Setup.exe
               1 File(s)    451,375,061 bytes
               2 Dir(s)  30,003,245,056 bytes free
mufaawan commented 1 year ago

Ok, I can see it inside the root directory of the project. I thought path for installer is inside AppData/Local/Temp/.build-obs like mentioned in printed messages in the screenshot.

w3sip commented 1 year ago

Yes, definitely inconsistent -- will investigate.

w3sip commented 1 year ago

@mufaawan - looks like it's being moved after creation. Probably to make it more accessible than a temp build folder, but yes, a bit confusing: https://github.com/sighthoundinc/SighthoundVideo/blob/main/frontEnd/FrontEnd.mk#L256

mufaawan commented 1 year ago

@w3sip how would I execute the project to test during development? I mean what's the start command? I want to make some changes and test the project during change implementation.

w3sip commented 1 year ago

@mufaawan - Try working with this: https://github.com/sighthoundinc/SighthoundVideo/blob/main/app