dpaulat / supercell-wx

Supercell Wx is a free, open source advanced weather radar viewer.
https://supercell-wx.rtfd.io
MIT License
85 stars 14 forks source link

Compiling from source x86/x64 issue #224

Open Tdogb opened 3 weeks ago

Tdogb commented 3 weeks ago

I usually don't program desktop applications, but I'm motivated to add some features to this code for a project I'm working on. After a lot of struggle, I've gotten to this point. It appears that during build, it is trying to build as x86 which isn't compatible with some packages, any ideas to what I should do to fix the build? My system itself is Windows 10 x64

ERROR: There are invalid packages (packages that cannot exist for this configuration):
cmake/3.29.3: Invalid ID: CMake binaries are only provided for x86_64 and armv8 architectures
msys2/cci.latest: Invalid ID: Only Windows x64 supported
msys2/cci.latest: Invalid ID: Only Windows x64 supported
    opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    openssl/3.2.1:a749de233b8caeb48dce50def9bb26c33c85e93c - Build
    re2/20231101:b8d2459e16d2c60181448ba7a62446c87c96e0d3 - Build
    spdlog/1.14.1:99cce058efbde75e361654cb489434be1fb2c648 - Build
    sqlite3/3.46.0:aa87a14ad1c7a800a99186d569fd58b2e0156222 - Build
    vulkan-headers/1.3.243.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    vulkan-loader/1.3.243.0:556aefa3805608dd7c5cd34ba1a20542bbdff93d - Build
    zlib/1.3.1:70711aff723b218b02483e600038031bf91007bc - Build
Build requirements
    b2/4.10.1 from 'conancenter' - Cache
    cmake/3.29.3 from 'conancenter' - Cache
    gperf/3.1 from 'conancenter' - Cache
    meson/1.2.2 from 'conancenter' - Cache
    meson/1.3.2 from 'conancenter' - Cache
    meson/1.4.0 from 'conancenter' - Cache
    msys2/cci.latest from 'conancenter' - Cache
    nasm/2.15.05 from 'conancenter' - Cache
    ninja/1.11.1 from 'conancenter' - Cache
    pkgconf/2.1.0 from 'conancenter' - Cache
    strawberryperl/5.32.1.1 from 'conancenter' - Cache
Build requirements packages
    b2/4.10.1:11e6a84a7894f41df553e7c92534c3bf26896802 - Build
    cmake/3.29.3:INVALID - Invalid
    gperf/3.1:63c5d5dc6eb958dab897e143053e17f583d55879 - Build
    meson/1.2.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    meson/1.3.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    meson/1.4.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    msys2/cci.latest:INVALID - Invalid
    nasm/2.15.05:63c5d5dc6eb958dab897e143053e17f583d55879 - Build
    ninja/1.11.1:63c5d5dc6eb958dab897e143053e17f583d55879 - Build
    pkgconf/2.1.0:63c5d5dc6eb958dab897e143053e17f583d55879 - Build
    strawberryperl/5.32.1.1:11e6a84a7894f41df553e7c92534c3bf26896802 - Build

Cross-build from 'Windows:x86_64' to 'Windows:x86'
Installing (downloading, building) binaries...
CMake Error at external/cmake-conan/conan.cmake:651 (message):
  Conan install failed='6'
Call Stack (most recent call first):
  CMakeLists.txt:35 (conan_cmake_install)
Tdogb commented 3 weeks ago

This actually may be a bug with Conan. It seems to be detecting my system as x86 even though it is 64bit. Or it's just detecting MSVC as 32bit

C:\Users\tdogb\Documents\VSCode\weather\supercell-wx>cmake -B build-release -S .     -DCMAKE_BUILD_TYPE=Release     -DCMAKE_CONFIGURATION_TYPES=Release     -DCMAKE_PREFIX_PATH=C:/Qt/6.7.1/msvc2019_64
-- Conan: Detected VS runtime: MD
-- Conan: checking conan executable
-- Conan: Found program C:/Program Files/Conan/conan/conan.exe
-- Conan: Version found Conan version 1.64.1
-- Conan executing: C:/Program Files/Conan/conan/conan.exe install C:/Users/tdogb/Documents/VSCode/weather/supercell-wx --remote conancenter --build missing --settings arch=x86 --settings build_type=Release --settings compiler=Visual Studio --settings compiler.version=17 --settings compiler.runtime=MD
Configuration:
[settings]
arch=x86
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=17
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
dpaulat commented 3 weeks ago

32-bit is not supported. What version of Visual Studio are you running? I'm assuming you have a 64-bit compiler installed.

You will want to edit your Conan default profile, changing arch from x86 to x86_64. You can edit this in the .conan folder in your home directory, or with the conan profile command.

Tdogb commented 3 weeks ago

32-bit is not supported. What version of Visual Studio are you running? I'm assuming you have a 64-bit compiler installed.

You will want to edit your Conan default profile, changing arch from x86 to x86_64. You can edit this in the .conan folder in your home directory, or with the conan profile command.

My conan profile is set up as follows

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=17
build_type=Release
[options]
[build_requires]
[env]

My system is 64bit Windows 10 with Visual Studio 2022

dpaulat commented 3 weeks ago

C:\Users\tdogb\Documents\VSCode\weather\supercell-wx>cmake -B build-release -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CONFIGURATION_TYPES=Release -DCMAKE_PREFIX_PATH=C:/Qt/6.7.1/msvc2019_64 -- Conan: Detected VS runtime: MD -- Conan: checking conan executable -- Conan: Found program C:/Program Files/Conan/conan/conan.exe -- Conan: Version found Conan version 1.64.1 -- Conan executing: C:/Program Files/Conan/conan/conan.exe install C:/Users/tdogb/Documents/VSCode/weather/supercell-wx --remote conancenter --build missing --settings arch=x86 --settings build_type=Release --settings compiler=Visual Studio --settings compiler.version=17 --settings compiler.runtime=MD Configuration:

Note --settings arch=x86. Something is overriding arch=x86_64 in your profile. When I run, I get the following:

[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build D:/Projects/build-supercell-wx --config Release --target supercell-wx --
[build] CMake is re-running because D:/Projects/build-supercell-wx/CMakeFiles/generate.stamp is out-of-date.
[build]   the file 'C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeCCompiler.cmake.in'
[build]   is newer than 'D:/Projects/build-supercell-wx/CMakeFiles/generate.stamp.depend'
[build]   result='0'
[build] -- Conan: Detected VS runtime: MD
[build] -- Conan: checking conan executable
[build] -- Conan: Found program C:/Users/dpaul/AppData/Local/Programs/Python/Python312/Scripts/conan.exe
[build] -- Conan: Version found Conan version 1.64.1
[build] -- Conan executing: C:/Users/dpaul/AppData/Local/Programs/Python/Python312/Scripts/conan.exe install C:/Users/dpaul/git/supercell-wx --remote conancenter --build missing --settings arch=x86_64 --settings build_type=Release --settings compiler=Visual Studio --settings compiler.version=17 --settings compiler.runtime=MD --settings compiler.cppstd=17

CMake might require a -A x86_64 argument to force the architecture?

Tdogb commented 2 weeks ago
C:\Users\tdogb\Documents\VSCode\weather\supercell-wx>cmake -B build-debug -S .     -A x86_64     -DCMAKE_BUILD_TYPE=Debug     -DCMAKE_CONFIGURATION_TYPES=Debug     -DCMAKE_PREFIX_PATH=C:/Qt/6.7.1/msvc2019_64
CMake Error at CMakeLists.txt:3 (project):
  Generator

    NMake Makefiles

  does not support platform specification, but platform

    x86_64

  was specified.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Spent hours fixing this error before, but don't remember how I did it. Feeling like one of those endless rabbit holes to get this compiled haha

dpaulat commented 2 weeks ago

I have not used the NMake Makefiles generator, and not sure if it'd work on Windows. I'd recommend the Ninja generator since you're using VS Code, otherwise the Visual Studio generator should work OK.

You can also try running the setup-*.bat script to initialize your build directory, and configure VS Code to reference your already configured/generated directory (CMake plugin settings).