Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Use prebuild dependencies by default #3091

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AnotherFoxGuy
Copy link
Member

@AnotherFoxGuy AnotherFoxGuy commented Sep 29, 2023

This removes the requirement for installing conan to build RoR
Now cmake will download a prebuild dependencies tarball, extract it and run a small test to see if it is able to build with the dependencies
Limitations of this system:

  • Only the Release build config is supported, for a debug build running Conan is still required
  • The Linux tarball might not work on every distro, if it fails using Conan is still recommended

To build on Linux:
Create a build dir: mkdir build && cd build
Generate ninja files: cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
Build the game: ninja

To build on Windows:
Create a build dir: mkdir build && cd build
Generate VS studio files: cmake -G"Visual Studio 16 2019" ..
Open the Rigs_of_Rods.sln file and switch the config to Release
Build the game as usual

@ohlidalp
Copy link
Member

ohlidalp commented Oct 14, 2023

My test setup:

  • Win10 x64, Visual Studio 2022 Community, 17.7.5 (latest) - standard installation via VisualStudioInstaller
  • cmake 3.27.7 (latest)
  • Ninja 1.11.1.1 (latest)

Attempt 1 - basic commands

rmdir /S /Q "%USERPROFILE%\builds\rigs-of-rods"

cmake^
 -S "%USERPROFILE%\source\rigs-of-rods"^
 -B "%USERPROFILE%\builds\rigs-of-rods"^
 -G "Ninja"

ninja "%USERPROFILE%\builds\rigs-of-rods"

Result : Cmake said: No CMAKE_C_COMPILER could be found. No CMAKE_CXX_COMPILER could be found.

Attempt 2 - added compiler paths (Host64/x64)

 -D "CMAKE_C_COMPILER=c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe"^
 -D "CMAKE_CXX_COMPILER=c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe"^

Result

-- The C compiler identification is MSVC 19.37.32825.0
-- The CXX compiler identification is MSVC 19.37.32825.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

Attempt 3 (forced x64 build)

 -G "Ninja"^
 -A "x64"

OK this doesn't work:

CMake Error at CMakeLists.txt:19 (project):
  Generator

    Ninja

  does not support platform specification, but platform

    x64

  was specified.

Attempt4 (use x86 cl.exe)

 -D "CMAKE_C_COMPILER=c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x86/cl.exe"^
 -D "CMAKE_CXX_COMPILER=c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x86/cl.exe"^

Result

-- The C compiler identification is MSVC 19.37.32825.0
-- The CXX compiler identification is MSVC 19.37.32825.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x86/cl.exe
-- Check for working C compiler: c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x86/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "c:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x86/cl.exe"

  is not able to compile a simple test program.

@ohlidalp ohlidalp closed this Oct 14, 2023
@ohlidalp ohlidalp reopened this Oct 14, 2023
@AnotherFoxGuy
Copy link
Member Author

@ohlidalp On windows you have to run cmake and ninja in the Developer Command Prompt for VS 2019, otherwise cmake is unable to find the compiler and linker

@ohlidalp
Copy link
Member

Sorry about the close/reopen, UI focused the Close button while I was typing for some reason.

OK, I'll keep that in mind for next time.

@ohlidalp
Copy link
Member

I launched the same .cmd script from the Developer Command Prompt, without the paths to compiler. It chose "Hostx86/x86/cl.exe". But then failed without much detail:

-- Performing Test DEPS_CHECK
-- Performing Test DEPS_CHECK - Failed
CMake Error at cmake/DownloadDeps.cmake:46 (message):
  Failed to build test program with prebuild deps, please use conan
Call Stack (most recent call first):
  cmake/DownloadDeps.cmake:50 (run_deps_test)
  CMakeLists.txt:38 (include)

@AnotherFoxGuy
Copy link
Member Author

@ohlidalp I updated the PR description with some better instructions on how to build on Windows

@ohlidalp
Copy link
Member

ohlidalp commented Jun 18, 2024

Trying again. Same spec as above. Cmake latest. Conan uninstalled just to be sure.

rmdir /S /Q "%USERPROFILE%\builds\rigs-of-rods-prebuiltdeps"

cmake^
 -S "%USERPROFILE%\source\rigs-of-rods"^
 -B "%USERPROFILE%\builds\rigs-of-rods-prebuiltdeps"^
 -G "Visual Studio 17 2022"

pause

In visual studio, I select "Release" and do "Build Solution". Ends with:

12>LINK : fatal error C1047: The object or library file '..\..\_deps\dependencies-src\full_deploy\host\ogre3d-pagedgeometry\1.2.0\Release\x86_64\lib\PagedGeometry.lib' was created by a different version of the compiler than other objects like 'RoR.dir\Release\cmake_pch.obj'; rebuild all objects and libraries with the same compiler
12>LINK : fatal error LNK1257: code generation failed

Full logs attached

github 3091 - prebuilt.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants