Identify AppleClang as a valid Clang compiler#3131
Identify AppleClang as a valid Clang compiler#3131SergioRAgostinho wants to merge 2 commits intoPointCloudLibrary:masterfrom
Conversation
|
I don't know if PCL is supporting ARM, but CMake 3.15 will introduce //Edit: Your commit message contains a typo (just in case you want to fix it before merge) |
|
No opinion against. |
|
I noticed the following piece of code in the main CMakeLists: Lines 191 to 193 in 575a9b9 It is nested under an |
Edit: I just noticed the CUDA there... this is an NVCC issue. I don't have a way to test this at the moment. and I'm reading mixed reports from here. I suspect this should no longer be an issue in more recent nvcc versions. |
|
Do you have any experts in mind whom we could summon to get an opinion? |
|
@claudiofantacci do you still have a working cuda toolkit on your mac? Do you mind testing if:
|
|
@SergioRAgostinho yes I do 🚀 I'll try it out tomorrow and should you not hear anything from me anytime soon, just ping me 👍 |
This comment has been minimized.
This comment has been minimized.
|
Thank you. It feels like we are dealing with same issue in both. The std=c++14 flag is likely not being passed to nvcc. Something that needs to be fixed first in order to test the original case further. Edit: There's also the issue of has having to propagate the same user selected standard from the host compiler (clang/gcc) to nvcc, i.e., a user can select c++17 and that should probably be consistent between both compilers. |
By my experience, that kind of flag has always been a pain on if (UNIX)
list(APPEND CUDA_NVCC_FLAGS "-std=c++11")
endif()We could, of course, do something smarter by, e.g., get the flag from some CMake variable. |
There exists a smarter way... starting from CMake 3.8 (we are limited to 3.5 because of Ubuntu 16.04) ;) |
Still, the variable seems to be used only if you add CUDA as a language of the project. The variable may not work properly if you do |
|
But anyway, good to know! Was unaware of the |
Mhm? We are using |
Not all IDE generators support CUDA as a language. For example In the particular case of XCode, you can have a look at this issue on CMake's GitLab. |
|
Good to know, seems we have luck, that we don't use XCode ;). |
|
As of now, I see no way around other than adding the explicit flag to NVCC. As you can see, I've added directly the C++14 standard which from what I can tell was only added in CUDA 9.0. I haven't tried yet to see if thing compile simply with C++11. I just wanted to know what's the general opinion on deprecating everything below CUDA 9 if needed. |
As far as I remember you have still Ubuntu 16.04 as lowest compile target and there is only CUDA 7.5 in default repository. So we have following choice:
@ your latest changes: Does this works? if(CMAKE_VERSION VERSION_LESS 3.10)
list(APPEND CUDA_NVCC_FLAGS "-D_FORCE_INLINES" $<$<OR:$<BOOL:CMAKE_COMPILER_IS_GNUXX>,$<BOOL:CMAKE_COMPILER_IS_CLANG>>:-std=c++14>)
else()
set(CMAKE_CUDA_STANDARD 14)
endif()Or does |
|
Apologies for the massive derailing this PR took. Quick update, just setting the flag to c++11 won't work. Some cuda code includes indirectly pcl_config.h and then
No idea. I'll give it a try once I manage to compile all cuda code. At this moment only pcl_cuda_io is failing. Edit:
NVidia has their own ppa which can be added to the current docker image. |
|
Even I like 38a30fa - isn't it something for a separate PR, because it does not have anything to do with Clang? |
Totally. I'll pull it out and open a separate PR. Don't be lazy like me. |
0e03f3f to
3355fff
Compare
3355fff to
16054ac
Compare
|
Big request: in case any of you has some apps done with In summary:
Help \o/ |
I can just do this as I don't have any code using |
|
I wanted to test this PR on Ubuntu 18.04. The first step was to test whether Unfortunately I don't have much free time now, so have to get out of this rabbit hole until it's too late. Personally, I'd just avoid touching all this stuff. I never used it and don't know the status, but it seems to be totally outdated. Maybe we just set the flags as proposed such that the beast compiles, but add a warning "use at your own risk, might not work properly". |
|
Just to remember as 3.15 is now official:
I don't have any device on my PC like this, so I can't test it :( |
I incorporated a change that @Morwenn proposed in another PR. It should cover that case as well. See https://stackoverflow.com/questions/10046114/in-cmake-how-can-i-test-if-the-compiler-is-clang/10055571#10055571 I also haven't forgotten about this if(CMAKE_VERSION VERSION_LESS 3.10)
list(APPEND CUDA_NVCC_FLAGS "-D_FORCE_INLINES" $<$<OR:$<BOOL:CMAKE_COMPILER_IS_GNUXX>,$<BOOL:CMAKE_COMPILER_IS_CLANG>>:-std=c++14>)
else()
set(CMAKE_CUDA_STANDARD 14)
endif()I will test a modified version of this, bearing in mind the info from @claudiofantacci that it isn't working with XCode. |
I believe I have the same dev env as you currently, so I expect no issues. If something is different and/or you feel bored, by all means give it a go :) |
|
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
|
Are you still working on this, or should I remove the milestone of 1.11 from this PR? |
|
Remove from the milestone. I can no longer work on this because I decided to upgrade OS and Catalina still doesn't have CUDA support, nor I expect to to have it anytime soon. |
|
Marking this as stale due to 30 days of inactivity. Commenting or adding a new commit to the pull request will revert this. |
https://cmake.org/cmake/help/v3.5/variable/CMAKE_LANG_COMPILER_ID.html
I just printed some make verbose and noticed there were no SSE flags.