I try to compile mono using cygwin(manual), but I get the following output:
checking whether the C compiler works... no
configure: error: in `/cygdrive/a/TempForCompile/mono-master':
configure: error: C compiler cannot create executables
See `config.log' for more details
Some parts of config.log:
gcc: error: unrecognized command line option '-mno-cygwin'
gcc: error: unrecognized command line option '-V'
How to fix this issue and compile mono?
Related
Instructions to repro:
$ git clone --depth=1 git://sourceware.org/git/elfutils.git
$ cd elfutils
$ autoreconf -i -f
$ ./configure
Error log:
...
checking whether the compiler generates build-ids... ./configure: line 6951: -n: command not found
no
configure: WARNING: compiler doesn't generate build-id by default
checking whether gcc supports -Wl,-z,relro... no
checking for __thread support... no
configure: error: __thread support required
What is missing here?
Machine details:
MacOS 12.3.1
While running npm install in one of my project I'm getting this following error:
CMake Error at /usr/local/Cellar/cmake/3.19.4/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Library/Developer/CommandLineTools/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/user.name/.nvm/versions/node/v8.17.0/lib/node_modules/#devicefarmer/stf/node_modules/#julusian/jpeg-turbo/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_e8f1f/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e8f1f.dir/build.make CMakeFiles/cmTC_e8f1f.dir/build
Building C object CMakeFiles/cmTC_e8f1f.dir/testCCompiler.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Users/user.name/Library/Android/sdk -o CMakeFiles/cmTC_e8f1f.dir/testCCompiler.c.o -c /Users/user.name/.nvm/versions/node/v8.17.0/lib/node_modules/#devicefarmer/stf/node_modules/#julusian/jpeg-turbo/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_e8f1f
/usr/local/Cellar/cmake/3.19.4/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e8f1f.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Users/user.name/Library/Android/sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/openssl#1.1/lib CMakeFiles/cmTC_e8f1f.dir/testCCompiler.c.o -o cmTC_e8f1f
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_e8f1f] Error 1
make: *** [cmTC_e8f1f/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
Tried uninstalling and installing CMake but no luck.
OS : MacOS Catalina 10.15.7
Node: v8.17.0
CMake: v3.19.4
Running stack build and even stack --nix build on a NixOS build yields the following:
Linking /run/user/1000/stack7176/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-nix/Cabal-1.22.5.0/setup/setup ...
Configuring old-time-1.1.0.3...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/run/user/1000/stack7176/old-time-1.1.0.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
I have installed gcc and clang on my system and verified that, i.e., gcc is indeed on my path. How to resolve this issue?
I'm trying to install a library on osx 10.11 but when I use cmake, it prints the output below. This has worked in the past (as in it worked yesterday), but something seems to have gone wrong since then. I've looked for an answer but can't seem to find anything that works. My Xcode and Xcode command line tools are all up to date. My cmake is up to date. I tried uninstalling and reinstalling it to no avail. I've tested the c compiler and it's working as it should as far as I can tell. My openssl is also up to date, I tried reinstalling that as well without success. My Clang version is 7.0.0 (clang-700.0.72). It's probably something obvious that I'm missing. Any ideas would be greatly appreciated.
$ pwd
<*current directory*>
$ mkdir build
$ cd build
$ cmake ..
-- The C compiler identification is AppleClang 7.0.0.7000072
-- The CXX compiler identification is AppleClang 7.0.0.7000072
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: <*current directory*>/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_e9215/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
CMakeFiles/cmTC_e9215.dir/build.make CMakeFiles/cmTC_e9215.dir/build
Building C object CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-o CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o -c
<*current directory*>/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_e9215
/usr/local/Cellar/cmake/3.3.2/bin/cmake -E cmake_link_script
CMakeFiles/cmTC_e9215.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-Wl,-search_paths_first -Wl,-headerpad_max_install_names
/usr/local/opt/openssl/lib CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o -o
cmTC_e9215
ld: can't map file, errno=22 file '/usr/local/opt/openssl/lib' for
architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[1]: *** [cmTC_e9215] Error 1
make: *** [cmTC_e9215/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:9 (project)
-- Configuring incomplete, errors occurred!
See also "<*current directory*>/build/CMakeFiles/CMakeOutput.log".
See also "<*current directory*>/build/CMakeFiles/CMakeError.log".
This is the output of <current directory>/build/CMakeFiles/CMakeOutput.log:
The system is: Darwin - 15.0.0 - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is AppleClang, found in "<*current directory*>/build/CMakeFiles/3.3.2/CompilerIdC/a.out"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is AppleClang, found in "<*current directory*>/build/CMakeFiles/3.3.2/CompilerIdCXX/a.out"
And this is the output of <current directory>/build/CMakeFiles/CMakeError.log:
Determining if the C compiler works failed with the following output:
Change Dir: <*current directory*>/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_e9215/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e9215.dir/build.make CMakeFiles/cmTC_e9215.dir/build
Building C object CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o -c <*current directory*>/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_e9215
/usr/local/Cellar/cmake/3.3.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e9215.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Wl,-search_paths_first -Wl,-headerpad_max_install_names /usr/local/opt/openssl/lib CMakeFiles/cmTC_e9215.dir/testCCompiler.c.o -o cmTC_e9215
ld: can't map file, errno=22 file '/usr/local/opt/openssl/lib' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_e9215] Error 1
make: *** [cmTC_e9215/fast] Error 2
EDIT:
Simple restart seemed to fix it. The obvious answer that I should have tried first. Sorry for wasting your time
The error is ld: can't map file, errno=22 file '/usr/local/opt/openssl/lib' for architecture x86_64. Looks to me like that is a directory, not a file. You can run the cmake command on the line above and try adding -L in front.
It turns out it was the obvious solution. Off and on again. There's now a different error but one I think I can fix. Sorry for wasting everyone's time
I'm trying to build gperf(Google's profiler) from source. During build process the following error comes up :
src/stacktrace_config.h:58:5: error: #error Cannnot calculate stack trace: need either libunwind or frame-pointers (see INSTALL file)
src/stacktrace.cc:109:3: error: #error Cannot calculate stack trace: will need to write for your environment
make: *** [stacktrace.lo] Error 1
So it seems i need libunwind.
1) I got the library from savannah's git repo.
2) Installed it in /opt/unwind.
3) I also added /opt/unwind/lib/pkgconfig to my PKG_CONFIG_PATH.
4) I edited libunwind.pc so that both pkg-config --cflags --libs libunwind comes up with correct values.
5) I added a libunwind.conf in /etc/ld.so.conf.d/ pointing to /opt/unwind/lib.
After all of these i've rerun ./configure in gperf root directory.
The config.log reads following :
configure:15852: checking libunwind.h usability
configure:15852: gcc -c -g -O2 conftest.c >&5
conftest.c:67:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
configure:15852: result: no
<***snip****>
configure:15852: checking libunwind.h presence
configure:15852: gcc -E conftest.c
conftest.c:34:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
<***snip***>
ac_cv_header_libunwind_h=no
So it seems It still does not know where libunwind is.
Then i tried to set environment variables with CFLAGS and LDFLAGS like following :
arif#khost:~/src/gperf$ CFLAGS=`pkg-config --cflags libunwind` LDFLAGS=`pkg-config --libs libunwind` ./configure
Now config.log seems more puzzling :
configure:15852: checking libunwind.h usability
configure:15852: gcc -c -I/opt/unwind/include conftest.c >&5
configure:15852: $? = 0
configure:15852: result: yes
configure:15852: checking libunwind.h presence
configure:15852: gcc -E conftest.c
conftest.c:34:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
It reports first that there is libunwind.h but later it cant find it.
config.log also has this curious entry :
configure:15852: WARNING: libunwind.h: accepted by the compiler, rejected b y the preprocessor!
configure:15852: WARNING: libunwind.h: proceeding with the compiler's result
Also its putting up ac_cv_header_libunwind_h=yes
If i do make here it stops with the following error:
In file included from src/stacktrace.cc:65:0:
src/stacktrace_libunwind-inl.h:46:23: fatal error: libunwind.h: No such file or directory
compilation terminated.
make: *** [stacktrace.lo] Error 1
You need the libunwind headers too. Install the libunwind-devel package or equivalent.
Similar to bwzhou's answer, I tried following the answers in this SO question:
How to add include and lib paths to configure/make cycle?
and was able to finally get past the fatal error: libunwind.h: No such file or directory error when compiling gperftools with libunwind-1.2.1 compiled beforehand. More specifically, I set CPPFLAGS and LDFLAGS using the commands:
export CPPFLAGS='-I'$MY_INSTALL_DIR'/include '$CPPFLAGS
export LDFLAGS='-L'$MY_INSTALL_DIR'/lib '$CPPFLAGS
prior to executing ./configure --prefix=$MY_INSTALL_DIR, where $MY_INSTALL_DIR is my personal, non-standard directory in which I have to install software in the HPC cluster I work with due to lacking adequate permissions. After doing this, I was able to successfully execute make; make install. I hope this is helpful.
Try CPPFLAGS instead of CFLAGS when you invoke configure.