Unknown options when running makefiles for linux kernel building - makefile

I'm building a linux kernel on macbook OS X, and the same error happens whenever I run a make command. I've already tried everything I know, including:
Check if any packages need to be installed.
Create a case-sensitive disk image.
The linux version I use is stable v5.8.9. Error prompts here:
% make defconfig
*** Default configuration is based on 'x86_64_defconfig'
ld: unknown option: --version
init/Kconfig:39: syntax error
init/Kconfig:38: invalid statement
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
make[2]: *** [defconfig] Error 1
make[1]: *** [defconfig] Error 2
make: *** [__sub-make] Error 2
My software environments using homebrew here:
bdw-gc gmp libidn2 make python#3.8
coreutils gnu-sed libpng ncurses qemu
ctags gnu-tar libssh nettle readline
elf-header gnutls libtasn1 openssl#1.1 snappy
findutils guile libtool p11-kit sqlite
gdbm jpeg libunistring pcre unbound
gettext libelf libusb pcre2 vde
git libevent llvm pixman xz
glib libffi lzo pkg-config
I think I'm in a very early stage of kernel building, and there must be some simple mistake, does anyone has any ideas?

Related

PyEnv BUILD FAILED installing Python on MacOS Ventura 13.2.1

I'm working on a project from https://github.com/luigifreda/pyslam which uses only python 3.6.9, so I tried to install it:
pyenv install 3.6.9
and encountered a build failed:
python-build: use openssl#1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 13.2.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/01/bx2q2rbn099ch5d1gr1zm5fc0000gn/T/python-build.20230216230654.91605
Results logged to /var/folders/01/bx2q2rbn099ch5d1gr1zm5fc0000gn/T/python-build.20230216230654.91605.log
Last 10 log lines:
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=<compiler>... no
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
MacOS Venture 13.2.1
Pyenv: 2.3.13
Home brew 4.0.1
Available python versions: 3.6.8
I have tried uninstalling and reinstalling and followed the installation from https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv, but it's still not working. Any suggestions?

C compiler can't create executables

