Install System C to Cygwin - c++

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.

Related

C compiler cannot create executables when cross-compiling

I am cross compiling on a Intel based Linux Ubuntu system under Windows 10 for an Intel i486 under QNX 6.5.0. One of the libraries is snappy, v.1.0.4. Copied i486-pc-nto-qnx6.5.0* tools (gcc, g++, ld, etc.) from the QNX system to the /usr/local/bin in Ubuntu. Then configure as ./configure --build=x86_64-pc-linux-gnu --host=i486-pc-nto-qnx6.5.0. Run make and get an error: C compiler cannot create executables when cross-compiling.
In config.log:
configure:2985: checking whether make sets $(MAKE)
configure:3007: result: yes
configure:3117: checking build system type
configure:3131: result: x86_64-pc-linux-gnu
configure:3151: checking host system type
configure:3164: result: i486-pc-nto-qnx6.5.0
configure:3196: checking for style of include used by make
configure:3224: result: GNU
configure:3254: checking for i486-pc-nto-qnx6.5.0-gcc
configure:3270: found /usr/local/bin/i486-pc-nto-qnx6.5.0-gcc
configure:3281: result: i486-pc-nto-qnx6.5.0-gcc
configure:3550: checking for C compiler version
configure:3559: i486-pc-nto-qnx6.5.0-gcc --version >&5
configure:3572: $? = 1
configure:3592: checking whether the C compiler works
configure:3614: i486-pc-nto-qnx6.5.0-gcc conftest.c >&5
configure:3618: $? = 1
configure:3656: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "snappy"
| #define PACKAGE_TARNAME "snappy"
| #define PACKAGE_VERSION "1.0.4"
| #define PACKAGE_STRING "snappy 1.0.4"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "snappy"
| #define VERSION "1.0.4"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3661: error: in `/home/kirill/eleveldb/c_src/snappy-1.0.4':
configure:3665: error: C compiler cannot create executables
See `config.log' for more details.

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?

Problems when installing OPEN-MPI

I got some errors when I try to ./configure --prefix=/usr/local
Installed a bunch of stuff and openmpi versions, but they didn't work. I think previously this command worked, but after following different tuts, it gives errors.
Terminal is in the openmpi folder.
Help? ) Thank you in advance.
Terminal result:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out checking
for suffix of executables... checking whether we are cross
compiling... configure: error: in
`/Users/maximgavrilov/Documents/temp/openmpi-4.0.0': configure:
error: cannot run C compiled programs. If you meant to cross compile,
use `--host'. See `config.log' for more details
config.log (partially):
uname -m = x86_64
uname -r = 18.0.0
uname -s = Darwin
uname -v = Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018;
root:xnu-4903.201.2~1/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X = unknown
configure:5797: checking for perl
configure:5813: found /usr/bin/perl
configure:5825: result: perl
configure:5854: === Configuring Open MPI
configure:5870: *** Startup tests
configure:5986: checking build system type
configure:6000: result: x86_64-apple-darwin18.0.0
configure:6020: checking host system type
configure:6033: result: x86_64-apple-darwin18.0.0
configure:6053: checking target system type
configure:6066: result: x86_64-apple-darwin18.0.0
configure:6196: checking for gcc
configure:6212: found /usr/local/bin/gcc
configure:6223: result: gcc
configure:6452: checking for C compiler version
configure:6461: gcc --version >&5
gcc (GCC) 8.1.0
configure:6472: $? = 0
configure:6461: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-
darwin17.5.0/8.1.0/lto-wrapper
Target: x86_64-apple-darwin17.5.0
Configured with: ../gcc-8.1.0/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 8.1.0 (GCC)
configure:6472: $? = 0
configure:6461: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:6472: $? = 1
configure:6461: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean
'--version'?
gcc: fatal error: no input files
compilation terminated.
configure:6472: $? = 1
configure:6492: checking whether the C compiler works
configure:6514: gcc conftest.c >&5
configure:6518: $? = 0
configure:6566: result: yes
configure:6569: checking for C compiler default output file name
configure:6571: result: a.out
configure:6577: checking for suffix of executables
configure:6584: gcc -o conftest conftest.c >&5
configure:6588: $? = 0
configure:6610: result:
configure:6632: checking whether we are cross compiling
configure:6640: gcc -o conftest conftest.c >&5
In file included from conftest.c:10:
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-
fixed/stdio.h:80:14: error: expected ';' before 'extern'
__BEGIN_DECLS
^
;
extern FILE *__stdinp;
~~~~~~
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:81:8: error: unknown type name 'FILE'
extern FILE *__stdinp;
^~~~
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:82:8: error: unknown type name 'FILE'
extern FILE *__stdoutp;
^~~~
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:83:8: error: unknown type name 'FILE'
extern FILE *__stderrp;
^~~~
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:84:1: error: unknown type name '__END_DECLS'
__END_DECLS
^~~~~~~~~~~
/usr/local/lib/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:155:14: error: expected ';' before 'void'
__BEGIN_DECLS
^
;
void clearerr(FILE *);

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.

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

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"