kuroの覚え書き

96の個人的覚え書き

HomeディレクトリにLinuxbrewをインストールする

覚え

rcmdnk.com

【CentOS7】gccをソースからインストール | server-memo.net

結局

$ which gcc
/usr/local/bin/gcc
$ gcc --version
gcc (GCC) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

となったけど

$ brew install hello
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
dronedb

Warning: Building xz from source as the bottle needs:
- HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar (yours is /home/kuro/.linuxbrew/Cellar)
- HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /home/kuro/.linuxbrew)
==> Downloading https://downloads.sourceforge.net/project/lzmautils/xz-5.2.6.tar
Already downloaded: /home/kuro/.cache/Homebrew/downloads/f0d58652924441ff0e52ea2e154e2e949a3737d58d9b91052639afd4727c4e89--xz-5.2.6.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/manifests/1.2.12_1
Already downloaded: /home/kuro/.cache/Homebrew/downloads/eb8a0a66a57927afa448fbd3ed7d26ba733902bc46538499b191b224fa4b90bd--zlib-1.2.12_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/zlib/blobs/sha256:c8e13538da968
Already downloaded: /home/kuro/.cache/Homebrew/downloads/da3369060a06b18eca8b27f2884116528c29a5d8b2252d91f5d38c3b013b73c6--zlib--1.2.12_1.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/manifests/1.5.2-3
Already downloaded: /home/kuro/.cache/Homebrew/downloads/f1226cb81ee54df46f1bb53da8118ca107a4f229ac63dc9405f2519c9f6fb45e--zstd-1.5.2-3.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/zstd/blobs/sha256:006b5ab6a4616
Already downloaded: /home/kuro/.cache/Homebrew/downloads/fad42b2ea8e815a7377d5254c66ab075b4ff6731cd31f4073a5b69fbeb1b424d--zstd--1.5.2.x86_64_linux.bottle.3.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/binutils/manifests/2.39_1
Already downloaded: /home/kuro/.cache/Homebrew/downloads/0e62125ed5cacf720aff507ece31b188bbc9b9f80c5a860eb9f7efb65d759f5b--binutils-2.39_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/binutils/blobs/sha256:efa7497e2
Already downloaded: /home/kuro/.cache/Homebrew/downloads/6b48e70fcf2d6cac042ea157418e4443cb64c6600ae8588375267caa97496480--binutils--2.39_1.x86_64_linux.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/manifests/12.2.0-1
Already downloaded: /home/kuro/.cache/Homebrew/downloads/17f82b402f963fe2a37f78f96b2c576d044d8ae90286180fa458720f45d6484e--gcc-12.2.0-1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/blobs/sha256:c7f773f9af5607
Already downloaded: /home/kuro/.cache/Homebrew/downloads/8e39f41437b42328c2caa0cc411fc5efd9ac7ebb7a6058533b6f13239384480d--gcc--12.2.0.x86_64_linux.bottle.1.tar.gz
Warning: Building hello from source as the bottle needs:
- HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar (yours is /home/kuro/.linuxbrew/Cellar)
- HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /home/kuro/.linuxbrew)
==> Downloading https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz
Already downloaded: /home/kuro/.cache/Homebrew/downloads/75885520e988c7fe11cd90a933d9fc389e413d5c210aa889325bc61a90c482d4--hello-2.12.1.tar.gz
==> Installing dependencies for hello: xz, zlib, zstd, binutils and gcc
==> Installing hello dependency: xz
==> ./configure --prefix=/home/kuro/.linuxbrew/Cellar/xz/5.2.6
Last 15 lines from /home/kuro/.cache/Homebrew/Logs/xz/01.configure:

Initializing Automake:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether ln -s works... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/xz-20220930-1461-1jyfg3p/xz-5.2.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://docs.brew.sh/Troubleshooting

あいかわらすCコンパイラが働かないと言われてエラーが出る。
homebrewのスクリプトがどこかおかしなところを探しに出かけているのか?