Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel Compiler fails during final link (but g++ works)

oss_compiler
Beginner
2,336 Views

I was trying to build node.js with intel compiler. All files compile okay, but the final linking stage fails. Strangely, if I use g++ for final link, it still work. The error message isn't quite helpful either. I have tried changing optimization from O3 to O2 - but no difference

-------------

": internal error: ** The compiler has encountered an unexpected problem. ** Segmentation violation signal raised. ** Access violation or stack overflow. Please contact Intel Support for assistance. icpc: error #10014: problem during multi-file optimization compilation (code 4)

-------

Appreciate any pointers ? Thanks!

 

0 Kudos
30 Replies
oss_compiler
Beginner
597 Views

Viet - Any luck looking into how it compiles for you and not for me ? I am open to giving you access to my box too, if it helps

0 Kudos
Viet_H_Intel
Moderator
597 Views

Can you try the issue #2 on other machines to see if it's compile? 

For issue #1: it looks like a bug in compiler; so I have submitted a bug to the developer.

Thanks,

Viet 

0 Kudos
Viet_H_Intel
Moderator
597 Views

 

Does this simple test case compile on your system?

$ icpc test.cpp -O2 -c -std=c++14
$ cat test.cpp
#include <cstdint>


inline bool mongoSignedMultiplyOverflow64(int64_t lhs, int64_t rhs, int64_t* product);

inline bool mongoSignedMultiplyOverflow64( long long lhs, long long rhs, long long* product) {
    return __builtin_mul_overflow(lhs, rhs, product);
}

Thanks,

Viet

0 Kudos
oss_compiler
Beginner
597 Views

Turned out, that wouldn't compile. We have the simplest reproducer to see the failure. 

 

ubuntu@ip-172-31-41-174:~/cloudbin/test$ which icpc

/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icpc

ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc --version

icpc (ICC) 18.0.0 20170811

Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

 

ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc test.cpp -O2 -c -std=c++14

test.cpp(6): error: argument is incompatible with formal parameter

      return __builtin_mul_overflow(lhs, rhs, product);

             ^

 

compilation aborted for test.cpp (code 2)

0 Kudos
oss_compiler
Beginner
597 Views

I tried an experiments

#1) Started with a fresh ubuntu install. Installed gcc, g++ and then Intel compiler. Same build issue

Probably shouldn't matter. Which OS are you using ?

0 Kudos
Viet_H_Intel
Moderator
597 Views

 

vahoang@orcsle147:/tmp/vah/icc_errors/issue2_nobuildin$ cat test.cpp
#include <cstdint>


inline bool mongoSignedMultiplyOverflow64(int64_t lhs, int64_t rhs, int64_t* product);

inline bool mongoSignedMultiplyOverflow64( long long lhs, long long rhs, long long* product) {
    return __builtin_mul_overflow(lhs, rhs, product);
}

vahoang@orcsle147:/tmp/vah/icc_errors/issue2_nobuildin$ icpc test.cpp -O2 -c -std=c++14 -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.128 Build 20170811

vahoang@orcsle147:/tmp/vah/icc_errors/issue2_nobuildin$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)

 

You have other Linux machines with different OSes to try?

Let me try to find an ubuntu machine and try to see if I can reproduce it.

 

Thanks,

Viet 

0 Kudos
Viet_H_Intel
Moderator
597 Views

It compiled on my Ubuntu box.

vahoang@orcsle138:/tmp$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty


vahoang@orcsle138:/tmp$  icpc test.cpp -O2 -c -std=c++14 -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.128 Build 20170811

vahoang@orcsle138:/tmp$ ls -lt test.o
-rw-r--r-- 1 vahoang users 720 Nov 16 09:29 test.o

vahoang@orcsle138:/tmp$ cat test.cpp
#include <cstdint>

inline bool mongoSignedMultiplyOverflow64(int64_t lhs, int64_t rhs, int64_t* product);

inline bool mongoSignedMultiplyOverflow64( long long lhs, long long rhs, long long* product) {
    return __builtin_mul_overflow(lhs, rhs, product);
}
vahoang@orcsle138:/tmp$ gcc -v

gcc version 5.3.0 (GCC)
vahoang@orcsle138:/tmp$

0 Kudos
oss_compiler
Beginner
597 Views
ubuntu@ip-172-31-41-174:~/cloudbin/test$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc --version icpc (ICC) 18.0.0 20170811 Copyright (C) 1985-2017 Intel Corporation. All rights reserved. ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc test.cpp -O2 -c -std=c++14 -V Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.128 Build 20170811 Copyright (C) 1985-2017 Intel Corporation. All rights reserved. icpc: NOTE: The evaluation period for this product ends on 11-dec-2017 UTC. Edison Design Group C/C++ Front End, version 4.13 (Aug 12 2017 01:17:30) Copyright 1988-2017 Edison Design Group, Inc. test.cpp(6): error: argument is incompatible with formal parameter return __builtin_mul_overflow(lhs, rhs, product); ^ compilation aborted for test.cpp (code 2) ubuntu@ip-172-31-41-174:~/cloudbin/test$ source /opt/intel/compiler_2017update5/bin/compilervars.sh intel64 ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc --version icpc (ICC) 17.0.5 20170817 Copyright (C) 1985-2017 Intel Corporation. All rights reserved. ubuntu@ip-172-31-41-174:~/cloudbin/test$ icpc test.cpp -O2 -c -std=c++14 ubuntu@ip-172-31-41-174:~/cloudbin/test$ ubuntu@ip-172-31-41-174:~/cloudbin/test$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609 Copyright (C) 2015 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. Now going to back to my original code with 2017 update 5 compiler, I get the following error build/opt/mongo/base/error_codes.h(392): error: a constexpr variable declaration must be a definition constexpr bool isNamedCode = false; ^ detected during instantiation of "const bool mongo::error_details::isNamedCode [with code=0]" at line 394
0 Kudos
jimdempseyatthecove
Honored Contributor III
597 Views

IMHO, specifying a function prototype with inline is misleading, and should be flagged as in error.

Also, int64_t and long long are not universally interchangeable (IOW not necessarily equivalent).

Jim Dempsey

0 Kudos
oss_compiler
Beginner
597 Views

After few redbulls and painful experimentations with OS versions, compiler versions etc, I did rootcause the issue to my gcc version. I am not 100% sure whats going on and don't watch to touch my system - but after I upgraded my gcc to 6.3.0, my errors go away. I thought there would be no dependencies - but seems like there is something.

Now I am back to my original compilation (which doesn't work - but looking into it)

0 Kudos
Reply