NVCC `__type_pack_element` error when using libc++ and clang Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!CUDA: commands don't work after nvccGetting error 255 when compiling with nvccCan't add compiler options for nvcc in nsight eclipseCompiling CUDA + Intel MKL with Eclipse Nsight'nvcc not found' in NetBeans 8.2 only“make” command is using wrong clang compiler (to compile CUDA samples) - how to fix this?Building CUDA 9 application from Visual Studio 2017How to install NVIDIA CuDNN v7 for CUDA 9.1 for Tensorflow on OS X High Sierra 10.13.2?Thrust+boost code compilation errorMake Error 127 -( obj/convolutioanl_kernels.o) while compiling Yolo (Darknet) with GPU=1

Find 108 by using 3,4,6

How do I use the new nonlinear finite element in Mathematica 12 for this equation?

What are the diatonic extended chords of C major?

Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?

Did Deadpool rescue all of the X-Force?

Is there a kind of relay that only consumes power when switching?

Why does the remaining Rebel fleet at the end of Rogue One seem dramatically larger than the one in A New Hope?

Is there any word for a place full of confusion?

What's the meaning of "fortified infraction restraint"?

Can anything be seen from the center of the Boötes void? How dark would it be?

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

Morning, Afternoon, Night Kanji

How were pictures turned from film to a big picture in a picture frame before digital scanning?

What initially awakened the Balrog?

Is it a good idea to use CNN to classify 1D signal?

Dating a Former Employee

Question about debouncing - delay of state change

How to compare two different files line by line in unix?

Is it fair for a professor to grade us on the possession of past papers?

Effects on objects due to a brief relocation of massive amounts of mass

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

Project Euler #1 in C++

Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?

If Windows 7 doesn't support WSL, then what does Linux subsystem option mean?



NVCC `__type_pack_element` error when using libc++ and clang



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!CUDA: commands don't work after nvccGetting error 255 when compiling with nvccCan't add compiler options for nvcc in nsight eclipseCompiling CUDA + Intel MKL with Eclipse Nsight'nvcc not found' in NetBeans 8.2 only“make” command is using wrong clang compiler (to compile CUDA samples) - how to fix this?Building CUDA 9 application from Visual Studio 2017How to install NVIDIA CuDNN v7 for CUDA 9.1 for Tensorflow on OS X High Sierra 10.13.2?Thrust+boost code compilation errorMake Error 127 -( obj/convolutioanl_kernels.o) while compiling Yolo (Darknet) with GPU=1



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















I'm trying to compile a very simple cuda file:



#include <tuple>

__global__
void hello()
return;


int main()
dim3 dimBlock(16, 1);
dim3 dimGrid(1, 1);
hello<<<dimGrid, dimBlock>>();

return 0;



I am using CUDA 9.0 and clang 3.9.1 with its accompanying libc++. Clag is not
installed in an standard location and I'm trying to compile the file with the
following command:



PATH=/path/to/clang/bin:$PATH 
path/to/nvcc
--verbose
-D_FORCE_INLINES
-gencode=arch=compute_35,"code=sm_35,compute_35"
-gencode=arch=compute_37,"code=sm_37,compute_37"
-gencode=arch=compute_52,"code=sm_52,compute_52"
-DNDEBUG
-std=c++11
--compiler-options "
-nostdinc
-nostdinc++
-isystem /path/to/clang/include/c++/v1
-isystem /usr/local/include
-isystem /path/to/clang/lib/include
-isystem /path/to/clang/lib/clang/3.9.1/include
-isystem /usr/include/x86_64-linux-gnu
-isystem /usr/include
-isystem /path/to/cuda/includes
-iquote .
-g0
-no-canonical-prefixes
-fPIC
"
--compiler-bindir=/path/to/clang/bin/clang++
-I .
-x cu
-O3
-c main.cu
-o main.cu.o


That compilation fails with the following error:



#$ cicc --c++11 --clang --clang_version=30901 --unicode_source_kind=UTF-8 --allow_managed -arch compute_52 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_00004816_00000000-2_main.cu.fatbin.c" -tused -nvvmir-library "path/to/cuda9/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_00004816_00000000-3_main.cu.module_id" --orig_src_file_name "main.cu" --gen_c_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.c" --stub_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.gpu" "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii" -o "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.ptx"
/path/to/clang/include/c++/v1/__tuple(265): error: __type_pack_element is not a template

/path/to/clang/include/c++/v1/__tuple(332): error: identifier "__type_pack_element" is undefined

/path/to/clang/include/c++/v1/__tuple(332): error: parameter pack "_Idx" was referenced but not expanded

/path/to/clang/include/c++/v1/__tuple(332): error: expected a ";"

4 errors detected in the compilation of "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii".
# --error 0x1 --


From what I figured out __type_pack_element is checked in case it is a clang
built-in, if it isn't it is defined. In the first pass of nvcc, it calls the
clang preprocessor which clearly knows __type_pack_element is a built in so
the preprocessor skips the section defining the type, but the cicc pass fails
because it doesn't have __type_pack_element as a built int.



Removing the tuple include causes the compilation to succeed. Using any other
stl include file succeeds.



