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

Cuda compile error visual studio 2015 #75

Closed
sorheimen opened this issue May 8, 2018 · 10 comments
Closed

Cuda compile error visual studio 2015 #75

sorheimen opened this issue May 8, 2018 · 10 comments

Comments

@sorheimen
Copy link

sorheimen commented May 8, 2018

I have problems getting the solver_cuda project to compile, I am using cuda 9.1 and VS 2015, seems to be something with nvcc not handling c++ files correctly, error output:

1>------ Build started: Project: solver_cuda, Configuration: Release x64 ------
1>  Building NVCC (Device) object examples/CMakeFiles/solver_cuda.dir/Release/solver_cuda_generated_solver.cu.obj
1>  -- Removing D:/eas/gits/amgcl/build_x64/examples/CMakeFiles/solver_cuda.dir//Release/solver_cuda_generated_solver.cu.obj
1>  "C:/Program Files/CMake/bin/cmake.exe" -E remove D:/eas/gits/amgcl/build_x64/examples/CMakeFiles/solver_cuda.dir//Release/solver_cuda_generated_solver.cu.obj
1>  -- Generating dependency file: D:/eas/gits/amgcl/build_x64/examples/CMakeFiles/solver_cuda.dir//solver_cuda_generated_solver.cu.obj.NVCC-depend
1>  "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/bin/nvcc.exe" -M -D__CUDACC__ D:/eas/gits/amgcl/build_x64/examples/solver.cu -o D:/eas/gits/amgcl/build_x64/examples/CMakeFiles/solver_cuda.dir//solver_cuda_generated_solver.cu.obj.NVCC-depend -ccbin "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin" -m64 -DAMGCL_BLOCK_SIZES=(3)(4) -DNOMINMAX -D_VARIADIC_MAX=10 -D_SCL_SECURE_NO_WARNINGS -DAMGCL_ASYNC_SETUP -Xcompiler ,\"/DWIN32\",\"/D_WINDOWS\",\"/W3\",\"/GR\",\"/EHsc\",\"/MD\",\"/O2\",\"/Ob2\",\"/DNDEBUG\" -Xcompiler -openmp -DSOLVER_BACKEND_CUDA -DNVCC "-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/include" -ID:/eas/gits/amgcl/examples/../tests -ID:/eas/boost_1_67_0 -ID:/eas/gits/amgcl
1>  solver.cu
1>D:/eas/boost_1_67_0\boost/preprocessor/slot/detail/shared.hpp(27): fatal error C1012: unmatched parenthesis: missing ')'
1>  CMake Error at solver_cuda_generated_solver.cu.obj.Release.cmake:219 (message):
1>    Error generating
1>    D:/eas/gits/amgcl/build_x64/examples/CMakeFiles/solver_cuda.dir//Release/solver_cuda_generated_solver.cu.obj
1>

Any clues to a fix to this problem? The ordinary solver c++ project compiles and build just fine!

@ddemidov
Copy link
Owner

ddemidov commented May 8, 2018

The error seems to be coming from a boost header. I don't have access to a Windows machine with CUDA, but solver_cuda does compile on linux with CUDA 9.1 and boost-1.66. I don't see any problems at the line the error references:

https://github.com/boostorg/preprocessor/blob/56090c56b5c78418b6dbe8c3c2ba576395152f83/include/boost/preprocessor/slot/detail/shared.hpp#L27

Specifically, I don't see where an unmatched parenthesis could come from. So, could this be an nvcc bug or a faulty boost installation?

@Pinoplast
Copy link

Pinoplast commented Dec 11, 2018

I faced this too. It's hard to understand why it happens...

@ddemidov
Copy link
Owner

I don't have the means to reproduce this, but it looks like it is an issue with nvcc and boost, similar to this stackoverflow question:
https://stackoverflow.com/questions/50877647/thrustboost-code-compilation-error

Since recently, amgcl does only require boost for the runtime interface, and even then, it only depends on the Boost.property_tree library. I've just checked, and it looks like boost/preprocessor/slot/detail/shared.hpp is never included (directly or indirectly) into solver_cuda. Can you retry with the master branch of amgcl?

@ddemidov
Copy link
Owner

Correction: boost/preprocessor/slot/detail/shared.hpp is still included when runtime interface is used. But it should be possible to go completely boost-free with compile-time interface.

@mobereng
Copy link

Hi Denis,

I ran into the same issue, and it is compiling with VS2019 and c++14

image

Not sure if anyone could solve this

@mobereng
Copy link

Is there any way to go boost free on .cu files ?, so it can compile great, I can have another file with .cpp extension and it won't cause any problems

I'm currently testing

typedef amgcl::backend::cuda<double> Backend;
typedef amgcl::make_solver<
        amgcl::amg<
          Backend,
          amgcl::coarsening::smoothed_aggregation,
          amgcl::relaxation::ilu0
        >,
        amgcl::solver::bicgstab<Backend>
        > Solver;

@ddemidov
Copy link
Owner

Boost is used in examples/solver.cpp (which is linked to solver.cu and compiled as cuda source here).

Can you try and compile the amgcl examples using the provided cmake files?

To go Boost-free you need to define AMGCL_NO_BOOST and stick to the compile-time interface.

@mobereng
Copy link

For sure, let me test and come back

@mobereng
Copy link

The issue was solved on the last version for development branch for boost preprocessor. Refer to the follogin ticket if anyone still stuck on the same compilation problem Boost preprocessor issue 37

@mobereng
Copy link

Thanks for the help. I think this one can be closed @ddemidov

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

No branches or pull requests

4 participants