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

NVCC include path not found #194

Closed
NCKempke opened this issue May 22, 2024 · 4 comments · Fixed by #195
Closed

NVCC include path not found #194

NCKempke opened this issue May 22, 2024 · 4 comments · Fixed by #195

Comments

@NCKempke
Copy link

This is, I think, the same issue as in #5

On a fresh master clone running

./autogen.sh
mkdir build
cp nvcc_arch_sm.c build/ # If building for GPU
cd build
../configure --with-metis="-L../../metis-5.1.0/build/Linux-x86_64/libmetis/ -lmetis"

I get

checking for unistd.h... yes
checking for METIS library... checking for metis_nodend_ in -L../../metis-5.1.0/build/Linux-x86_64/libmetis/ -lmetis... yes
checking version of METIS... "version 5"
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for hwloc... yes
checking for cuda_runtime_api.h... no
checking for cuda_runtime_api.h... (cached) no
configure: error: NVCC include path not found

I can fix this by setting export C_INCLUDE_PATH=/usr/local/cuda/include however, I cannot fix this by setting either of CUDA_HOME or NVCC_INCLUDE_FLAGS via export CUDA_HOME=/usr/local/cuda/ or export NVCC_INCLUDE_FLAGS=-I/usr/local/cuda/include which seem to be used in configure as a lookup locations:

# Check in default path first
NVCC_INCLUDE_FLAGS="$NVCC_INCLUDE_FLAGS"
ac_fn_c_check_header_compile "$LINENO" "cuda_runtime_api.h" "ac_cv_header_cuda_runtime_api_h" "$ac_includes_default"
if test "x$ac_cv_header_cuda_runtime_api_h" = xyes
then :
  spral_nvcc_inc_ok=yes
fi


# Check in CUDA_HOME/include
if test x"$spral_nvcc_inc_ok" != xyes; then
   NVCC_INCLUDE_FLAGS="$NVCC_INCLUDE_FLAGS -I$CUDA_HOME/include"
   save_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $NVCC_INCLUDE_FLAGS"
   ac_fn_c_check_header_compile "$LINENO" "cuda_runtime_api.h" "ac_cv_header_cuda_runtime_api_h" "$ac_includes_default"
if test "x$ac_cv_header_cuda_runtime_api_h" = xyes
then :
  spral_nvcc_inc_ok=yes
fi

   CPPFLAGS=$save_CPPFLAGS
fi

Again, I feel this is just (the first part of) #5 but the PR #22 that imo would have fixed this was closed.

@jfowkes
Copy link
Contributor

jfowkes commented May 22, 2024

Thanks for reporting! I will see if I can resurrect #22 against the latest master branch for you to test the proposed fix.

@jfowkes jfowkes linked a pull request May 22, 2024 that will close this issue
@jfowkes
Copy link
Contributor

jfowkes commented May 22, 2024

@NCKempke I've created #195 with the proposed fix in #22, please test and let us know.

@NCKempke
Copy link
Author

@NCKempke I've created #195 with the proposed fix in #22, please test and let us know.

@jfowkes I just checked the branch in #195. It works fine and resolves all of my issues.

I tested both flags, so export CUDA_HOME=/usr/local/cuda/ and export NVCC_INCLUDE_FLAGS=-I/usr/local/cuda/include (each separately in a clean environment) and both times the configure command passes just fine.

@jfowkes
Copy link
Contributor

jfowkes commented May 23, 2024

Fantastic, thank you @NCKempke! I will merge into master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants