Compiling PCem vNext on Fedora 40

Support and general discussion.
Post Reply
Katakis
Posts: 121
Joined: Thu 05 Mar, 2015 6:42 am

Compiling PCem vNext on Fedora 40

Post by Katakis »

I am trying to compile one of the PCem vNext builds, specifically PCem-Debug-vNext-Ubuntu-46-33a4bc6c46fcf9eda4efcc915c7ae2ce50c51a36), on Fedora 4- However, when I configure it using the cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release command, I get this:

Code: Select all

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error in CMakeLists.txt:
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.28)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
I have tried installing both cmake.x86_64 and cmake.i686, and even cmake-fedora.noarch but doesn't seem to do anything.

Off-topic, but I notice v17 of PCem is included in the Fedora repository, but I am not sure how inferior this version is compared to the vNext builds.
JosepMa
Posts: 204
Joined: Tue 20 Jun, 2017 6:25 pm

Re: Compiling PCem vNext on Fedora 40

Post by JosepMa »

Version 17 is the release version. version 18 has several changes, including code restructuration, build system change (automake -> cmake) and some development changes. It does have some new additions, but you should be fine with v17.

As for the problem compiling (Aside of the two warnings which could be fixed). It looks like cmake cannot find your cpp compiler.
Have you installed gpp as well as gcc? (a quick search suggest that this is done with: sudo dnf install gcc-c++ )
Katakis
Posts: 121
Joined: Thu 05 Mar, 2015 6:42 am

Re: Compiling PCem vNext on Fedora 40

Post by Katakis »

I tried sudo dnf install gcc-c++. The "Checking..." lines are gone, but I receive this:

Code: Select all

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at codegen/codegen.cmake:90 (if):
  if given arguments:

    "STREQUAL" "x86_64"

  UnknoCMake Error at codegen/codegen.cmake:90 (if):
  if given arguments:

    "STREQUAL" "x86_64"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:29 (include)
wn arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:29 (include)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.28)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
Note the:

CMake Error at codegen/codegen.cmake:90 (if):
if given arguments:

"STREQUAL" "x86_64"

Unknown arguments specified
Call Stack (most recent call first):
CMakeLists.txt:29 (include)
JosepMa
Posts: 204
Joined: Tue 20 Jun, 2017 6:25 pm

Re: Compiling PCem vNext on Fedora 40

Post by JosepMa »

Hello.

I didn't realize the first time, but it seems you are executing cmake on the wrong directory.

You should be doing it on the directory where COPYING and README.md are placed, not inside src.

Also, I recommend you to build inside a folder, instead of directly there, Just like this:


mkdir -p build_x64
cd build_x64
cmake -G "Ninja" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

( the double dots ".." after the first cmake indicate that the code is under the parent folder, but then builds on this subfolder)

(In case you consider it to be worth, start with a fresh clone)
Post Reply