The used clang was downloaded from the llvm page










share|improve this question

















  • 1





    I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

    – talonmies
    Mar 24 at 10:17












  • @talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

    – Sambatyon
    Mar 26 at 8:10











  • The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

    – talonmies
    Mar 26 at 8:57

















-1















I'm trying to compile a very simple cuda file:



#include <tuple>

__global__
void hello()
return;


int main()
dim3 dimBlock(16, 1);
dim3 dimGrid(1, 1);
hello<<<dimGrid, dimBlock>>();

return 0;



I am using CUDA 9.0 and clang 3.9.1 with its accompanying libc++. Clag is not
installed in an standard location and I'm trying to compile the file with the
following command:



PATH=/path/to/clang/bin:$PATH 
path/to/nvcc
--verbose
-D_FORCE_INLINES
-gencode=arch=compute_35,"code=sm_35,compute_35"
-gencode=arch=compute_37,"code=sm_37,compute_37"
-gencode=arch=compute_52,"code=sm_52,compute_52"
-DNDEBUG
-std=c++11
--compiler-options "
-nostdinc
-nostdinc++
-isystem /path/to/clang/include/c++/v1
-isystem /usr/local/include
-isystem /path/to/clang/lib/include
-isystem /path/to/clang/lib/clang/3.9.1/include
-isystem /usr/include/x86_64-linux-gnu
-isystem /usr/include
-isystem /path/to/cuda/includes
-iquote .
-g0
-no-canonical-prefixes
-fPIC
"
--compiler-bindir=/path/to/clang/bin/clang++
-I .
-x cu
-O3
-c main.cu
-o main.cu.o


That compilation fails with the following error:



#$ cicc --c++11 --clang --clang_version=30901 --unicode_source_kind=UTF-8 --allow_managed -arch compute_52 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_00004816_00000000-2_main.cu.fatbin.c" -tused -nvvmir-library "path/to/cuda9/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_00004816_00000000-3_main.cu.module_id" --orig_src_file_name "main.cu" --gen_c_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.c" --stub_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.gpu" "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii" -o "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.ptx"
/path/to/clang/include/c++/v1/__tuple(265): error: __type_pack_element is not a template

/path/to/clang/include/c++/v1/__tuple(332): error: identifier "__type_pack_element" is undefined

/path/to/clang/include/c++/v1/__tuple(332): error: parameter pack "_Idx" was referenced but not expanded

/path/to/clang/include/c++/v1/__tuple(332): error: expected a ";"

4 errors detected in the compilation of "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii".
# --error 0x1 --


From what I figured out __type_pack_element is checked in case it is a clang
built-in, if it isn't it is defined. In the first pass of nvcc, it calls the
clang preprocessor which clearly knows __type_pack_element is a built in so
the preprocessor skips the section defining the type, but the cicc pass fails
because it doesn't have __type_pack_element as a built int.



Removing the tuple include causes the compilation to succeed. Using any other
stl include file succeeds.



The used clang was downloaded from the llvm page










share|improve this question

















  • 1





    I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

    – talonmies
    Mar 24 at 10:17












  • @talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

    – Sambatyon
    Mar 26 at 8:10











  • The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

    – talonmies
    Mar 26 at 8:57













-1












-1








-1








I'm trying to compile a very simple cuda file:



#include <tuple>

__global__
void hello()
return;


int main()
dim3 dimBlock(16, 1);
dim3 dimGrid(1, 1);
hello<<<dimGrid, dimBlock>>();

return 0;



I am using CUDA 9.0 and clang 3.9.1 with its accompanying libc++. Clag is not
installed in an standard location and I'm trying to compile the file with the
following command:



PATH=/path/to/clang/bin:$PATH 
path/to/nvcc
--verbose
-D_FORCE_INLINES
-gencode=arch=compute_35,"code=sm_35,compute_35"
-gencode=arch=compute_37,"code=sm_37,compute_37"
-gencode=arch=compute_52,"code=sm_52,compute_52"
-DNDEBUG
-std=c++11
--compiler-options "
-nostdinc
-nostdinc++
-isystem /path/to/clang/include/c++/v1
-isystem /usr/local/include
-isystem /path/to/clang/lib/include
-isystem /path/to/clang/lib/clang/3.9.1/include
-isystem /usr/include/x86_64-linux-gnu
-isystem /usr/include
-isystem /path/to/cuda/includes
-iquote .
-g0
-no-canonical-prefixes
-fPIC
"
--compiler-bindir=/path/to/clang/bin/clang++
-I .
-x cu
-O3
-c main.cu
-o main.cu.o


That compilation fails with the following error:



#$ cicc --c++11 --clang --clang_version=30901 --unicode_source_kind=UTF-8 --allow_managed -arch compute_52 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_00004816_00000000-2_main.cu.fatbin.c" -tused -nvvmir-library "path/to/cuda9/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_00004816_00000000-3_main.cu.module_id" --orig_src_file_name "main.cu" --gen_c_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.c" --stub_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.gpu" "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii" -o "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.ptx"
/path/to/clang/include/c++/v1/__tuple(265): error: __type_pack_element is not a template

