Closed BillTavis closed 4 years ago
Hello. Is it possible to try with the latest version of CImg.h ? The line numbers you show do not seem to correspond with the latest version. I never tried compiling CImg with nvcc to be honest.
Thanks for the fast response. I am using CImg-2.9.2 downloaded today (Standard Package). The line numbers seem to line up for me, seems to be happening wherever there is a default: in the switch statements.
OK, so maybe some of the errors were discarded. Anyway, I've no ideas about what can be done. The OpenMP code in CImg seems to be valid (at least it validates with g++,clang++ and msvc) , so there is probably some weird stuffs going on with the nvcc compiler. Maybe people from NVIDIA could help better than I can.
Also, not sure it could help, but you can always disable OpenMP support in CImg, by defining macro cimg_use_openmp
to 0
.
So that you can enable OpenMP for other parts of your code, and ignore the OpenMP parts in CImg.
Yes, thank you that solved it! I placed the line #define cimg_use_openmp 0
before including CImg.h and it worked! My use of OpenMP is primarily in other parts of my code so this works for me. Thank you!
fwiw, I'm running into this too (cimg 2.9.7, nvcc11.0). defining cimg_use_openmp 0
works for me. but would be curious if anyone else stumbling on this issue has found other solutions that allow openMP support in CImg.
Hello, I have having a problem compiling on Linux using nvcc. Using a simple main file that does nothing but simply includes "CImg.h" I am able to compile with no problem using
g++ main.cpp -fopenmp -o test
but when I try compiling with nvcc I get errors. Usingnvcc main.cu -Xcompiler -fopenmp -o test
I get the following:mand-git/CImg.h:31799:1: error: for statement expected before ‘default’ default : // Generic version ^ mand-git/CImg.h: In member function ‘cimg_library::CImg<t> cimg_library::CImg<T>::get_map(const cimg_library::CImg<t>&, unsigned int) const’: mand-git/CImg.h:31874:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h: In member function ‘cimg_library::CImg<T> cimg_library::CImg<T>::get_warp(const cimg_library::CImg<t>&, unsigned int, unsigned int, unsigned int) const’: mand-git/CImg.h:35442:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35476:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35543:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35577:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35680:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35716:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35789:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35825:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35952:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:35998:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:36089:1: error: for statement expected before ‘default’ default : // Dirichlet ^ mand-git/CImg.h:36134:1: error: for statement expected before ‘default’ default : // Dirichlet ^
If I try to compile without openmp it works fine, but I need that for my application. Any advice?