GCC compilation error when installing Nokogiri - ruby

I'm trying to run bundle install but I'm getting the Error while trying to Install Nokogiri 1.10.3
Here is the error message from mkmf.log.
gcc -o conftest -I/home/chille/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/x86_64-linux -I/home/chille/.rvm/rubies/ruby-2.5.1/include/ruby-2$
gcc: error: unrecognized command line option '-Wmisleading-indentation'
gcc: error: unrecognized command line option '-Wimplicit-fallthrough=0'
gcc: error: unrecognized command line option '-Wduplicated-cond'
gcc: error: unrecognized command line option '-Wrestrict'

For those who do not read comments
Debian 10 users, if you find
gcc: error: unrecognized command line option '-Wduplicated-cond'
in mkmf.log
brew unlink gcc
is what you are looking for. I spend an hour looking for an answer and yes, i once missed the answer here, but luckily i have returned and spotted it.

I had faced a similar issue. My default compiler did not recognise certain command line options just like you are facing.
My gcc version was 10. I could solve it by adding an older gcc version (5.5) and set it as default for the gem installation purpose. I followed the step given in this thread to do so.

Related

Makefile: fatal error: NE10.h: No such file or directory

Currently trying to Makefile and encountered this error:
fatal error: NE10.h: No such file or directory
#include "NE10.h"
^~~~~~~~
compilation terminated
Am looking for the cause of this (is it related to the root directory?) and possible resolution of such an error?
Currently on a NVIDIA Xavier Arm Processor.
And
command -v g++
/usr/bin/g++
g++ --version
g++ (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Resolved this by doing an install of the NE10 package, then including in cmake/make process.
https://projectne10.github.io/Ne10/
Was missing the package on the whole, for anyone looking for this answer. Thanks!

Installing openmpi on OS/X: clang error: library -lgomp not found

I'm aiming to install openmpi 1.6.5 on my Macbook Pro, mountainlion 10.8.5, by following the straightforward guidelines at:
https://wiki.helsinki.fi/display/HUGG/Installing+Open+MPI+on+Mac+OS+X
While configuring with
./configure --prefix=/usr/local/bin F77=gfortran FC=gfortran
is successful, "make all" fails with:
clang: warning: argument unused during compilation: '-fopenmp'
CXXLD vtfilter
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[7]: *** [vtfilter] Error 1
As a complete newbie, I'm stuck on this error... I read about it error here:
Error enabling openmp - "ld: library not found for -lgomp" and Clang errors
(sorry for the new thread on possibly the same issue--this website's instructions guided me to not post a new question as an answer to an old thread...)
I'm not sure if these fixes apply here (?)-- I've tried the ordering within $PATH, which had no effect. Does this look like I have an issue with my compilers? If there is more useful information I can post, please let me know.
Thank you for your time and help!
It would be much easier if you simply disable building of the bundled VampirTrace library:
$ ./configure --enable-contrib-no-build=vt ...
If you still need to trace and profile your MPI applications, you could download VampirTrace and build it separately.

autoconf: command not found Installing Cappuccino (Objective J)

I'm trying to install cappuccino. When I ran "./bootstrap.sh"
I'm getting this error:
Would you like to build the JavaScriptCore engine? This is optional but will
make building and running Cappuccino and Objective-J much faster.
Enter "yes" or "no":
yes
./bootstrap.sh: line 362: autoconf: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'groups'
sh configure
Detected <JavaScriptCore/JavaScript.h>
clang -o lib/libnarwhal.dylib narwhal.c -dynamiclib -0s -force_cpusubtype_ALL -mmacosx-version-min=10.4 -arch i386 -Iinclude -framework JavaScriptCore
clang: error: unknown argument: '-0s' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [lib/libnarwhal.dylib] Error 1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: building narwhal-jsc failed. Hit enter to continue.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================
Bootstrapping of Cappuccino and other required tools is complete.
NOTE: any changes made to the shell configuration files won't take place until
you restart the shell.
Any of you knows can fix this or if is a work around this?
Use Homebrew to install autoconf... the command should be:
brew install autoconf
You may also need to install the XCode command line utilities for brew to work.
For exact details of how brew installs autoconf see its formula: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/autoconf.rb

Disable warnings in llvm-gcc

I'm trying to build an open source project with llvm-gcc 4.2 with -emit-llvm flag.
However I get many errors due to warning flags.
Example of these errors:
cc1: error: unrecognized command line option "-Warray-bounds"
cc1: error: unrecognized command line option "-Wjump-misses-init"
cc1: error: unrecognized command line option "-Wvla"
cc1: error: unrecognized command line option "-Wignored-qualifiers"
cc1: error: unrecognized command line option "-Wlogical-op"
cc1: error: unrecognized command line option "-fexcess-precision=fast"
In clang I would use -Wno-error to ignore them, but that doesn't seem to work with llvm-gcc.
Manually removing the flags does not seem reasonable considering that there are 144 Makefiles.
How would I approach this problem?
I was trying hard to search for recent information on llvm-gcc and failed. I concluded that it's a dead project that was part of former LLVM releases but is no longer actively developed. Therefore it doesn't support the same set of warnings as current GCC versions and you cannot expect it to work with the same command line.
The errors you're getting tell you which CLI options are not supported and you have no choice than to remove them or stop using llvm-gcc and switch to something more modern. According to the LLVM website, the project you're looking for is called dragonegg.
http://dragonegg.llvm.org/

rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion

I upgraded rvm to 1.15.8, then went back down to 1.15.7 after having some problems in zsh. After downgrading, my Ruby 1.9+ versions went back in fine, but 1.8.7 won't install again.
There are two errors that are occurring:
Error running 'patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"', please read /Users/me/.rvm/log/ruby-1.8.7-p352/patch.apply.stdout-rouge-fix.log
The contents of that file are:
[2012-09-11 01:05:59] patch -F 25 -p1 -N -f <"/Users/me/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch"
patching file lib/mkmf.rb
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file lib/mkmf.rb.rej
and:
Error running 'make ', please read /Users/me/.rvm/log/ruby-1.8.7-p352/make.log
There has been an error while running make. Halting the installation.
and the contents of that file are (only the first few lines beginning with the errors):
Fail to find [tclConfig.sh, tkConfig.sh]
Use MacOS X Frameworks.
Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk.
gcc-4.2 -I. -I../.. -I../../. -I../.././ext/tk -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2011-06-30\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -DWITH_TCL_ENABLE_THREAD=0 -fno-common -g -O2 -fno-common -pipe -fno-common -c stubs.c
In file included from stubs.c:10:
/usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory
In file included from stubs.c:10:
/usr/include/tk.h:549: error: expected declaration specifiers or ‘...’ before ‘Window’
/usr/include/tk.h:549: error: ‘Window’ declared as function returning a function
/usr/include/tk.h:552: error: expected declaration specifiers or ‘...’ before ‘XEvent’
/usr/include/tk.h:561: error: expected specifier-qualifier-list before ‘Tk_ClassCreateProc’
/usr/include/tk.h:655: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:677: error: expected specifier-qualifier-list before ‘Bool’
/usr/include/tk.h:756: error: expected specifier-qualifier-list before ‘Display’
/usr/include/tk.h:902: error: expected declaration specifiers or ‘...’ before ‘XPoint’
/usr/include/tk.h:996: error: expected declaration specifiers or ‘...’ before ‘Display’
One of the applications I support is 1.8.7. I am dead in the water. This looks like it might be a problem with Mountain Lion vs. rvm. Can anyone point me in the right direction?
UPDATE:
I got over the first error by doing "reinstall" instead of just "install". Even though 1.8.7-p352 was not in the list of rubies given by the command "rvm list rubies".
it is problem in detecting tcl/tk by ruby 1.8.7, the solution is to disable it:
rvm reinstall 1.8.7 --without-tcl --without-tk
the other solution when tcl/tk is needed: https://stackoverflow.com/a/11666019/497756
I think I ended up with two similar questions on sf here. My main problem was that the tcl.h include file on Mountain Lion (location: /usr/include/tcl.h symlinked) could not resolve an internal reference it had to "X11/Xlib.h". I thought that installing tcl and tk through homebrew would fix the problem by generating a path to Xlib.h that could be resolved. So I ran:
brew install tcl
and:
brew install tk
and:
rvm remove 1.8.7-p352
rvm install 1.8.7-p352
and it worked. But Michal's answer above would have worked just as well I think. This answer will serve to help people build it that need tcl and tk.

Resources