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

Intel Compiler & stdc++fs & debug mode doesn't work

Wani__Nehal
Beginner
2,070 Views
$ cat main.x.cpp 
#include <iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main()
{
    std::cout << "Current path is " << fs::current_path() << '\n';
}

$ icpc main.x.cpp -lstdc++fs -std=c++14   # Works!


$ icpc main.x.cpp -lstdc++fs -std=c++14 -g   # Doesn't work
/spare/scratch/icpcNgdXiG.o: In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::experimental::filesystem::v1::path::string<char, std::char_traits<char>, std::allocator<char> >(std::allocator<char> const&) const':
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:822: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::codecvt_utf8(unsigned long)'
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:822: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::~codecvt_utf8()'
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:825: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::~codecvt_utf8()'

$ icpc main.x.cpp -lstdc++fs -std=c++14 -g -mGLOB_opt_level=1  # Works!


This has been tested with Intel compilers 16 to 19 and the behavior is same.

0 Kudos
5 Replies
RahulV_intel
Moderator
2,070 Views

Hi,

It looks like a bug. We are able to reproduce this error. We will escalate this issue to the concerned team.

 

Rahul

0 Kudos
Viet_H_Intel
Moderator
2,070 Views

I've opened a case with the compiler Developer. Case# is CMPLRIL0-32514. Thanks,

0 Kudos
Viet_H_Intel
Moderator
1,632 Views

Can you use one of these workarounds?

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O1

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O2

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O3

$ icpx t3.cpp -std=c++14  -lstdc++fs -g

$


Thanks,





0 Kudos
ArpitaP_Intel
Moderator
1,597 Views

Hi Nehal,


Could you please let us know if your issue is resolved or not?


Regards,

Arpita


0 Kudos
PrasanthD_intel
Moderator
1,581 Views

Hi Nehal,


We are closing this thread as we haven't heard back from you. We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only


Regards

Prasanth


0 Kudos
Reply