Problems when installing OPEN-MPI - c++

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 *);

Related

configure: error: Fortran compiler cannot create executables

I'm trying to install Quantum ESPRESSO on my computer and have run into an issue when using the ./configure command in the unpacked directory.
$ ./configure
checking build system type... x86_64-apple-darwin21.2.0
checking ARCH... mac686
checking setting AR... ... ar
checking setting ARFLAGS... ... ruv
checking for gfortran... gfortran
checking whether the Fortran compiler works... no
configure: error: in `/Users/myname/winter/q-e-qe-6.8':
configure: error: Fortran compiler cannot create executables
See `config.log' for more details
I just updated to macOS Monterey and have GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0 installed.
When trying to debug this, I looked at the config.log file and looked at similar googled questions. They all point me to updating or reinstalling things, like gcc, which I subsequently did.
Does the problem have to do with this:
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I can see that the version is 4.2.1, but I'm unaware of what Apple clang is. Is it a PATH issue?
I'd appreciate any help.
P.S. Please choose to be kind in responses.
Here is part of the config.log:
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Homebrew GCC 11.2.0_3)
configure:2542: $? = 0
configure:2531: gfortran -V >&5
gfortran: error: unrecognized command-line option '-V'
gfortran: fatal error: no input files
compilation terminated.
configure:2542: $? = 1
configure:2531: gfortran -qversion >&5
gfortran: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gfortran: fatal error: no input files
compilation terminated.
configure:2542: $? = 1
configure:2557: checking whether the Fortran compiler works
configure:2579: gfortran conftest.f >&5
clang: error: invalid version number in '-mmacosx-version-min=12.1'
configure:2583: $? = 1
configure:2621: result: no
configure: failed program was:
| program main
For reference:
$ gfortran --version
GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0
Copyright (C) 2021 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.```
I had the same issue and I solved by doing the following:
Removing the old tools
($ sudo rm -rf /Library/Developer/CommandLineTools).
Installing xcode command line tools again
($ xcode-select --install).
It was retrieved from:
How to update Xcode from command line

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.

msys and tdm-gcc: configure error - cannot run C compiled programs

so I'm trying to compile a preexisting C++ project with msys and tdm-gcc in Windows. I have done this successfully by installing tdm-gcc (latest version) via the installer, editing MinGW/msys/1.0/etc/fstab to give my tdm-gcc install as the mount location, then running msys to call the configure script, and make.
However, for this project I need to use an old version of tdm-gcc (4.6.1-tdm64-1) for binary compatibility. So I installed the required packages from the tdm-gcc sourceforge site (gcc core, gcc c++, binutils, mingw64-runtime, mingw32-make, libintl, libiconv, all of the version the readme says to use with 4.6.1), extracted to a new directory, and edited fstab to point to their location. Now while executing the configure I get this error: cannot run C compiled programs. The config file reads:
[omitted]
configure:3436: $? = 0
configure:3425: gcc -v >&5
Using built-in specs.
COLLECT_GCC=c:\TDM-GCC-4.6.1-64\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/tdm-gcc-4.6.1-64/bin/../libexec/gcc/x86_64-w64-mingw32/4.6.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../src/gcc-4.6.1/configure --build=x86_64-w64-mingw32 --enable- targets=all --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --enable-lto --enable-libstdcxx-debug --enable-version-specific-runtime-libs --enable-fully-dynamic-string --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: win32
gcc version 4.6.1 (tdm64-1)
configure:3436: $? = 0
configure:3425: gcc -V >&5
gcc.exe: error: unrecognized option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3436: $? = 1
configure:3425: gcc -qversion >&5
gcc.exe: error: unrecognized option '-qversion'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3436: $? = 1
configure:3456: checking whether the C compiler works
configure:3478: gcc conftest.c >&5
configure:3482: $? = 0
configure:3530: result: yes
configure:3533: checking for C compiler default output file name
configure:3535: result: a.exe
configure:3541: checking for suffix of executables
configure:3548: gcc -o conftest.exe conftest.c >&5
configure:3552: $? = 0
configure:3574: result: .exe
configure:3596: checking whether we are cross compiling
configure:3604: gcc -o conftest.exe conftest.c >&5
configure:3608: $? = 0
configure:3615: ./conftest.exe
./configure: line 3617: ./conftest.exe: Bad file number
configure:3619: $? = 126
configure:3626: error: in `/c/jagswm':
configure:3628: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
[omitted]
I've tried adding the tdm-gcc bin to my path, although I don't think that should matter if fstab is set.
Any advice would be greatly appreciated, thanks.
Try to disable your antivirus.
Worked for me while compiling GStreamer, probably because Avast was deleting the a.exe file.
Source: http://wiki.openttd.org/Compiling_on_Windows_using_MinGW#Compilation_and_installation_of_the_required_packages

Can't compile SQLCipher on Windows

I'm trying to compile SQLCipher. I've downloaded source code from http://sqlcipher.net/.
Then I'm doing from this post:
[http://groups.google.com/group/sqlcipher/browse_thread/thread/55c6296b56bf4533:][1]
[1]
I installed MinGW (set path to gcc: d:\MinGW\bin), OpenSSL and ActiveState Perl. I copyied file libeay32.dll to sqlcipher directory. Than I try execute this command:
./configure --disable-tcl CFLAGS="-DSQLITE_HAS_CODEC
-I/path/to/openssl/include" LDFLAGS="-leay32"
and I got error:
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
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.
Config.log shows:
configure:2537: $? = 0
configure:2544: gcc -v >&5
Using built-in specs.
COLLECT_GCC=D:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC)
configure:2548: $? = 0
configure:2555: gcc -V >&5
gcc.exe: '-V' option must have argument
configure:2559: $? = 1
configure:2582: checking for C compiler default output file name
configure:2604: gcc -DSQLITE_HAS_CODEC -l/d/OpenSSL-Win32/bin -libeay32 conftest.c >&5
**d:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -ld:/OpenSSL-Win32/bin
d:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -libeay32**
collect2: ld returned 1 exit status
I don't know what is -leay32. I copied file libeay32.dll to sqlcipher directory. In D there is directory OpenSSL-Win32.
Thanks
Try this for your configure command:
./configure –disable-tcl CFLAGS=”-DSQLITE_HAS_CODEC –Ic:/path/to/openssl/include –Lc:/path/to/openssl/lib –leay32”
-leay32 is a library flag, so think of it like "-l eay32". It's referred to as "eay32" because the library flag ignores the "lib" of "libeay32".