I'm trying to install the elastic beanstalk cli, like so:
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
But I'm getting the following error:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
BUILD FAILED (OS X 11.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557
Results logged to /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557.log
Last 10 log lines:
checking for python3.7... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557/Python-3.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Exiting due to failure
For some reason, the installation script isn't detecting the C compiler. Of course, both the gcc and the cc commands work in the terminal. I'm using macOS 11.1. How do I fix this?
You need to run the commands using Roseta, and arch command can be used to run commands via Rosetta:
arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

Gcc: internal compiler error: Abort trap: 6 signal terminated program cc1

I recently updated to MacOS Catalina, and I get this error in compiling a simple hello-world.c program:
gcc -o hello_world hello_world.c
dyld: Library not loaded: /usr/local/lib/libmpfr.4.dylib
Referenced from: /usr/local/libexec/gcc/x86_64-apple-darwin18.5.0/8.3.0/cc1
Reason: image not found
gcc: internal compiler error: Abort trap: 6 signal terminated program cc1
Please submit a full bug report, with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
here some details:
GCC:
which gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Xcode:
/usr/bin/xcodebuild -version
Xcode 11.1
Build version 11A1027
Command Line Tools:
xcode-select --version
xcode-select version 2370.
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Let me know if you need other infos!
Thank for your help!
Kind regards,
Nico
P.S.
brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Applications/Xcode.app/Contents/Developer/usr/bin/python3.7-config
/Applications/Xcode.app/Contents/Developer/usr/bin/python3.7m-config
/Applications/Xcode.app/Contents/Developer/usr/bin/python3-config
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/gmp.h
/usr/local/include/gmpxx.h
/usr/local/include/mpf2mpfr.h
/usr/local/include/mpfr.h
Warning: Unbrewed .la files were found in
/usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
/usr/local/lib/libgfortran.la
/usr/local/lib/libgmp.la
/usr/local/lib/libgmpxx.la
/usr/local/lib/libgomp.la
/usr/local/lib/libitm.la
/usr/local/lib/libmpc.la
/usr/local/lib/libmpfr.la
/usr/local/lib/libquadmath.la
/usr/local/lib/libssp.la
/usr/local/lib/libssp_nonshared.la
/usr/local/lib/libstdc++.la
/usr/local/lib/libstdc++fs.la
/usr/local/lib/libsupc++.la
/usr/local/lib/libubsan.la
Warning: Unbrewed static libraries were found in
/usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libatomic.a
/usr/local/lib/libgfortran.a
/usr/local/lib/libgmp.a
/usr/local/lib/libgmpxx.a
/usr/local/lib/libgomp.a
/usr/local/lib/libitm.a
/usr/local/lib/libmpfr.a
/usr/local/lib/libquadmath.a
/usr/local/lib/libssp.a
/usr/local/lib/libssp_nonshared.a
/usr/local/lib/libstdc++.a
/usr/local/lib/libstdc++fs.a
/usr/local/lib/libsupc++.a
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
gtk+
glib-networking
gmp
libidn2
gedit
libsoup
ghostscript
gtk+3
mpfr
python
gtksourceview4
gdk-pixbuf
shared-mime-info
atk
glib
gtk-mac-integration
gspell
libpeas
gnutls
gsettings-desktop-schemas
iso-codes
Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in
/usr/local/sbin.
Consider setting the PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
and then
brew config
HOMEBREW_VERSION: 2.1.13
ORIGIN: https://github.com/Homebrew/brew
HEAD: aa043c1d678afd26f50156a83417c296cb9d5a4b
Last commit: 18 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c6602c5c34968d1d76db31e475af50511ab70a7f
Core tap last commit: 53 minutes ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.21.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 13
macOS: 10.15-x86_64
CLT: 11.0.0.0.1.1567737322
Xcode: 11.1
CLT headers: 11.0.0.0.1.1567737322

Installing gcc with OpenMP support on Mac using homebrew has no effect

One way of installing gcc with openMP support on OSX is using Homebrew. However, when I follow the usual instruction of
brew reinstall gcc --without-multilib
It gives me a warning that there is no formula corresponding to the --without-multilib option and hence this will have no effect. Consequently, I do not have openMP support after this reinstallation process. Here is the detailed terminal output.
poulin8:02-prange-parallel-loops poulingroup$ brew --version
Homebrew 1.3.6
Homebrew/homebrew-core (git revision b5afc; last commit 2017-10-27)
poulin8:02-prange-parallel-loops poulingroup$ brew reinstall gcc --without-multilib
==> Reinstalling gcc
Warning: gcc: this formula has no --without-multilib option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/gcc-7.2.0.el_capitan.bottle
Already downloaded: /Users/poulingroup/Library/Caches/Homebrew/gcc-7.2.0.el_capitan.bottle.tar.gz
==> Pouring gcc-7.2.0.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/gcc/7.2.0: 1,486 files, 289.8MB
poulin8:02-prange-parallel-loops poulingroup$
Upon including omp.h in a file and compiling, I get the error
julia.c:447:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
Could someone please help me with installing gcc on OSX with openMP support?
If you can substitute clang for gcc I was able to get clang to compile OpenMP programs quite easily. I built the latest version of LLVM/clang and used homebrew to install libomp via brew install libomp.
Full steps were something like:
mkdir omp_clang && cd omp_clang
git clone https://github.com/llvm-mirror/llvm.git -b release_60
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang -b release_60
mkdir build && cd build
cmake ../llvm
make
brew install libomp
./bin/clang -fopenmp=libomp ~/openmp_program.c

Having Open MPI related issues while making CUDA 5.0 samples (Mac OS X ML)

When I'm trying to make CUDA 5.0 samples an error appears:
Makefile:79: * MPI not found, not building simpleMPI.. Stop.
I've tried to download and build the latest version of Open MPI reffering to Open MPI "FAQ / Platforms / OS X / 6. How do I not use the OS X-bundled Open MPI?" page and it did not solve the error.
make -j 4 2>&1 | tee make.out
[ lots of output ]
make[2]: *** [mpi/man/man3/MPI_Comm_disconnect.3] Error 127
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
I'm realy confused for now I have no idea what to do.
As mentioned in the comments, the simpleMPI example can be effectively bypassed by using make -k, or else deleting the simpleMPI subdirectory altogether, or renaming the Makefile that is in that directory. However if it is desired to actually install a version of MPI on the mac so as to be able to build the simpleMPI example, these instructions should help:
The issue here is that you don't have the MPI compiler installed. You will need to install the MPICC compiler for Mac OSX. These instructions will use the MPICH2 version of MPI, which is generally available here
Direct link to MPICH2 1.4 download
You can follow these instructions to build and configure MPICH2 for Mac OSX. In the configure step, also add --disable-f77 and --disable-fc:
./configure --enable-shared --enable-sharedlibs=osx-gcc --enable-fast=all --prefix=/usr/local/mpich2-optimized --disable-f77 --disable-fc
Then follow the guide instructions to make and then make install
Now create symbolic links to MPICC so you can build CUDA MPI easily
sudo ln -s /usr/local/mpich2-optimized/mpicxx /usr/bin/mpicxx
sudo ln -s /usr/local/mpich2-optimized/mpic++ /usr/bin/mpic++
Alternatively, another option is to add
/usr/local/mpich2-optimized/bin
to your path.
Now when making simpleMPI, it will properly build.
Or just install using MacPorts. The command is
sudo port install mpich
This will also make it easier to update in future since they host the latest version.
Or just install using Homebrew. The command is
brew install mpich2
I could compile all the CUDA samples after installing mpich through homebrew.

Resources