semver icon indicating copy to clipboard operation
semver copied to clipboard

Building with `-DSEMVER_OPT_BUILD_EXAMPLES=ON` or `-DSEMVER_OPT_BUILD_TESTS=ON` fails with ` fatal error: semver.hpp: No such file or directory`.

Open dreirund opened this issue 5 months ago • 0 comments

Ahoj,

I was asked in ↗ this comment to report this issue here.
I have experienced it while building zswap-cli, but I was told to report the issue to semver.
I do not know details or internals of the projects; so I just copypaste my report which I made to zswap-cli.
Over there, there was also the note

It appears that the current implementation adds examples and tests targets before the main library is initialized:
github.com/Neargye/semver/blob/203b9f0ddeea8bf6197f4880ead1af6244bacaf8/CMakeLists.txt#L15-L22

Maybe that can be a help to understand the issue.


Problem details

Building with -DSEMVER_OPT_BUILD_EXAMPLES=ON or -DSEMVER_OPT_BUILD_TESTS=ON fails with fatal error: semver.hpp: No such file or directory:

[1/5] Building CXX object _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o
FAILED: _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o 
/usr/bin/c++   -march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -fstack-clash-protection -fcf-protection -w -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -O3 -DNDEBUG -std=c++20 -Wall -Wextra -pedantic-errors -Werror -MD -MT _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o -MF _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o.d -o _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o -c /var/cache/makepkg/build/zswap-cli-git/src/zswap-cli/build/_deps/semver-src/example/basic_example.cpp
/var/cache/makepkg/build/zswap-cli-git/src/zswap-cli/build/_deps/semver-src/example/basic_example.cpp:24:10: fatal error: semver.hpp: No such file or directory
   24 | #include <semver.hpp>
      |          ^~~~~~~~~~~~
compilation terminated.
[2/5] Building CXX object _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o
FAILED: _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o 
/usr/bin/c++   -march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -fstack-clash-protection -fcf-protection -w -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -O3 -DNDEBUG -std=c++20 -Wall -Wextra -pedantic-errors -Werror -MD -MT _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o -MF _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o.d -o _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o -c /var/cache/makepkg/build/zswap-cli-git/src/zswap-cli/build/_deps/semver-src/example/range_example.cpp
/var/cache/makepkg/build/zswap-cli-git/src/zswap-cli/build/_deps/semver-src/example/range_example.cpp:24:10: fatal error: semver.hpp: No such file or directory
   24 | #include "semver.hpp"
      |          ^~~~~~~~~~~~
compilation terminated.

Steps to reproduce

  1. git clone https://github.com/xvitaly/zswap-cli.git
  2. cmake \
      -G Ninja \
      -B build \
      -S zswap-cli \
      -DBUILD_MANPAGE=ON \
      -DBUILD_DOC=ON \
      -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
      -DCMAKE_BUILD_TYPE:STRING='Release' \
      -DFETCHCONTENT_QUIET=OFF \
      -DLINK_ALL_STATICALLY=OFF \
      -DLINK_BOOST_STATICALLY=OFF \
      -DLINK_ENABLE_OPTIMIZATIONS=ON \
      -DSEMVER_OPT_BUILD_EXAMPLES=ON \
      -DSEMVER_OPT_BUILD_TESTS=OFF \
      -DSEMVER_OPT_INSTALL=ON \
      -DSYSTEMD_INTEGRATION=OFF \
      -Wno-dev
    
    Terminal output of this:
    -- The CXX compiler identification is GNU 14.2.1
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Looking for C++ include filesystem
    -- Looking for C++ include filesystem - found
    -- Looking for C++ include format
    -- Looking for C++ include format - found
    -- Looking for C++ include linux/sysinfo.h
    -- Looking for C++ include linux/sysinfo.h - found
    -- Looking for C++ include linux/version.h
    -- Looking for C++ include linux/version.h - found
    -- Looking for C++ include sys/sysinfo.h
    -- Looking for C++ include sys/sysinfo.h - found
    -- Looking for C++ include sys/utsname.h
    -- Looking for C++ include sys/utsname.h - found
    -- Found Doxygen: /usr/bin/doxygen (found version "1.12.0") found components: doxygen dot
    -- Using bundled version of semver library.
    -- Populating semver
    -- Configuring done (0.0s)
    -- Generating done (0.0s)
    -- Build files have been written to: /tmp/build/_deps/semver-subbuild
    [1/9] Creating directories for 'semver-populate'
    [1/9] Performing download step (git clone) for 'semver-populate'
    Cloning into 'semver-src'...
    HEAD is now at c333d59 v0.3.1
    [2/9] Performing update step for 'semver-populate'
    -- Already at requested tag: v0.3.1
    [3/9] No patch step for 'semver-populate'
    [5/9] No configure step for 'semver-populate'
    [6/9] No build step for 'semver-populate'
    [7/9] No install step for 'semver-populate'
    [8/9] No test step for 'semver-populate'
    [9/9] Completed 'semver-populate'
    -- Configuring done (3.2s)
    -- Generating done (0.0s)
    -- Build files have been written to: /tmp/build
    
  3. cmake --build build
    Terminal output of this and observe issue:
    [1/14] Building CXX object _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o
    FAILED: _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o 
    /usr/bin/c++   -O3 -DNDEBUG -std=c++20 -Wall -Wextra -pedantic-errors -Werror -MD -MT _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o -MF _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o.d -o _deps/semver-build/example/CMakeFiles/basic_example.dir/basic_example.cpp.o -c /tmp/build/_deps/semver-src/example/basic_example.cpp
    /tmp/build/_deps/semver-src/example/basic_example.cpp:24:10: fatal error: semver.hpp: No such file or directory
      24 | #include <semver.hpp>
          |          ^~~~~~~~~~~~
    compilation terminated.
    [2/14] Building CXX object _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o
    FAILED: _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o 
    /usr/bin/c++   -O3 -DNDEBUG -std=c++20 -Wall -Wextra -pedantic-errors -Werror -MD -MT _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o -MF _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o.d -o _deps/semver-build/example/CMakeFiles/range_example.dir/range_example.cpp.o -c /tmp/build/_deps/semver-src/example/range_example.cpp
    /tmp/build/_deps/semver-src/example/range_example.cpp:24:10: fatal error: semver.hpp: No such file or directory
      24 | #include "semver.hpp"
          |          ^~~~~~~~~~~~
    compilation terminated.
    [4/14] Building documentation with Doxygen.
    warning: Specified markdown mainpage 'README.md' has not been defined as input file
    /tmp/zswap-cli/src/app/application/application.hpp:101: warning: Application::ExecuteCmdLine has @param documentation sections but no arguments
    /tmp/zswap-cli/src/app/application/application.hpp:35: warning: Application::Run has @param documentation sections but no arguments
    [11/14] Building CXX object CMakeFiles/zswap-cli-lib.dir/src/lib/zswapobject/zswapobject.cpp.o
    ninja: build stopped: subcommand failed.
    

Regards!

Expected behavior

Building of semver examples or tests works.

Actual behavior

Building of semver examples or tests does not work.

Project version

git describe --tags: v0.9.1-102-gfc4e2ec

Distribution name

Artix GNU/Linux

Kernel version

6.10.7-xanmod-customconfig-clang

Installation type

Make install

Logs

No response

dreirund avatar Sep 09 '24 17:09 dreirund