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

Build from Git on Ubuntu 22.04 fails with "error: call to non-‘constexpr’ function" #626

Open
davidmcnabnz opened this issue Jan 17, 2023 · 2 comments

Comments

@davidmcnabnz
Copy link

davidmcnabnz commented Jan 17, 2023

Environment

  • OS: Ubuntu 22.04 LTS
  • Giada version: git 6e618c8

Describe the bug
Attempting to build giada fails with a C++ compilation error:
error: call to non-‘constexpr’ function

To Reproduce
Steps to reproduce the behavior:

  1. clone the current git repo on Ubuntu 22.04 LTS
  2. ensure all deps are present (eg, sudo build-dep gardia), plus a few other dev lib packages such as librtaudio-dev
  3. follow the instructions on the gardia "Compiling from Source" page
  4. Observe compilation errors. There are 3 points in the codebase where g++ is complaining about "call to non-constexpr function"

Expected behavior
gardia fully compiles and links without problems

Screenshots
Here is one of the 3 compilation error messages:

/home/david/giada/src/gui/dialogs/sampleEditor.cpp: In member function ‘void giada::v::gdSampleEditor::updateInfo()’:
/home/david/giada/src/gui/dialogs/sampleEditor.cpp:233:63: error: call to non-‘constexpr’ function ‘const char* giada::v::LangMapper::get(const string&) const’
  233 |         std::string infoText = fmt::format(g_ui.langMapper.get(LangMap::SAMPLEEDITOR_INFO),
      |                                            ~~~~~~~~~~~~~~~~~~

Additional context
Ubuntu 22.04 LTS system is up to date. It's not immediately obvious which toolchain programs and which versions are being used, eg g++ vs gcc vs some other compiler.

@gvnnz
Copy link
Contributor

gvnnz commented Jan 23, 2023

Hey @davidmcnabnz , what version of gcc are you using (gcc --version)? Also, do you get the same error on a different compiler (clang)?

@davidmcnabnz
Copy link
Author

Current gcc version on Ubuntu[Studio] 22.04 LTS is:
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

As per your suggestion, I installed clang, removed the build/ directory, and tried to set up for a fresh build with:
cmake -B build -S . -DCMAKE_CXX_COMPILER=/usr/bin/clang

This failed at the step of:

fatal error: 'atomic' file not found
              #include <atomic>

I tried to remedy this by installing all the libatomic-related dev packages, but this didn't resolve the issue.

Note that when I run cmake, accepting the default compiler (/usr/bin/), the above 'atomic not found' error does not occur.

If I've got the cmake setup command wrong (above), please correct me.

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

No branches or pull requests

2 participants