C Compiler cannot create executables, OpenSolaris Erlang/OTP ./configure error - c++

was running the ./configure script for OTP14B03 on OpenSolaris and got the following output
Ignoring the --cache-file argument since it can cause the system to be erroneously configured
Disabling caching
checking build system type... i386-pc-solaris2.11
checking host system type... i386-pc-solaris2.11
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
I have gcc4 installed, in the $PATH, installed libgcc installed, but still getting this error. searching the web got me to try adding /usr/ccs/bin in order to locate the ld.so file (probably got to do with C++ Compiler or linker). Could some one help me out
EDIT:
Config/log file contains this:
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2041: $? = 0
configure:2043: gcc -v &5
Reading specs from /usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6
configure:2046: $? = 0
configure:2048: gcc -V &5
gcc: `-V' option must have argument
configure:2051: $? = 1
configure:2074: checking for C compiler default output file name
configure:2077: gcc conftest.c >&5
ld: fatal: file values-Xa.o: open failed: No such file or directory
ld: fatal: file processing errors. No output written to a.out
collect2: ld returned 1 exit status
configure:2080: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2118: error: C compiler cannot create executables
See `config.log' for more details.

Your linker cannot find the values-Xa.o object file.
According to this FAQ, it either means your system is missing a package required by the compiler, or that the required packages are installed but your default library path does not reflect it.
As a quick check, you can try adding /usr/ccs/lib to the library path:
./configure LDFLAGS="-L/usr/ccs/lib"

Related

Conan: Setting up autotools to cross compile libcurl for iOS

