Skip to content

Fix build with CUDA on windows with Ninja and JOM (#6372)#8819

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
Robzz:master
Jun 1, 2017
Merged

Fix build with CUDA on windows with Ninja and JOM (#6372)#8819
opencv-pushbot merged 1 commit intoopencv:masterfrom
Robzz:master

Conversation

@Robzz
Copy link
Copy Markdown
Contributor

@Robzz Robzz commented May 29, 2017

Fixed #6372. No idea if it's the proper way to fix it, but it works for me.

This pullrequest changes

Quote the CUDA related flags passed to the linker in the main CMakeLists.txt

@Robzz Robzz changed the title Fix build with CUDA on windows (#6372) Fix build with CUDA on windows with Ninja (#6372) May 29, 2017
@Robzz
Copy link
Copy Markdown
Contributor Author

Robzz commented May 29, 2017

I just tried building with visual studio, but it fails. I'll try to come up with something that works for both.

@Robzz Robzz changed the title Fix build with CUDA on windows with Ninja (#6372) WIP: Fix build with CUDA on windows with Ninja (#6372) May 29, 2017
@Robzz Robzz changed the title WIP: Fix build with CUDA on windows with Ninja (#6372) Fix build with CUDA on windows with Ninja and JOM (#6372) May 30, 2017
@Robzz
Copy link
Copy Markdown
Contributor Author

Robzz commented May 30, 2017

It should be good now. I only quoted the linker flags when using JOM or Ninja with the Visual Studio compiler.

@alalek
Copy link
Copy Markdown
Member

alalek commented May 31, 2017

Looks good to me.
Thank you! 👍

@opencv-pushbot opencv-pushbot merged commit c4a3278 into opencv:master Jun 1, 2017
opencv-pushbot pushed a commit that referenced this pull request Jun 1, 2017
fbridault pushed a commit to fw4spl-org/fw4spl-deps that referenced this pull request Jun 22, 2017
Changes necessary for the Ensenso grabber

This MR changes the following:

* Add option to build OpenCV with CUDA support, and patch openCV to fix building with CUDA with jom and Ninja on Windows. This is caused by the default install dir for CUDA containing spaces... The patch has been [submitted upstream and merged](opencv/opencv#8819) 🎆 
* Patch PCL to find the Ensenso SDK on Windows because... Yeah, spaces. The patch has been [submitted upstream and merged](PointCloudLibrary/pcl#1875). 😄 
* Bugfix: in the PCL builder CMake code, replace some `BUILD_X` variables with no effect by the actual variables, `WITH_X` (eg. `BUILD_OPENNI` does nothing, the variable is `WITH_OPENNI`).
* Add option to build PCL without CUDA support, to be coherent with what this MR does for OpenCV (currently, PCL is built with CUDA support whenever CUDA is detected).
* Fix PCL and OpenCV not being able to build CUDA targets on windows in parallel. The speed gain here is pretty good  
  Before/After:
    * PCL: 21min/10min
    * OpenCV: 40min/12min
* Ability to set for which CUDA architectures to build dependencies using CUDA. This is not _necessary_, but the build time with CUDA is horribly long, even more so with OpenCV and CUDA support, and this speeds things up quite a bit. By default, build for all SM >= 3.0 architectures (2.x is old and deprecated, I'd be surprised if anyone used this). To speed things up, set it to the architecture of your card **(AND THE GPUS OF THE MACHINES YOU WILL PACKAGE INSTALLERS FOR)**  
  Building PCL + OpenCV + LibSGM (including the aforementioned parallelism improvement):
    * SM 6.0: 21min
    * SM 3.0 3.5 3.7 5.0 5.2 5.3 6.0 6.2: ~1h
* Add a new optional dependency, libSGM, and a patch that basically rewrites the build system from scratch. Also includes a cmake `FindLibSGM` module.
* Windows people who want to show appreciation for the CUDA build speed improvements may send pains au chocolat to @rchavignat. (a man can dream...)


See merge request !58
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.

OpenCV 3.1.0 build fails on Windows with Ninja Generator

3 participants