/path/to/clang/include/c++/v1/__tuple(332): error: identifier "__type_pack_element" is undefined

/path/to/clang/include/c++/v1/__tuple(332): error: parameter pack "_Idx" was referenced but not expanded

/path/to/clang/include/c++/v1/__tuple(332): error: expected a ";"

4 errors detected in the compilation of "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii".
# --error 0x1 --


From what I figured out __type_pack_element is checked in case it is a clang
built-in, if it isn't it is defined. In the first pass of nvcc, it calls the
clang preprocessor which clearly knows __type_pack_element is a built in so
the preprocessor skips the section defining the type, but the cicc pass fails
because it doesn't have __type_pack_element as a built int.



Removing the tuple include causes the compilation to succeed. Using any other
stl include file succeeds.



The used clang was downloaded from the llvm page










share|improve this question














I'm trying to compile a very simple cuda file:



#include <tuple>

__global__
void hello()
return;


int main()
dim3 dimBlock(16, 1);
dim3 dimGrid(1, 1);
hello<<<dimGrid, dimBlock>>();

return 0;



I am using CUDA 9.0 and clang 3.9.1 with its accompanying libc++. Clag is not
installed in an standard location and I'm trying to compile the file with the
following command:



PATH=/path/to/clang/bin:$PATH 
path/to/nvcc
--verbose
-D_FORCE_INLINES
-gencode=arch=compute_35,"code=sm_35,compute_35"
-gencode=arch=compute_37,"code=sm_37,compute_37"
-gencode=arch=compute_52,"code=sm_52,compute_52"
-DNDEBUG
-std=c++11
--compiler-options "
-nostdinc
-nostdinc++
-isystem /path/to/clang/include/c++/v1
-isystem /usr/local/include
-isystem /path/to/clang/lib/include
-isystem /path/to/clang/lib/clang/3.9.1/include
-isystem /usr/include/x86_64-linux-gnu
-isystem /usr/include
-isystem /path/to/cuda/includes
-iquote .
-g0
-no-canonical-prefixes
-fPIC
"
--compiler-bindir=/path/to/clang/bin/clang++
-I .
-x cu
-O3
-c main.cu
-o main.cu.o


That compilation fails with the following error:



#$ cicc --c++11 --clang --clang_version=30901 --unicode_source_kind=UTF-8 --allow_managed -arch compute_52 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_00004816_00000000-2_main.cu.fatbin.c" -tused -nvvmir-library "path/to/cuda9/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_00004816_00000000-3_main.cu.module_id" --orig_src_file_name "main.cu" --gen_c_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.c" --stub_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.cudafe1.gpu" "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii" -o "/tmp/tmpxft_00004816_00000000-5_main.cu.compute_52.ptx"
/path/to/clang/include/c++/v1/__tuple(265): error: __type_pack_element is not a template

/path/to/clang/include/c++/v1/__tuple(332): error: identifier "__type_pack_element" is undefined

/path/to/clang/include/c++/v1/__tuple(332): error: parameter pack "_Idx" was referenced but not expanded

/path/to/clang/include/c++/v1/__tuple(332): error: expected a ";"

4 errors detected in the compilation of "/tmp/tmpxft_00004816_00000000-8_main.cu.compute_52.cpp1.ii".
# --error 0x1 --


From what I figured out __type_pack_element is checked in case it is a clang
built-in, if it isn't it is defined. In the first pass of nvcc, it calls the
clang preprocessor which clearly knows __type_pack_element is a built in so
the preprocessor skips the section defining the type, but the cicc pass fails
because it doesn't have __type_pack_element as a built int.



Removing the tuple include causes the compilation to succeed. Using any other
stl include file succeeds.



The used clang was downloaded from the llvm page







cuda clang nvcc libc++






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 10:32









SambatyonSambatyon

1,75144064




1,75144064







  • 1





    I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

    – talonmies
    Mar 24 at 10:17












  • @talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

    – Sambatyon
    Mar 26 at 8:10











  • The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

    – talonmies
    Mar 26 at 8:57












  • 1





    I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

    – talonmies
    Mar 24 at 10:17












  • @talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

    – Sambatyon
    Mar 26 at 8:10











  • The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

    – talonmies
    Mar 26 at 8:57







1




1





I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

– talonmies
Mar 24 at 10:17






I'm about 90% sure that libc++ wasn't supported and you would need to use a Clang build with the gnu library instead, or a considerably newer CUDA version

– talonmies
Mar 24 at 10:17














@talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

– Sambatyon
Mar 26 at 8:10





@talonmies I haven't found anything in the documentation stating the support or lack thereof. But based on your response I guess I will stop exploring this option.

– Sambatyon
Mar 26 at 8:10













The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

– talonmies
Mar 26 at 8:57





The clang support in CUDA 9 was only for one Fedora version IIRC, and while you have the right version, there is no guarantee that you have built it with the same libC/libc++ support

– talonmies
Mar 26 at 8:57












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55297685%2fnvcc-type-pack-element-error-when-using-libc-and-clang%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55297685%2fnvcc-type-pack-element-error-when-using-libc-and-clang%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript