deeplearningais / curfil

CUDA Random Forest implementation for Image Labeling tasks
Other
180 stars 63 forks source link

compile with gcc 4.4.7 in CentOS 6.5 #4

Closed bug-fixed closed 9 years ago

bug-fixed commented 10 years ago

Hi, thank you for this great library!

Recently I've compiled curfil in CentOS 6.5, but in the system, there is only gcc 4.4.7 installed. The gcc has no support with c++0x, and it will report an error when compiling curfil. Could you give me some advice on how to compile this library with gcc 4.4.7 in CentOS 6.5, please? Thanks!

temporaer commented 10 years ago

Not sure which c++0x features are used, maybe you can simply try to remove the flag and see which problems occur. They should all be syntactical in nature, so you'll find them using your compiler alone. You'll likely have to fix range-based for-loops [1] or auto variables [2]. The flag you need to remove is specified in the CMakeLists.txt file. It might be easier if you just install a more modern C++ compiler on your system [3].

[1] http://www.cprogramming.com/c++11/c++11-ranged-for-loop.html [2] http://en.cppreference.com/w/cpp/language/auto [3] http://unix.stackexchange.com/questions/63587/how-to-install-g-4-7-2-c11-on-centos-5-x

bug-fixed commented 10 years ago

@temporaer , thank you very much for comments and suggestions! I have compiled the GCC 4.6.3 and then compiled the curfil, the errors were gone. Yes, I have tried to modify those features in C++0x into the regular usage. I found much auto keywords in loop were used, but I didn't continue this. The CUDA needs a compatible GCC, http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#system-requirements, so I didn't use more latest GCC because the GCC 4.6.3 has provided the enough feature of C++0x.

temporaer commented 10 years ago

you can tell nvcc to use an older version of gcc to compile .cu-files, but use a more modern one for your own .cpp files. This can be done through cmake.

bug-fixed commented 10 years ago

@temporaer , I thought this couldn't be done before, thank you for this experience! I would try that.