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

Build failure with with newer 2022.2. compiler in pipeline

fittyCent
Beginner
3,791 Views

- Implicit function declarations used to be just a warning in the 2022.1 compiler (-Wimplicit-function-declaration). Also, my compilation would fully go through in this compiler.

- It's now an error in the 2022.2 compiler. There are several other things where it's stricter I think because even adding that -W flag to the compilation, it starts to complain about something else.

Here are the compiler versions:

2022.2.0-262 basekit -> used to contain the 2022.1 compiler. This is when my build worked.

2022.3 basekit -> 2022.2 compiler

 

I tried reverting basekit back to v2022.2.0-262 but it now contains the 2022.2 compiler where things are stricter.

I have a script that builds a docker image (where intel basekit is installed) and then this docker image is used to build my project. Is there a way to lock down the version of the compiler whenever this image is rebuilt? This is so I wouldn't have to fix things whenever I make unrelated changes to the build image and the compiler gets updated unintentionally.

 

Thanks!

0 Kudos
11 Replies
VarshaS_Intel
Moderator
3,754 Views

Hi,


Thanks for posting in Intel Communities.


>> It's now an error in the 2022.2 compiler.

Sorry for the inconvenience caused to you. 


Could you please let us know the OS, CPU details, and Intel C++ compiler you are using?


Could you please provide us with a sample reproducer code and steps to reproduce your issue to investigate more at our end?


Thanks & Regards,

Varsha


0 Kudos
fittyCent
Beginner
3,741 Views

OS: Ubuntu 20.04.4 LTS

CPU: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz

 

I've attached a main.c and CMakeLists.txt.

 

This is what I get when building this with IntelLLVM 2022.1.0

root@e29b9776f70a:/repos/testProject/build# cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is IntelLLVM 2022.1.0
-- The CXX compiler identification is IntelLLVM 2022.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/icx - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /repos/testProject/build
root@e29b9776f70a:/repos/testProject/build# make
[ 50%] Building C object CMakeFiles/test-project.dir/main.c.o
/repos/testProject/main.c:9:16: warning: implicit declaration of function 'strtod_l' is invalid in C99 [-Wimplicit-function-declaration]
  double num = strtod_l(str, NULL, loc);
               ^
1 warning generated.
[100%] Linking C executable test-project
[100%] Built target test-project

 

Here's what happens when i build with IntelLLVM 2022.2.0

root@7896905685e0:/repos/testProject/build# cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is IntelLLVM 2022.2.0
-- The CXX compiler identification is IntelLLVM 2022.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/2022.2.0/linux/bin/icx - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2022.2.0/linux/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /repos/testProject/build
root@7896905685e0:/repos/testProject/build# make
[ 50%] Building C object CMakeFiles/test-project.dir/main.c.o
/repos/testProject/main.c:8:16: error: call to undeclared function 'strtod_l'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  double num = strtod_l(str, NULL, loc);
               ^
/repos/testProject/main.c:9:3: error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  printf("%f", num);
  ^
