Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with gcc: error: unrecognized command line option '-V' #64

Closed
kuntalacharyya opened this issue Apr 17, 2019 · 9 comments

Comments

@kuntalacharyya
Copy link

kuntalacharyya commented Apr 17, 2019

Compilation is terminated with following error message during configuration phase:
configure:3372: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.

I am using isa-l version: v2.26
Installed gcc version : gcc-4.8.5-36.el7_6.1.x86_64
RHEL 7.5 x86

@gbtucker
Copy link
Contributor

Can you post more of the configure output? Were there warnings before this? I think you may be missing some basic setup.

@kuntalacharyya
Copy link
Author

Hi Thanks for looking into this. I have followed the below procedure to compile the code:

yum install autoconf ;
yum install libtool ;
yum install yasm-1.2.0-4.el7.x86_64.rpm;
unzip isa-l-master.zip;
cd ./isa-l-master/
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make;
make install

I have followed the same procedure in another setup and it worked fine. In the working setup I have different gcc version : gcc-4.8.5-28.el7.x86_64.

Please find the attached config.log , command output and installed RPM list.
config.log
Installed_rpm_list.txt
ISA-L-Command_Output.txt

@kuntalacharyya
Copy link
Author

Sorry Close accidentally.

@kuntalacharyya
Copy link
Author

kuntalacharyya commented Apr 18, 2019

Hi Thanks for looking into this. I have followed the below procedure to compile the code:

yum install autoconf ;
yum install libtool ;
yum install yasm-1.2.0-4.el7.x86_64.rpm;
unzip isa-l-master.zip;
cd ./isa-l-master/
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64
make;
make install

I have followed the same procedure in another setup and it worked fine. In the working setup I have different gcc version : gcc-4.8.5-28.el7.x86_64.

Please find the attached config.log , command output and installed RPM list from the failing server.
config.log
Installed_rpm_list.txt
ISA-L-Command_Output.txt

@kuntalacharyya
Copy link
Author

Here is the Linux version:

uname -a

Linux node1 3.10.0-957.5.1.el7.x86_64 #1 SMP Wed Dec 19 10:46:58 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.5 (Maipo)

@gbtucker
Copy link
Contributor

Looking at your config log I don't think the issue is lack of -V. Configure checks lots of things that can fail just looking for availability. The real problem is when it fails a simple compiler works test as below, just trying to compile a hello world app. You may not have the full linker or libc installed. You might try your own hello world app to see if the default paths work.

configure:3405: checking whether the C compiler works
configure:3427: gcc    conftest.c  >&5
collect2: fatal error: cannot find 'ld'
compilation terminated.
configure:3431: $? = 1
configure:3469: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libisal"
| #define PACKAGE_TARNAME "isa-l"
| #define PACKAGE_VERSION "2.26.0"
| #define PACKAGE_STRING "libisal 2.26.0"
| #define PACKAGE_BUGREPORT "sg.support.isal@intel.com"
| #define PACKAGE_URL "http://01.org/storage-acceleration-library"
| #define PACKAGE "isa-l"
| #define VERSION "2.26.0"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }

@kuntalacharyya
Copy link
Author

Hi Greg
You are right!! I tried the below "hello world" code snippet and compilation failed with errors. Can you please advise me how to fix this ? What could be possibly going wrong here ?

Hello world snippet

#include <stdio.h>
int main()
{
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}

Compile Error

gcc hello_world.c

In file included from /usr/include/features.h:399:0,
from /usr/include/stdio.h:27,
from hello_world.c:1:
/usr/include/gnu/stubs.h:10:27: fatal error: gnu/stubs-64.h: No such file or directory

include <gnu/stubs-64.h>

                       ^

compilation terminated.

@kuntalacharyya
Copy link
Author

Hi Greg,

The issue has now been resolved now.

Fix:

  1. Install glibc-devel.x86_64
    # yum install glibc-devel.x86_64
  2. create a soft link to the linker program in /usr/bin/ pointing to /etc/alternatives/ld
    # cd /usr/bin/

    ln -s /etc/alternatives/ld

     # which ld
        /usr/bin/ld 
     # ls -l /usr/bin/ld
         lrwxrwxrwx 1 root root 20 Apr 19 16:50 /usr/bin/ld -> /etc/alternatives/ld
    

It is weird that the link is missing in the first place. But after performing the above steps compilation completed successfully. Thank you for looking into the issue and your guidance. Appreciate you quick reply too.

@gbtucker
Copy link
Contributor

Good to hear. Perhaps binutils was installed incorrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants