Score:0

CMake: "ERROR: Package [...] build failed", error in m4 build() method

ec flag

I am trying to install a custom piece of software for my job. I downloaded the source, went inside the folder and typed $ cmake ... After reading AskUbuntu answers, I deduced the problem comes from my m4 installation. I freshly installed m4, but nothing changes. When I run CMake, I have this:

$ cmake ..
-- Conan: Automatic detection of conan settings from cmake
-- Conan: Settings= -pr;default
-- Conan executing: conan install /home/user/app/conanfile.txt -pr default -g=cmake --build=outdated --no-imports

-- Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=9.4
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

asio/1.16.0: Package is up to date

[...]

  CC       freadahead.o
  CC       fseek.o
  CC       fseeko.o
  CC       mbrtowc.o
  CC       obstack.o
freadahead.c: In function 'freadahead':
freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   92 |  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
      |   ^~~~~
make[3]: *** [Makefile:1910: freadahead.o] Error 1
make[3]: *** Waiting for unfinished jobs....
fseeko.c: In function 'rpl_fseeko':
fseeko.c:110:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
  110 |   #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
      |    ^~~~~
make[3]: *** [Makefile:1910: fseeko.o] Error 1
make[3]: Leaving directory '/home/user/.conan/data/m4_installer/1.4.18/bincrafters/stable/build/44fcf6b9a7fb86b2586303e3db40189d3b511830/source_subfolder/lib'
make[2]: *** [Makefile:1674: all] Error 2
make[2]: Leaving directory '/home/user/.conan/data/m4_installer/1.4.18/bincrafters/stable/build/44fcf6b9a7fb86b2586303e3db40189d3b511830/source_subfolder/lib'
make[1]: *** [Makefile:1572: all-recursive] Error 1
make[1]: Leaving directory '/home/user/.conan/data/m4_installer/1.4.18/bincrafters/stable/build/44fcf6b9a7fb86b2586303e3db40189d3b511830/source_subfolder'
make: *** [Makefile:1528: all] Error 2
m4_installer/1.4.18@bincrafters/stable:
jsonformoderncpp/3.7.0: WARN: Recipe 'jsonformoderncpp/3.7.0' is deprecated in favor of 'nlohmann_json'. Please, consider changing your requirements.
m4_installer/1.4.18@bincrafters/stable: WARN: Package binary is corrupted, removing: 44fcf6b9a7fb86b2586303e3db40189d3b511830
m4_installer/1.4.18@bincrafters/stable: WARN: Build folder is dirty, removing it: /home/user/.conan/data/m4_installer/1.4.18/bincrafters/stable/build/44fcf6b9a7fb86b2586303e3db40189d3b511830
m4_installer/1.4.18@bincrafters/stable: ERROR: Package '44fcf6b9a7fb86b2586303e3db40189d3b511830' build failed
m4_installer/1.4.18@bincrafters/stable: WARN: Build folder /home/user/.conan/data/m4_installer/1.4.18/bincrafters/stable/build/44fcf6b9a7fb86b2586303e3db40189d3b511830
ERROR: m4_installer/1.4.18@bincrafters/stable: Error in build() method, line 41
        env_build.make()
        ConanException: Error 2 while executing make -j8

CMake Error at cmake/modules/conan.cmake:371 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake/modules/conan.cmake:451 (conan_cmake_install)
  CMakeLists.txt:26 (conan_cmake_run)


-- Configuring incomplete, errors occurred!
See also "/home/user/app/build/CMakeFiles/CMakeOutput.log".

This is driving me crazy. I spent hours looking around, reinstalling m4 etc, but I still can't build this software.

The CMakeOutput.log file is very long, I put it here.

If anyone has a solution or pointers, I'll take it! Thanks in advance. I should add that I'm using WSL2 on Windows 11 with Ubuntu 20.

hr flag
It sounds like the error is related to the `conan` build system's own `m4_installer`, rather than anything related to your system's native m4 package
C. Crt avatar
ec flag
@steeldriver interesting, thank you! So, should I reinstall or update Conan maybe?
C. Crt avatar
ec flag
Back at work, I upgraded Conan but still get the same errors. I have no idea what to do, this is frustrating!
C. Crt avatar
ec flag
Okay I go it to work! I contacted the people who developed the app I was trying to install. They told me to update the requirements in CMakeLists.txt : `set(CMAKE_CXX_STANDARD 17)`, and conanfile.txt: `[requires] fmt/7.1.0 nlohmann_json/3.9.1 libpcap/1.10.1`
NotTheDr01ds avatar
vn flag
@C.Crt Good to hear you got it working. Please post what you did as an *answer* rather than a comment. You can then self-accept the answer (probably after a short-delay). This will allow others to find your answer when they search the relevant terms -- Comments aren't search-indexed. It will also prevent the question from being "bumped" later by the Community Bot. Thanks!
C. Crt avatar
ec flag
Gotcha, thanks! Posted
Score:0
ec flag

After much trouble I got it to work. I contacted the people who developed the app I was trying to install. They told me to update the requirements in CMakeLists.txt :

set(CMAKE_CXX_STANDARD 17)

and conanfile.txt :

[requires] fmt/7.1.0 
nlohmann_json/3.9.1 
libpcap/1.10.1 
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.