How to tell configure where the required version is? - configure

I'm attempting to compile geda-gaf cloned from https://github.com/rlutz/geda-gaf.git
when I do
$ ./configure; I get:
checking for GUILE... no
configure: error: you need at least version 2.0.0 of guile
but
$ which guile
/usr/bin
$ guile -v
guile (GNU Guile) 2.0.14
$ ./configure --help says use GUILE_LIBS environment variable
I tried:
$ export GUILE_LIBS = /usr/lib64
$ ls $GUILE_LIBS
... lots of .so.22 and others
but configure still fails
What am I doing wrong?
as stated previously

Related

Why does ldd fail to find libstdc++ in /usr/local/lib64 without LD_LIBRARY_PATH?

I would like to run a program compiled with gcc-11 on a raspberry pi 4b without having to specify LD_LIBRARY_PATH or having to link with the library path.
At the moment, if I have to specity the path to the new libstdc++ in LD_LIBRARY_PATH, otherwise ld fails to load the correct library:
pi#cm4:~ $ ./rckam-server --version
./rckam-server: /lib/aarch64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by ./rckam-server)
./rckam-server: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./rckam-server)
./rckam-server: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./rckam-server)
pi#cm4:~ $ LD_LIBRARY_PATH=/usr/local/lib64 ./rckam-server --version
rckam-server version 0.2021.08.23-a5d7a165
pi#cm4:~ $
I am running Raspberry Pi OS 64 bits (debian 10.11). After building and installing gcc 11.2.0, I have created /etc/ld.so.conf.d/gcc-11.2.0.conf:
pi#cm4:/etc $ cat ld.so.conf.d/gcc-11.2.0.conf
/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0
/usr/local/lib64
pi#cm4:/etc $
After running ldconfig I verified that the cache contains the relevant libraries:
pi#cm4:/etc $ ldconfig -p | grep libstdc++
libstdc++.so.6 (libc6,AArch64) => /lib/aarch64-linux-gnu/libstdc++.so.6
libstdc++.so.6 (libc6,AArch64) => /usr/local/lib64/libstdc++.so.6
libstdc++.so (libc6,AArch64) => /usr/local/lib64/libstdc++.so
pi#cm4:/etc $ ldconfig -p | grep liblto
liblto_plugin.so (libc6,AArch64) => /usr/local/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0/liblto_plugin.so
pi#cm4:/etc $
This is the compiler:
pi#cm4:/etc $ gcc-11 -v
Using built-in specs.
COLLECT_GCC=gcc-11
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: ../gcc-11.2.0/configure -v --enable-languages=c,c++ --program-suffix=-11 --with-cpu=cortex-a72
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC)
What else should I do to enable ld to find the appriopriate libraries in /usr/local/lib64?
Simply make sure that the newer version of libstdc++ is considered before the old one. This is exactly what happens when LS_LIBRARY_PATH is specified.
The output of "ldconfig -p | grep libstdc++" lists /usr/local/lib64/libstdc++.so.6 after /lib/aarch64-linux-gnu/libstdc++.so.6 and that is where the problem lies. It happens because the file /etc/ld.so.conf.d/aarch64-linux-gnu.conf is processed by ldconfig before /etc/ld.so.conf.d/gcc-11.0.2.conf.
There are several ways to control the order in which the directories are processed by ldconfig. The first one is the old fashioned method: listing the directories in the desired order directly in /etc/ld.so.conf instead of using gcc-11.2.0.conf. Something like this:
/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/11.2.0
/usr/local/lib64
include /etc/ld.so.conf.d/*.conf
The file gcc-11.2.0.conf can be explicitly included before the generic include (it doesn't matter if a file is included twice):
include /etc/ld.so.conf.d/gcc-11.2.0.conf
include /etc/ld.so.conf.d/*.conf
When using files in /etc/ld.so.conf.d, it is also possible to control the order of the includes with numeric prefixes. In this specific case, renaming the file to /etc/ld.so.conf/00-gcc-11.2.0.conf would force ldconfig to process it before any other file in the directory.

gcc-11 from Homebrew Not Found by MacOS - installation and $PATH seem OK

I'm trying to compile a package called Kraken on my M1 Mac running Big Sur.
MacOS fails to compile: clang gets upset. I installed gcc from Homebrew (twice) and $ brew doctor says I'm ready to go.
My path is now:
/usr/local/opt/llvm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin.
The gcc-11 etc files exist at /opt/homebrew/bin
But /usr/local/bin does not exist!
MacOS does not update the command alias for gcc:
$ rm gcc
then
$ ln -s /opt/homebrew/bin/gcc-11 gcc
return no error
but then
$ which gcc
returns
/usr/bin/gcc
I'm lost and gather this compiler-pointing has been a mess; is there any new insight here? I've seen a bunch of entries but nothing I've tried has worked.
Hoping this is a stupid newbie (me) problem, I thank you for any help you can give.
Michael
Homebrew avoids linking binaries with the same name as system binaries like gcc(appleclang). ln -s /opt/homebrew/bin/gcc-11 /opt/homebrew/bin/gcc or tell your configurator to explicitly use gcc-11 via CC= etc. and the same for g++-11 if C++ is used.
If it's a ./configure script, you can try calling CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11 ./configure
if cmake then use cmake .. -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-11 -DCMAKE_CXX_COMPILER=/opt/homebrew/gcc++-11
Also, try seeing where the homebrew gcc link points ls -l /opt/homebrew/bin/gcc

OS X 10.9.2: checking whether the C compiler works... no

I'm attempting to install texinfo 5.2, and I'm running into some issues during ./configure, which I believe are related to the C compiler. When I upgraded from Snow Leopard, I didn't perform a clean install, so perhaps that's part of the problem. Anyway, here's what I've got:
ryansmacbook:texinfo-5.2 ryan$ sudo ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" CPP="gcc -E" CXXCPP="g++ -E"
Password:
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking for perl... /usr/bin/perl
checking Perl version and Encode module... yes
checking for gawk... (cached) awk
checking for gcc... gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64
checking whether the C compiler works... no
configure: error: in `/Users/ryan/Downloads/texinfo-5.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
I've read some of the other questions related to this, so I attempted to install Command Line Tools.
ryansmacbook:~ ryan$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
So it seems they're not installed, although I'm running Xcode 5.1 installed from the App Store. From what I've read, Command Line Tools should be installed, but I've tried
$ xcode-select --install
anyway, and when I tell it to install, a message pops up saying "Can't install software because it is not currently available from the Software Update server."
I found what I thought might be a work-around at http://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/, so I did the following:
ryansmacbook:Tools ryan$ brew install coreutils
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading http://ftpmirror.gnu.org/coreutils/coreutils-8.22.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/coreutils/8.22 --program-prefix=g --w
==> make install
==> Caveats
All commands have been installed with the prefix 'g'.
If you really need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
Additionally, you can access their man pages with normal names if you add
the "gnuman" directory to your MANPATH from your bashrc as well:
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
/usr/local/share/info/dir: Permission denied
==> Summary
🍺 /usr/local/Cellar/coreutils/8.22: 211 files, 10M, built in 2.4 minutes
But I still have the ./configure issue.
For reference,
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
Although I did attempt to install gcc-4.7 the other day, and it's currently living at
/usr/gcc-4.7.2/bin/gcc-4.7
I'm not quite sure how to get it to run as a command from the command line because
$ gcc-4.7 --version
-bash: gcc-4.7: command not found
is what I'm getting now, but that may be neither here nor there.
edit: Since this doesn't directly answer my question about checking whether the C compiler works, I'm not submitting this as an answer. I just tried brew install texinfo, and that worked like a charm. At this point, I can't really remember why I was trying to install texinfo from source nor can I remember what I needed it for (maybe something GNU Make-related or Emacs-related?).
I faced this same problem after installing xcode; All I had to do was run gcc. This then asked me to accept the xcode license. After, it just worked fine.
Hope this helps someone.
I can't really take credit for the answer, but the same things happened to me. I tried to get a ruby-1.9.3 ruby. RVM grabed gcc46 and told homebrew to install it. But then the rvm install command didn't like that. So brew uninstall gcc46 and then brew install apple-gcc42 worked like a charm.
For me the issue was I had not run
xcode-select --install
Once I did that everything ran fine
sudo ln -s \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ \
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
I encountered this while setting up a React Native project. This solution worked.
sudo xcode-select --switch /Applications/Xcode.app
sudo gcc --version
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
I had similar "checking whether the C compiler works... no" problem in my yosemite mac.
I checked some things:
$ which gcc
gcc: aliased to nocorrect gcc
$ ll /usr/bin/gcc
-rwxr-xr-x 1 root wheel 14K 27 Sep 04:06 /usr/bin/gcc
$ gcc
gcc: fatal error: no input files
compilation terminated.
$ gcc --version
gcc: warning: couldn't understand kern.osversion '14.0.0
gcc (GCC) 4.8.3
Copyright (C) 2013 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.
Then I installed it doing:
$ brew install gcc
Error: You must `brew link cloog' before gcc can be installed
$ brew link cloog
Linking /usr/local/Cellar/cloog/0.18.1... 8 symlinks created
$ brew install gcc
Error: gcc-4.8.3 already installed
To install this version, first `brew unlink gcc'
$ brew unlink gcc
Unlinking /usr/local/Cellar/gcc/4.8.3... 39 symlinks removed
$ brew install gcc
....
And it worked:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
Similar problem while installing python3. My home brew was out dated. I simply update my home brew utility.
I faced a similar problem but my situation was different.
I had the Xcode with spaces in the app name removing those spaces fixed the problem:
sudo xcode-select --switch /Applications/Xcode14.0.app

Installing gcc 4.1.0 on ubuntu

I have latest version of ubuntu, but the version of gcc is higher than what I want. How do I build gcc 4.1.0 or install gcc 4.1.0 on this.
I did not find steps to build gcc 4.1.0
Here are the steps to building gcc:
http://gcc.gnu.org/install/
Note that, while "It refers to the current development sources, instructions for specific released versions are included with the sources."
It is a typical* configure, make, make install process. The most important configure flag is probably --enable-languages. and --prefix of course. Also --program-suffix=-4.1 will cause the generated executable to be called gcc-4.1 instead of gcc. The prerequisites list may look scary but most of it is optional, especially if only building for C/C++.
[*] ok, not so typical: another caveat pointed out by JonathanWakely in the comments below is that you shouldn't build gcc in the source dir since that is not supported, so :
(after getting all the prerequisites)
[gcc-src-dir] $ cd ../my-build-dir
[my-build-dir] $ ../gcc-src-dir/configure $CONFIG_FLAGS
[my-build-dir] $ make
[my-build-dir] $ make install
And he pointed to a wiki page he wrote which will walk you through the whole process.
I had a few issues installing gcc 4.1.2 on ubuntu (12.04 in my case). This script sorted it for me:
#!/bin/tcsh
if ($#argv != 1) then
echo "Synopsis: $argv[0] <install_dir>"
exit(-1)
endif
setenv GCCINSTALL $argv[1]
setenv LIBRARY_PATH /usr/lib/x86_64-linux-gnu
setenv SRC ~/gccSrc
mkdir -p $SRC
cd $SRC
wget http://gcc.cybermirror.org/releases/gcc-4.1.2/gcc-4.1.2.tar.gz
tar xvf gcc-4.1.2.tar.gz
cd gcc-4.1.2
mkdir build
cd build
../configure --prefix=${GCCINSTALL} --disable-multilib
grep 4.1.2/missing Makefile
sed -i "s#${SRC}/gcc-4.1.2/missing##" Makefile
grep 4.1.2/missing Makefile
make bootstrap
make install

changing search-dirs for $ sudo gcc

On OS X I'm trying to install the zlib prerequisite for haskell's Cabal. I get this error:
$ sudo ./Setup build
Preprocessing library zlib-0.5.0.0…
ld: library not found for -lgmp
collect2: ld returned 1 exit status
linking dist/build/Codec/Compression/Zlib/Stream_hsc_make.o failed
command was: /usr/bin/gcc -lz -L/sw/lib/ghc-6.8.3/lib/bytestring-0.9.0.1.1 -L/sw/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/sw/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/sw/lib/ghc-6.8.3 -lm -lgmp -ldl dist/build/Codec/Compression/Zlib/Stream_hsc_make.o -o dist/build/Codec/Compression/Zlib/Stream_hsc_make
The library -lgmp is found in /sw/lib, so I can run that command ("/usr/bin/gcc ...") successfully if I manually add -L/sw/lib. The problem is that sudo doesn't know about /sw/lib. Behold:
$ gcc -print-search-dirs | grep sw
libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:./i686-apple-darwin9/4.0.1/:./:/sw/lib/i686-apple-darwin9/4.0.1/:/sw/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
$ sudo gcc -print-search-dirs | grep sw
$
How do I tell the sudo version of gcc to look in /sw/lib for libraries? Do I add an environment variable on root's .bash_profile? If so, which one?
UPDATE:
There’s probably a more proper way to do this, but here’s what worked. I created a bash script with this in it:
#!/bin/sh
export LIBRARY_PATH=/sw/lib:$LIBRARY_PATH
./Setup build
And then I ran
$ sudo ./script.sh
That compiled zlib without complaining - hooray! Unfortunately cabal-install is still giving me the error:
$ ./Setup configure
Configuring cabal-install-0.6.2…
Setup: At least the following dependencies are missing:
zlib >=0.4 && <0.6
So I went back to the cabal-install dir (which is what I'm trying to do in the first place), and ran...
$ ./bootstrap.sh
...and that installed everything as expected.
Why you use sudo ever? You should not compile as super user. Compile as normal user and install as super user.
Try setting LDFLAGS=-L/sw/lib.
GHC now comes with an installer for OS X (Leopard, not sure about Tiger). The only issue is that if you use macports or fink, these will probably not see that you have GHC installed and try to install their own version of it.

Resources