Skip to content

Commit

Permalink
Pass -Xcompiler -fPIC as 2 separate arguments (facebookincubator#251)
Browse files Browse the repository at this point in the history
Summary:
nvcc from CUDA-10.1 fails to parse "-Xcompiler -fPIC" passed as single argument:
```
$ nvcc -V; nvcc "-Xcompiler -fPIC"
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:10:27_PDT_2019
Cuda compilation tools, release 10.1, V10.1.168
nvcc fatal   : Unknown option 'Xcompiler -fPIC'
```
Pull Request resolved: facebookincubator#251

Test Plan: CI

Reviewed By: seemethere

Differential Revision: D20495001

Pulled By: malfet

fbshipit-source-id: e5b869b8c4b5457dade5e9cc4c56df9b13787d52
  • Loading branch information
malfet authored and facebook-github-bot committed Mar 17, 2020
1 parent 7356410 commit 113bde1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ set(CUDA_PROPAGATE_HOST_FLAGS OFF)
if((NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+") AND (NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=gnu\\+\\+"))
gloo_list_append_if_unique(CUDA_NVCC_FLAGS "-std=c++11")
endif()
gloo_list_append_if_unique(CUDA_NVCC_FLAGS "-Xcompiler -fPIC")
gloo_list_append_if_unique(CUDA_NVCC_FLAGS "-Xcompiler" "-fPIC")

mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD)
mark_as_advanced(CUDA_SDK_ROOT_DIR CUDA_SEPARABLE_COMPILATION)

0 comments on commit 113bde1

Please sign in to comment.