I've started using Conan to manage a cross platform project with a fairly large dependency tree (diving into the deep end, I know). Several components in the project use autotools for their configuration step, and I'm struggling to get some of those scripts to detect it properly. Conan itself offers little guidance on the subject, so I'm certain there's some setting I'm missing.
To test out my cross environment, I'm compiling libcurl/7.69.1 from MacOS to iOS armv8 with the following settings (using --build to make everything locally):
[settings]
arch=armv8
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=11.0
os=iOS
os.version=9.0
os_build=Macos
[options]
darwin_ssl=False
with_openssl=True
[build_requires]
*: darwin-toolchain/1.0.6#theodelrieu/stable
libcurl/*: libtool/2.4.6
[env]
When it gets to the libcurl configure script, it fails with the following message (relevant libtool output included):
libtool/2.4.6: Package '150f8c59c5beb38d3bb23c3061298c1594abbc17' created
libtool/2.4.6: Created package revision 33a24903417fc5c368223b78e4ffc784
libtool/2.4.6: Appending PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin
libtool/2.4.6: Setting LIBTOOLIZE env to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/libtoolize
libtool/2.4.6: Appending ACLOCAL_PATH env: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Setting LIBTOOL_PREFIX environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17
libtool/2.4.6: Setting LIBTOOL_DATADIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share
libtool/2.4.6: Setting LIBTOOL_PKGAUXDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool/build-aux
libtool/2.4.6: Setting LIBTOOL_PKGLTDLDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/libtool
libtool/2.4.6: Setting LIBTOOL_ACLOCALDIR environment variable to /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
libtool/2.4.6: Appending AUTOMAKE_CONAN_INCLUDES environment variable: /Users/my_home_dir/.conan/data/libtool/2.4.6/_/_/package/150f8c59c5beb38d3bb23c3061298c1594abbc17/bin/share/aclocal
...
libcurl/7.69.1: Calling:
> ./configure '--without-libidn2' '--without-librtmp' '--without-libmetalink' '--without-libpsl' '--without-brotli' '--with-ssl=/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78' '--without-libssh2' '--without-nghttp2' '--with-zlib=/Users/my_home_dir/.conan/data/zlib/1.2.11/_/_/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib' '--disable-shared' '--enable-static' '--disable-ldap' '--enable-threaded-resolver' '--disable-verbose' '--prefix=/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/package/614a97ea5d3c0afeea50678bf1a8f62835834ff0' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' --build=x86_64-apple-darwin --host=aarch64-apple-darwin
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable ESNI support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for aarch64-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/my_home_dir/.conan/data/libcurl/7.69.1/_/_/build/614a97ea5d3c0afeea50678bf1a8f62835834ff0/source_subfolder':
configure: error: C compiler cannot create executables
See `config.log' for more details
And the libcurl config.log reads:
configure:4319: checking whether the C compiler works
configure:4341: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -arch arm64 -mios-version-min=9.0 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -DHAVE_SOCKET -DHAVE_FCNTL_O_NONBLOCK -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -mios-version-min=9.0 -fembed-bitcode -arch arm64 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk -L/Users/my_home_dir/.conan/data/openssl/1.1.1g/Qrypt/dev/package/6721cd435aa597f77b709c9f18a506df5f25cc78/lib conftest.c -lltdl -lssl -lcrypto -lz >&5
ld: library not found for -lltdl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4345: $? = 1
configure:4383: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "curl"
| #define PACKAGE_TARNAME "curl"
| #define PACKAGE_VERSION "-"
| #define PACKAGE_STRING "curl -"
| #define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.haxx.se/mail/"
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int main (void)
| {
|
| ;
| return 0;
| }
My main question: Searching around, this error seems to indicate libtool cannot be found for my target platform. Am I setting up my autotools correctly within my profile? I copied it from the linux settings within lib curl's recipe; are there any other settings needed to get it set up for a MacOS build agent?
Some other misc questions to help me understand what I'm doing:
When I declare a build_requirement, those components get compiled for the build architecture, correct? (MacOS/x86_64 in this case)
The libcurl recipe on conan-center-index does not set libtool as a build_requirement for MacOS, but configure still tries to call it. Is that an oversight within the recipe or is there supposed to be another way to compile libcurl on MacOS machines?
I noticed the libtool package appends LIBTOOL_PREFIX/bin to the PATH, but libltdl.a resides in LIBTOOL_PREFIX/lib, does the curl configure script find libltdl.a some other way?

Configure Error on KLEE Docker: C compiler cannot create executables

I'm trying to build Coreutils with LLVM, using klee docker based on step 3 on https://klee.github.io/tutorials/testing-coreutils/.
But I found a problem on running:
CC=wllvm ../configure --disable-nls CFLAGS="-g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__"
it says
checking for gcc... wllvm
checking whether the C compiler works... no
configure: error: in `/home/klee/coreutils-8.0/obj2':
configure: error: C compiler cannot create executables
See `config.log' for more details.
before running the code above I have install wllvm before through
pip install --upgrade wllvm
and already installed
Requirement already up-to-date: wllvm in /home/klee/.local/lib/python2.7/site-packages
But although I already installed it, it still produces error, and I don't know how to handle it,
I have use the solution provided in C compiler cannot create executables during build of Coreutils with LLVM, but nothing different,
after that I follow instruction in https://github.com/travitch/whole-program-llvm/issues/68, said to use clang rather than wllvm. The program was running after that, but error again on execute
find . -executable -type f | xargs -I '{}' extract-bc '{}'
that say
xargs: extract-bc: No such file or directory
After searching any source, I still can't solve it.
this is part of the config.log when wllvm not found
../configure: line 4240: wllvm: command not found
configure:4249: $? = 127
configure:4269: checking whether the C compiler works
configure:4291: wllvm -g -O1 -Xclang -disable-llvm-passes -D__NO_STRING_INLINES -D_FORTIFY_SOURCE=0 -U__OPTIMIZE__ conftest.c >&5
../configure: line 4293: wllvm: command not found
configure:4295: $? = 127
configure:4333: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU coreutils"
| #define PACKAGE_TARNAME "coreutils"
| #define PACKAGE_VERSION "8.0"
| #define PACKAGE_STRING "GNU coreutils 8.0"
| #define PACKAGE_BUGREPORT "bug-coreutils#gnu.org"
| #define PACKAGE_URL "http://www.gnu.org/software/coreutils/"
| #define PACKAGE "coreutils"
| #define VERSION "8.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4338: error: in `/home/klee/coreutils-8.0/obj-llvm':
configure:4342: error: C compiler cannot create executables
See `config.log' for more details.
It seems that wllvm is simply not in your $PATH. You can check that with which; for example for me it is:
$ which wllvm
/home/#####/.local/bin/wllvm
Related: How to add a directory to the PATH?

When building the library matio, the configure script throws the error "C compiler cannot create executables"

For building the library matio, I first need to execute a configure script and afterwards run make. The configure script however throws the following error:
configure: error: in `/home/user/matio-master':
configure: error: C compiler cannot create executables
More specifically, the error happens while executing core tests. Below you see a section of the config.log. What could be the reason for the fail and how can I fix it?
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2135: checking for a BSD-compatible install
configure:2203: result: /usr/bin/install -c
configure:2214: checking whether build environment is sane
configure:2274: result: yes
configure:2415: checking for a thread-safe mkdir -p
configure:2454: result: /bin/mkdir -p
configure:2467: checking for gawk
configure:2483: found /bin/gawk
configure:2494: result: gawk
configure:2505: checking whether make sets $(MAKE)
configure:2527: result: yes
configure:2622: checking whether to enable maintainer-specific portions of Makefiles
configure:2631: result: no
configure:2651: checking build system type
configure:2669: result: x86_64-pc-linux-gnu
configure:2691: checking host system type
configure:2706: result: x86_64-pc-linux-gnu
configure:2819: checking for pgcc
configure:2849: result: no
configure:2819: checking for icc
configure:2849: result: no
configure:2819: checking for gcc
configure:2835: found /home/user/gcc
configure:2846: result: gcc
configure:2880: checking for C compiler version
configure:2888: gcc --version >&5
gcc (GCC) 6.3.0
Copyright (C) 2016 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.
configure:2892: $? = 0
configure:2899: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/cadappl_sde/ictools/gcc/6.3.0/bin/gcc
COLLECT_LTO_WRAPPER=/sysmnt/cadappl_sde/ictools/gcc/6.3.0/bin/../libexec/gcc/x86_64-redhat-linux/6.3.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../gcc-6.3.0/configure --prefix=/cadappl_sde/ictools/gcc/6.3.0 --with-isl=/cadappl_sde/ictools/gcc/6.3.0 --with-gmp=/cadappl_sde/ictools/gcc/6.3.0 --with-mpfr=/cadappl_sde/ictools/gcc/6.3.0 --with-mpc=/cadappl_sde/ictools/gcc/6.3.0 --enable-static --enable-shared --enable-bootstrap --enable-checking=release --disable-werror --disable-nls --enable-threads=posix --disable-libunwind-exceptions --enable-__cxa_atexit --enable-gnu-unique-object --enable-languages=c,c++,fortran,java,go,objc,obj-c++ --enable-c99 --disable-libada --enable-plugin --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --enable-libstdcxx-time --enable-long-long --disable-multilib
Thread model: posix
gcc version 6.3.0 (GCC)
configure:2903: $? = 0
configure:2910: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2914: $? = 1
configure:2937: checking for C compiler default output file name
configure:2959: gcc -L/boost_filesystem -L/boost_system conftest.c >&5
configure:2963: $? = 0
configure:3001: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "MATIO"
| #define PACKAGE_TARNAME "matio"
| #define PACKAGE_VERSION "1.5.13"
| #define PACKAGE_STRING "MATIO 1.5.13"
| #define PACKAGE_BUGREPORT "t-beu#users.sourceforge.net"
| #define PACKAGE "matio"
| #define VERSION "1.5.13"
| #define MATIO_PLATFORM "x86_64-pc-linux-gnu"
| #define MATIO_MAJOR_VERSION 1
| #define MATIO_MINOR_VERSION 5
| #define MATIO_RELEASE_LEVEL 13
| #define MATIO_VERSION 1513
| #define MATIO_VERSION_STR "1.5.13"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3007: error: in `/home/user/matio-master':
configure:3010: error: C compiler cannot create executables
See `config.log' for more details.

How to build QuantLib on mac os x 10.9.5

So far I'm unable to build QuantLib 1.5 on os x 10.9.5 following the official instructions http://quantlib.org/install/macosx.shtml
./configure --enable-static --with-boost-include=/opt/local/include/ \
--with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \
CXXFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6" \
LDFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6"
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
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 for gawk... (cached) awk
checking for -gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `~/Downloads/qlib/QuantLib-1.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
$ make && sudo make install
make: *** No targets specified and no makefile found. Stop.
So what may be wrong? And how can I fix it?
Here is an excerpt from Config log:
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2416: checking for a BSD-compatible install
configure:2484: result: /usr/bin/install -c
configure:2495: checking whether build environment is sane
configure:2550: result: yes
configure:2701: checking for a thread-safe mkdir -p
configure:2740: result: config/install-sh -c -d
configure:2747: checking for gawk
configure:2777: result: no
configure:2747: checking for mawk
configure:2777: result: no
configure:2747: checking for nawk
configure:2777: result: no
configure:2747: checking for awk
configure:2763: found /usr/bin/awk
configure:2774: result: awk
configure:2785: checking whether make sets $(MAKE)
configure:2807: result: yes
configure:2836: checking whether make supports nested variables
configure:2853: result: yes
configure:2987: checking for gawk
configure:3014: result: awk
configure:3069: checking for -gcc
configure:3099: result: no
configure:3109: checking for gcc
configure:3125: found /usr/bin/gcc
configure:3136: result: gcc
configure:3365: checking for C compiler version
configure:3374: gcc --version >&5
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
configure:3385: $? = 0
configure:3374: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
configure:3385: $? = 0
configure:3374: gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3385: $? = 1
configure:3374: gcc -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:3385: $? = 1
configure:3405: checking whether the C compiler works
configure:3427: gcc -I/opt/local/include -stlib=libstdc++ -mmacosx-version-min=10.6 -L/opt/local/lib conftest.c >&5
clang: error: unknown argument: '-stlib=libstdc++'
configure:3431: $? = 1
configure:3469: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "QuantLib"
| #define PACKAGE_TARNAME "QuantLib"
| #define PACKAGE_VERSION "1.5"
| #define PACKAGE_STRING "QuantLib 1.5"
| #define PACKAGE_BUGREPORT "quantlib-dev#lists.sourceforge.net"
| #define PACKAGE_URL ""
| #define PACKAGE "QuantLib"
| #define VERSION "1.5"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3474: error: in `~/Downloads/qlib/QuantLib-1.5':
configure:3476: error: C compiler cannot create executables
See `config.log' for more details
If you have this problem
checking whether the C compiler works... no
It means that you have not installed the command line tools properly for your Xcode. Please download and install it.
Your clue is in the config.log: "clang: error: unknown argument: '-stlib=libstdc++' "
change -stlib to -stdlib, it should compile and build.
See this related answer on how to configure gcc. The reason is, like me, you probably installed GCC with homebrew or something, therefore not using Apple's default.
I installed GCC 5.3 with homebrew.
Worked for me by just taking out -stdlib option all together.

Install System C to Cygwin

I am trying to install System C 2.3.0 to Cygwin (1.7.25). I am running the ../configure in the objdir (as many tutorials online state) but i get the following error:
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
/*Snippet of config.log /
gcc version 4.8.2 (GCC)
configure:2851: $? = 0
configure:2858: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2861: $? = 1
configure:2884: checking for C compiler default output file name
configure:2911: gcc conftest.c >&5
gcc: error: spawn: No such file or directory
configure:2914: $? = 1
configure:2952: result:
configure: failed program was:
| / confdefs.h. */
| #define PACKAGE_NAME "SystemC"
| #define PACKAGE_TARNAME "systemc"
| #define PACKAGE_VERSION "2.3.0"
| #define PACKAGE_STRING "SystemC 2.3.0"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
Any help would be appreciated!
I figured out my issue. In my .cshrc file, I had modified the $path variable and actually removed gcc and g++. Thus, gcc and g++ both were not working and so the configure script was failing when it tried to run them.
I fixed up my cshrc and the $path variable now has /usr/bin/gcc /usr/bin/g++ and the configure script runs successfully.