/repos/testProject/main.c:9:3: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'
2 errors generated.
make[2]: *** [CMakeFiles/test-project.dir/build.make:76: CMakeFiles/test-project.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/test-project.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

 

- The compilation with IntelLLVM 2022.1.0 above was done using a docker image that had intel-basekit 2022.2.0-262 installed and the image was created a few weeks ago.

- The compilation with IntelLLVM 2022.2.0 was done using a docker image that was created yesterday (10/5) and it had intel-basekit 2022.3.0-8767 installed.

   - In this newer image, I tried uninstalling intel-basekit 2022.3.0-8767 and installing an older version (2022.2.0-262) but the compiler version is still IntelLLVM 2022.2.0.

 

I guess my main question is not so much why it's failing in the newer compiler but how do I lock down the compiler version so that when a new docker image is built, I won't encounter updated compilers that would break the compilation of my code. I tried doing something like `apt install intel-basekit=2022.2.0-262` in the Dockerfile so that the image that the version of intel-basekit is locked down but as said earlier, the compiler version is still different from a few weeks ago.

 

 

Please let me know if you need more info.

0 Kudos
VarshaS_Intel
Moderator
3,675 Views

Hi,

 

Thanks for providing the details.

 

You can find the docker image of the Intel Base Toolkit at this link https://hub.docker.com/r/intel/oneapi-basekit/tags.

 

We have tried downloading oneAPI Base Toolkit 2022.2 and oneAPI Base Toolkit 2022.3. In both versions, we are able to get the expected output without any error.

 

Please find the below screenshots(both base toolkit 2022.2 and base toolkit 2022.3) for more details:

2022_2_docker.png

2022_3_docker.png

 

Thanks & Regards,

Varsha

 

0 Kudos
fittyCent
Beginner
3,667 Views
The C compiler is set to GNU when you were compiling. I believe _GNU_SOURCE is defined by default there. Try recompiling with the C compiler set to 2022.1 vs 2022.2 and you'll probably be able to recreate the issue.
0 Kudos
VarshaS_Intel
Moderator
3,546 Views

Hi,


Could you please try adding the option "-Wno-implicit-function-declaration" at the time of compilation?


Thanks & Regards,

Varsha


0 Kudos
fittyCent
Beginner
3,478 Views

Thanks, but that's not the point.

 

From the original question:


@fittyCent wrote:

- Implicit function declarations used to be just a warning in the 2022.1 compiler (-Wimplicit-function-declaration). Also, my compilation would fully go through in this compiler.

- It's now an error in the 2022.2 compiler. There are several other things where it's stricter I think because even adding that -W flag to the compilation, it starts to complain about something else.

Here are the compiler versions:

2022.2.0-262 basekit -> used to contain the 2022.1 compiler. This is when my build worked.

2022.3 basekit -> 2022.2 compiler

 

I tried reverting basekit back to v2022.2.0-262 but it now contains the 2022.2 compiler where things are stricter.

I have a script that builds a docker image (where intel basekit is installed) and then this docker image is used to build my project. Is there a way to lock down the version of the compiler whenever this image is rebuilt? This is so I wouldn't have to fix things whenever I make unrelated changes to the build image and the compiler gets updated unintentionally.

 

Thanks!


Again, I have a script that builds a docker image (where intel basekit is installed) and then this docker image is used to build my project. Is there a way to lock down the version of the compiler whenever this image is rebuilt? This is so I wouldn't have to fix things whenever I make unrelated changes to the build image and the compiler gets updated unintentionally.

0 Kudos
VarshaS_Intel
Moderator
3,383 Views

Hi,


Could you please share with us the script file you are using and the steps you have followed?


Thanks & Regards,

Varsha


0 Kudos
fittyCent
Beginner
3,340 Views

This is what I have in my dockerfile to install basekit


    wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null \
    && echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list \
    && apt update \
    && apt install intel-basekit=2022.3.0-8767 -y \
    && rm -rf /opt/intel/oneapi/intelpython \
    /opt/intel/oneapi/ccl \
    /opt/intel/oneapi/conda_channel \
    /opt/intel/oneapi/dal \
    /opt/intel/oneapi/debugger \
    /opt/intel/oneapi/dev-utilities \
    /opt/intel/oneapi/diagnostics \
    /opt/intel/oneapi/dnnl \
    /opt/intel/oneapi/dpcpp-ct \
    /opt/intel/oneapi/dpl \
    /opt/intel/oneapi/ipp \
    /opt/intel/oneapi/ippcp \
    /opt/intel/oneapi/mpi \
    /opt/intel/oneapi/tbb \
    /opt/intel/oneapi/vpl \
    /opt/intel/oneapi/vtune​

 

 

 The `rm` command is run at the end to remove the components of basekit that aren't needed for what I do.

0 Kudos
VarshaS_Intel
Moderator
3,275 Views

Hi,

 

Since you are using the latest Intel Basetoolkit(2022.3) from the official download page, you can access only the latest version of the Toolkit. 

 

To access older releases you need a version that includes Intel Priority Support, the free versions do not include this. Here is a link to the online store where you can get a commercially supported version >>> https://softwarestore.intel.com/

 

And also, the error(using Intel LLVM compiler 2022.1) which used to be a warning in the previous version(Intel LLVM compiler 2022.1(clang 14)) is coming from clang 15. When the ICX compiler embraced clang 15, that behavior was inherited. 

 

Thanks & Regards,

Varsha

 

0 Kudos
VarshaS_Intel
Moderator
3,232 Views

Hi,


We assume that your query is resolved. Could you please provide us with an update?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
3,138 Views

Hi,


We have not heard back from you. We assume that your query is resolved. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks & Regards,

Varsha


0 Kudos
Reply