Skip to content

Building on macOS #1763

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

Open
TarekSalama opened this issue Mar 30, 2025 · 4 comments
Open

Building on macOS #1763

TarekSalama opened this issue Mar 30, 2025 · 4 comments
Labels
area: buildsystem Related to our cmake/python buildsystem bug Behaving differently as it should behave lang: cmake written the CMake buildsystem os: macos macOS-specific issue

Comments

@TarekSalama
Copy link

On M4 Macbook. Trying to compile and I got this error when I ran ./configure --compiler="$(brew --prefix llvm)/bin/clang" --download-nyan

The compiler doesn't support required C++20 features:
  * Concepts
  * Default comparisons
The following versions support these features:
  * clang++ >= 10
  * g++ >= 10
  * Microsoft Visual Studio 2019 >= 16.8
Please upgrade your compiler to build openage.


CMake Error at buildsystem/CheckCompilerFeatures.cmake:57 (message):
  aborting
Call Stack (most recent call first):
  CMakeLists.txt:174 (include)

I tried this earlier and it seems like it should compile but I am unsure what's going on:

(brew --prefix llvm)/bin/clang++ -std=c++20 /Users/tarek/Downloads/test.cpp  -o test_cpp20
tarek@Mac openage % ./test_cpp20
Testing Concept: 6
Testing Comparison (p1 < p2): true
Testing Comparison (p1 == p1): true
@heinezen heinezen added bug Behaving differently as it should behave os: macos macOS-specific issue area: buildsystem Related to our cmake/python buildsystem lang: cmake written the CMake buildsystem labels Mar 30, 2025
@heinezen
Copy link
Member

heinezen commented Mar 30, 2025

Can you try to compile and run the source code in

#include <compare>
#include <concepts>
class Cat {
public:
virtual int maunz() const { return 42; };
auto operator <=>(const Cat &other) const = default;
};
template <typename T>
concept Meowable = std::same_as<T, Cat> || std::derived_from<T, Cat>;
template <Meowable T>
int meow(const T &cat) {
return cat.maunz();
}
class HouseCat : public Cat {
public:
int maunz() const override { return 1337; };
};
int main() {
HouseCat mrr{};
Cat rrarrr{};
return meow(mrr) > meow(rrarrr) ? 0 : 1;
}

That is what the buildsystem uses to test compiler support.

@TarekSalama
Copy link
Author

I got this error

|  _)/ _____|_______|_______|_  |
| | ( (____  _____      _     | |    ___  ____  _____ ____  _____  ____ _____
| |  \____ \|  ___)    | |    | |   / _ \|  _ \| ___ |  _ \(____ |/ _  | ___ |
| |_ _____) ) |        | |   _| |  | |_| | |_| | ____| | | / ___ ( (_| | ____|
|___|______/|_|        |_|  (___|   \___/|  __/|_____)_| |_\_____|\___ |_____)
                                         |_|                     (_____|

Welcome to the SFT technologies computer-aided openage build system!

You have chosen, or been chosen, to attempt the daring task of building openage.
If you have installed all the dependencies that are conveniently listed in
[doc/building.md], this _might_ just work!

If it doesn't, consider reporting the issue, or ask for help:
  * GitHub: https://github.com/SFTtech/openage
  * Matrix: #sfttech:matrix.org

-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at buildsystem/HandleCXXOptions.cmake:75 (message):
  GNU gold linker isn't available, using the default system linker.
Call Stack (most recent call first):
  buildsystem/HandleCXXOptions.cmake:107 (try_enable_gold_linker)
  CMakeLists.txt:173 (include)


-- Performing Test HAVE_REQUIRED_CXX20_SUPPORT
-- Performing Test HAVE_REQUIRED_CXX20_SUPPORT - Success
-- Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found suitable exact version "3.13.2")
-- Found Python: /opt/homebrew/bin/python3.13 (Required is at least version "3.9")
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import cython; print(cython.__version__)
    ^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'cython'
CMake Error at buildsystem/modules/FindPython.cmake:150 (message):
  failed:

  /opt/homebrew/bin/python3.13 -c 'import cython; print(cython.__version__)'

Call Stack (most recent call first):
  buildsystem/modules/FindCython.cmake:14 (py_exec)
  buildsystem/HandlePythonOptions.cmake:7 (find_package)
  CMakeLists.txt:176 (include)


-- Configuring incomplete, errors occurred!

@TheJJ
Copy link
Member

TheJJ commented Mar 31, 2025

ok, so the compile error resolved itself? how?

now you need to have cython installed.

@Skosulor
Copy link

The first error was probably solved by changing the configuration command to use clang++ instead of clang.

./configure --compiler="$(brew --prefix llvm)/bin/clang++" --download-nyan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: buildsystem Related to our cmake/python buildsystem bug Behaving differently as it should behave lang: cmake written the CMake buildsystem os: macos macOS-specific issue
Projects
None yet
Development

No branches or pull requests

4 participants