Closed ChenMiaoi closed 1 year ago
Once you have called generate
with the -c
option, subsequent calls will implicitly assume that option (unless you manually delete the file Make/Linux/.idea/workspace.xml
). That is the reason that there is no output from generate
.
The actual error seems to be this:
-- The CXX compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /us/bin/clang++ - broken
CMake Error at /home/zack/.Local/share/JetBrains/Toolbox/apps/CLion/ch-0/223.8617.54/bin/cmake/Linux/x64/share/cmake-3.24/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler
"/usr/bin/clang++"
is not able to compile a simple test program.
There is currently a problem with clang on Ubuntu where clang chooses to link against a libstdc++ from g++-12 although it is not installed (see for example here). That means that the problem could be fixed by installing the package libstdc++-12-dev
.
Yes, you are right. I suppose that's it because the log said clang++ broken. But I found a new way to sovle, just rebuild the Ubuntu22.04 and the first step to use the wiki's download dependency. And then you can execute RUN /Mame/Linux/generate successfully. It's very useful.
There is also a way to force Clang 11 and gcc-11 to be used even if gcc-12 is installed, in case you have added dependencies that are incompatible with gcc-12. Since the Github actions 22.04 runner nodes have gcc-12 installed by default, here is an example github CI/CD script that shows how to configure compilation to use gcc-11:
name: C/C++ CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive
- name: config1
run: sudo mkdir --parents /opt/gcc-root/lib/gcc/x86_64-linux-gnu
- name: config2
run: sudo ln --symbolic /usr/lib/gcc/x86_64-linux-gnu/11 /opt/gcc-root/lib/gcc/x86_64-linux-gnu/11
- name: config3
run: sudo ln --symbolic /usr/include /opt/gcc-root/
- name: config4
run: echo "CCC_OVERRIDE_OPTIONS=^--gcc-toolchain=/opt/gcc-root" >> $GITHUB_ENV
- name: config5
run: echo "LLVM_COMPILER=clang" >> $GITHUB_ENV
- name: config6
run: echo "LLVM_CC_NAM=clang-11" >> $GITHUB_ENV
- name: config7
run: echo "LLVM_CXX_NAME=clang++-11" >> $GITHUB_ENV
- name: aptUpdate
run: sudo apt update
- name: dependencies
run: sudo apt install ccache clang cmake git graphviz libasound2-dev libgl-dev libqt6opengl6-dev libqt6svg6-dev llvm mold net-tools ninja-build pigz qt6-base-dev rsync tk xterm xxd
- name: generate
run: Make/Linux/generate
- name: makeSimRobot
run: Make/Linux/compile SimRobot
- name: makeBush
run: Make/Linux/compile bush
- name: makeNao
run: Make/Linux/compile Nao
- name: makeTests
run: Make/Linux/compile Tests
- name: runTests
run: ./Build/Linux/Tests/Develop/Tests
For a local version of this, you'd want to run the non echo commands once locally, then put export statements in your .bashrc exporting the variables listed in the echo commands(echo commands are necessary because you can't directly export in github actions and have it persist correctly).
We have an added dependency that doesn't like gcc-12, so this was our only option, short of doing detailed work on the dependency.
in Ubuntu22.04 I can't RUN /Make/Linux/generate to generate Cmake cache. Here is my question in stackoverflow link: https://stackoverflow.com/questions/75552663/how-to-solve-the-bhuman-generate-error-using-cmake