Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcl] Add cuda and tools option #2775

Merged
merged 4 commits into from
Mar 1, 2018
Merged

[pcl] Add cuda and tools option #2775

merged 4 commits into from
Mar 1, 2018

Conversation

cmpute
Copy link
Contributor

@cmpute cmpute commented Feb 11, 2018

With this portfile, pcl can be theoretically compiled against cuda. However, I met problems when building it with cuda like #2749. How I solved this is exactly described here at StackOverflow which was caused by CUDA cmake bug.

In addition, with current cuda version (8.0), only toolset along with VS2015 can be used to compile .cu files (while I am using VS2017). The problem is also describe in another post at StackOverflow, workarounds are mentioned in both posts. I am able to build pcl with cuda when specifying CUDA_HOST_COMPILER as the cl compiler in toolset v140. So the problem is with cuda rather than with pcl/opencv in my opinion, which could be solved or at least warned in the portfile of cuda.

@cmpute
Copy link
Contributor Author

cmpute commented Feb 13, 2018

I found a way to workaround the CUDA problem, the codes are like following

set(WITH_CUDA OFF)
if("cuda" IN_LIST FEATURES)
    set(WITH_CUDA ON)
    if(MSVC_VERSION GREATER 1900)
        get_filename_component(CUDA_HOST_COMPILER "../../VC/bin/cl.exe" ABSOLUTE BASE_DIR "$ENV{VS140COMNTOOLS}"})
    endif()
endif()

vcpkg_configure_cmake(... -DCUDA_HOST_COMPILER=${CUDA_HOST_COMPILER})

However, I found that VS140COMNTOOLS expanded to nothing when run from vcpkg, but it expands normally to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ when use cmake -P. I have no idea how to deal with this, could you give me any suggestion? @ras0219-msft

-DWITH_LIBUSB=OFF
-DWITH_OPENNI2=${WITH_OPENNI2}
-DWITH_PCAP=${WITH_PCAP}
-DWITH_PNG=OFF
-DWITH_PNG=ON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should libpng be added as a dependency because of this?

Copy link
Contributor Author

@cmpute cmpute Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be, but pcl depends on vtk which takes libpng as a dependency, so adding it as a dependency is not necessary

@cmpute
Copy link
Contributor Author

cmpute commented Feb 16, 2018

Now pcl can be built with cuda almost successfully. The problem occured during vcpkg install pcl[cuda] is described here at PointCloudLibrary/pcl#2207.

@cmpute
Copy link
Contributor Author

cmpute commented Feb 24, 2018

Is it able to merge this branch now?

@ras0219-msft
Copy link
Contributor

Yep, thanks for the PR and sorry for the delay!

@ras0219-msft ras0219-msft merged commit 523b611 into microsoft:master Mar 1, 2018
@cmpute cmpute deleted the pcl branch March 2, 2018 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants