conda-forge / nvcc-feedstock

A conda-smithy repository for nvcc.
BSD 3-Clause "New" or "Revised" License
12 stars 23 forks source link

Incorrect include path argument in CPPFLAGS and CXXFLAGS when using CUDA #81

Closed johnlees closed 2 years ago

johnlees commented 2 years ago

Bug:

I need some help from @conda-forge/staged-recipes. Not sure if this is recipe specific because I can't find this issue anywhere else, but at the moment it's possibly looking like a conda-forge issue.

I have encountered this bug when updating the pp-sketchlib feedstock. I believe conda adds the following to CPPFLAGS and CXXFLAGS:

-isystem/usr/local/cuda/include

This should have a space, I think:

-isystem /usr/local/cuda/include

The top one is fine for gcc and clang, but nvcc gives an error:

nvcc fatal   : Unknown option '-isystem/usr/local/cuda/include'

Something I can't quite track down is where this is added. At the start I have:

+CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include
+CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/pp-sketchlib-2.0.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix

and when the error is hit:

CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -isystem/usr/local/cuda/include -I"." -I"/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol"/include -I"/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol"/include/eigen3 -DGPU_AVAILABLE -DPYTHON_EXT -DNDEBUG -Dpp_sketchlib_EXPORTS -I/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/python3.10 -I/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.10/site-packages/pybind11/include
CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/work=/usr/local/src/conda/pp-sketchlib-2.0.0 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/pp-sketchlib_1651255698672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix -isystem/usr/local/cuda/include -DVERSION_INFO=\"2.0.0\" -Wall -Wextra -std=c++14 -fopenmp -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fPIC -O3 -flto -fno-fat-lto-objects -fvisibility=hidden -m64

(in the CPPFLAGS, the part from -I"." onwards is added by the Makefile in the recipe)

So I'm not quite sure which part of the infrastructure is adding the breaking part of the compiler arguments.

See builds: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=499726&view=logs&jobId=e9afaa34-1a0f-534e-78fc-fae528ccd915&j=bb1c2637-64c6-57bd-9ea6-93823b2df951&t=350df31b-3291-5209-0bb7-031395f0baa1

johnlees commented 2 years ago

So, do these lines need modifying to include a space? https://github.com/conda-forge/nvcc-feedstock/blob/main/recipe/install_nvcc.sh#L73-L75

johnlees commented 2 years ago

From this PR I think https://github.com/conda-forge/nvcc-feedstock/pull/80