Cemu icon indicating copy to clipboard operation
Cemu copied to clipboard

Error in MacOS cmake -S command

Open GumbyXGames opened this issue 2 years ago • 4 comments

Paths declared in cmake command in step 3 of building Cemu on MacOS (https://github.com/cemu-project/Cemu/blob/main/BUILD.md#build-cemu-using-cmake-and-clang-1) for llvm@14 compilers and ninja are incorrect

Currently: cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja

brew for MacOS does not install llvm@14 or ninja to those paths.

llvm@14 clang path is /opt/homebrew/opt/llvm@14/bin/clang llvm@14 clang++ path is /opt/homebrew/opt/llvm@14/bin/clang++

The following cmake command works: cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang++ -G Ninja -DCMAKE_MAKE_PROGRAM=/opt/homebrew/opt/ninja/bin/ninja

GumbyXGames avatar Oct 04 '22 21:10 GumbyXGames

On ARM brew installations, the homebrew path is /opt/homebrew.
On Intel brew installations, the homebrew path is /usr/local

Before compiling, run arch -x86_64 zsh. Then, install brew again (this won't conflict with your ARM brew installation), and all dependencies.

Installing brew and the dependencies while inside arch -x86_64 zsh will install everything to /usr/local.

emiyl avatar Oct 04 '22 22:10 emiyl

So there are no plans for an arm64 build?

GumbyXGames avatar Oct 04 '22 23:10 GumbyXGames

On ARM brew installations, the homebrew path is /opt/homebrew. On Intel brew installations, the homebrew path is /usr/local

Before compiling, run arch -x86_64 zsh. Then, install brew again (this won't conflict with your ARM brew installation), and all dependencies.

Installing brew and the dependencies while inside arch -x86_64 zsh will install everything to /usr/local.

Ya it doesn't. It's still trying to install from the arm64 brew install. I'm not going to complete change my dev environment just for this.

Update: You specifically need to run the homebrew install in /usr/local/bin

  1. arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. arch -x86_64 /usr/local/bin/brew reinstall git cmake llvm@14 ninja nasm molten-vk
  3. arch -x86_64 /usr/local/bin/git clone --recursive https://github.com/cemu-project/Cemu
  4. cd Cemu
  5. arch -x86_64 /usr/local/bin/cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++ -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja -G Ninja
  6. arch -x86_64 /usr/local/bin/cmake --build build
  7. ./bin/Cemu_release

I just ran each command with arch -x86_64 just to remove any chance of running the arm64 install of the binaries

GumbyXGames avatar Oct 04 '22 23:10 GumbyXGames

So there are no plans for an arm64 build?

On the Cemu roadmap, it's planned to switch to LLVM as a CPU backend, which can then be built for arm64.

emiyl avatar Oct 08 '22 12:10 emiyl