mold icon indicating copy to clipboard operation
mold copied to clipboard

Unable to build dependencies on centOS-7

Open rahulsubramanian-arista opened this issue 1 year ago • 7 comments

I was following the steps to compile Mold

git clone https://github.com/rui314/mold.git
mkdir mold/build
cd mold/build
git checkout v2.2.0
../install-build-deps.sh
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=c++ ..
cmake --build . -j $(nproc)
sudo cmake --build . --target install

But I see the following error on running ../install-build-deps.sh

+ case "$ID-$VERSION_ID" in
+ echo 'Error: don'\''t know anything about build dependencies on centos-7'
Error: don't know anything about build dependencies on centos-7
+ exit 1

rahulsubramanian-arista avatar Oct 11 '23 06:10 rahulsubramanian-arista

CentOS 7 is too old that I don't think you can install a compiler that is recent enough to compile mold using the standard packaging system. Have you tried the binary we are distributing for each release?

rui314 avatar Oct 11 '23 06:10 rui314

I see. Where can I find the binary?

rahulsubramanian-arista avatar Oct 11 '23 06:10 rahulsubramanian-arista

CentOS 7 is too old that I don't think you can install a compiler that is recent enough to compile mold using the standard packaging system. Have you tried the binary we are distributing for each release?

I believe my compiler supports C++20, since I've used C++20, so that should not be the issue here.

rahulsubramanian-arista avatar Oct 11 '23 06:10 rahulsubramanian-arista

You can download binaries from https://github.com/rui314/mold/releases/tag/v2.2.0.

I believe my compiler supports C++20, since I've used C++20, so that should not be the issue here.

You installed the compiler in a non-standard way, no? I just tried CentOS 7 on Docker and found that I could only install GCC 4.8.5.

rui314 avatar Oct 11 '23 07:10 rui314

You can download binaries from https://github.com/rui314/mold/releases/tag/v2.2.0.

I believe my compiler supports C++20, since I've used C++20, so that should not be the issue here.

You installed the compiler in a non-standard way, no? I just tried CentOS 7 on Docker and found that I could only install GCC 4.8.5.

I'm not aware of how the compiler was installed, since I'm on a shared system. But I do see g++ version 11.

I'm trying to use the script dist.sh that pulls the Docker image and builds the Mold binary zip. However, I'm seeing the error

CMake Error: The source directory "/mold" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Test project /tmp/build
No tests were found!!!
CMake Error: Error processing file: /tmp/build/cmake_install.cmake

I've made sure that after cloning, the /mold directory contains CMakeLists.txt.

What could be the cause of this?

rahulsubramanian-arista avatar Oct 11 '23 13:10 rahulsubramanian-arista

I don't know why it failed on your system. Did you try to run ./dist.sh on a system that is recently enough? Anyways, the mold executable created that way is identical to the one that we distribute, so unless you have a reason to avoid binary packages, I recommend you download the binary package from our release page and install it.

rui314 avatar Oct 11 '23 14:10 rui314

You can download binaries from https://github.com/rui314/mold/releases/tag/v2.2.0.

I believe my compiler supports C++20, since I've used C++20, so that should not be the issue here.

You installed the compiler in a non-standard way, no? I just tried CentOS 7 on Docker and found that I could only install GCC 4.8.5.

There is devtoolset-11-gcc in CentOS-SCLo.repo, almost the standard way. Although the CentOS 7 EOL will come soon.

0x8A63F77D avatar Apr 08 '24 09:04 0x8A63F77D