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

fix compilation error #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenming-wu
Copy link

When I was compiling the gpu-voxels, some compilation errors occur and all of them refer to ambiguous problem in int8_t. In this pull request, I fix these ambiguities by explicitly specify the namespace of int8_t.

My test environment is Ubuntu 16.04.5 (AMD64).

@cjue
Copy link
Contributor

cjue commented Jan 2, 2019

Thank you very much for your contribution!

If time permits I will publish the new release this weekend.

One question: Which CUDA version did you use, was it CUDA 10.0?

@cjue
Copy link
Contributor

cjue commented Jan 2, 2019

Hi,

does the following fix your compilation issues with CUDA 10.0 as well?

I would prefer a fix that avoids spreading glm types.

diff --git a/src/gpu_visualization/Visualizer.h b/src/gpu_visualization/Visualizer.h
index b12ac45..9c38de4 100644
--- a/src/gpu_visualization/Visualizer.h
+++ b/src/gpu_visualization/Visualizer.h
@@ -61,6 +61,9 @@
#include <thrust/scan.h>

#define GLM_FORCE_RADIANS
#if defined(__CUDACC__) && !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) // fix Cuda10 & Ubuntu14.04 error
#  include <cuda.h>  // ensure CUDA_VERSION is defined, nvcc does not define it
#endif
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

@cjue
Copy link
Contributor

cjue commented Jan 10, 2019

Hi, I just uploaded the new version 1.3.0.

Could you please see if this also fixes your problem, without the changes in your pull request?

@chenming-wu
Copy link
Author

chenming-wu commented Jan 11, 2019

Sorry for my late reply. I just tested the new version 1.3.0, it seems like the problem still exists.

My NVIDIA Driver is 396.51 and CUDA is 9.1.85.

[ 71%] Linking CXX executable ../../../../../bin/test_gpu_voxels_core
[ 76%] Built target test_gpu_voxels_core
[ 76%] Building NVCC (Device) object packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core_CUDA_TARGET.dir/gpu_voxels_visualization_core_CUDA_TARGET_generated_Visualizer.cu.o
/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(1859): error: "gpu_voxels::visualization::int8_t" is ambiguous

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(1860): error: "gpu_voxels::visualization::int8_t" is ambiguous

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(1872): error: "gpu_voxels::visualization::int8_t" is ambiguous

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(2125): error: "gpu_voxels::visualization::int8_t" is ambiguous

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(2125): error: declaration is incompatible with "void gpu_voxels::visualization::Visualizer::keyboardFlipVisibility(glm::int8_t)"
/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.h(342): here

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(2145): error: "gpu_voxels::visualization::int8_t" is ambiguous

/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu(2145): error: declaration is incompatible with "std::__cxx11::string gpu_voxels::visualization::Visualizer::keyboardModetoString(int8_t)"
/home/ros-user/githubtest/gpu-voxels/packages/gpu_voxels/src/gpu_visualization/Visualizer.h(345): here

7 errors detected in the compilation of "/tmp/tmpxft_00003e91_00000000-6_Visualizer.cpp1.ii".
CMake Error at gpu_voxels_visualization_core_CUDA_TARGET_generated_Visualizer.cu.o.cmake:266 (message):
  Error generating file
  /home/ros-user/githubtest/gpu-voxels/build/packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core_CUDA_TARGET.dir//./gpu_voxels_visualization_core_CUDA_TARGET_generated_Visualizer.cu.o


packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core.dir/build.make:2438: recipe for target 'packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core_CUDA_TARGET.dir/gpu_voxels_visualization_core_CUDA_TARGET_generated_Visualizer.cu.o' failed
make[2]: *** [packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core_CUDA_TARGET.dir/gpu_voxels_visualization_core_CUDA_TARGET_generated_Visualizer.cu.o] Error 1
CMakeFiles/Makefile2:5188: recipe for target 'packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core.dir/all' failed
make[1]: *** [packages/gpu_voxels/src/gpu_visualization/CMakeFiles/gpu_voxels_visualization_core.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

@cjue
Copy link
Contributor

cjue commented Jan 11, 2019

Hi, this is quite strange as all of my machines with 16.04 and CUDA 9.0 or 10.0 compile without error.

Did you install an updated version of glm?
If not, could you please tell me the version number reported by "apt show libglm-dev"?

@chenming-wu
Copy link
Author

chenming-wu commented Jan 11, 2019

I just had a quick check on glm, shows that

Package: libglm-dev
Version: 0.9.7.2-1

and the GCC that I use is gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

@cjue
Copy link
Contributor

cjue commented Jan 11, 2019

My workstations have exactly the same libglm-dev version. The only other obvious difference is my use of 9.0 and yours of 9.1.

For the time being you can of course just apply your fix.

If anyone else encounters this issue, please let me know.

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.

2 participants