[Neurodebian-devel] Could you enable fls-5.0-gpu package by default?

Michal Hocko mstsxfx at gmail.com
Wed Jun 1 17:51:34 UTC 2016


Hi there,

On Tue, May 31, 2016 at 09:38:47PM +0200, Michael Hanke wrote:
[...]
> Looking at the logs it seems to have built the CUDA bits prior just
> fine. I am on CUDA 7.0 with an amd64 Debian (somewhat close to unstable
> and very similar to the actual build environment that we need to
> target).
> 
> Does that look familiar to you?

Well it seems like fallouts from newer gcc version being less tolerant
to wrong/standard non compliant c++ usage. Unfortunately I cannot
install newer version of gcc to the build machine because that would
require way too many other upgrades (basically everything which depends
on libstdc++). It's been some time since I have done anything in c++ but
I guess the resolution should be quite straightforward. We just need to
make both declarations and definitions of functions same wrt. types.

See the two patches attached. There might be other places which require
the same treatment, I have just focused on those which blew up.

Could you try to test them, please?

-- 
Michal Hocko
-------------- next part --------------
Fix compilation error with newer gcc:
/home/mih/debian/fsl/fsl/src/fdt/xfibres_gpu.cc:177: undefined reference to `xfibres_gpu(NEWMAT::Matrix, NEWMAT::Matrix, NEWMAT::Matrix, NEWMAT::Matrix, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/home/mih/debian/fsl/fsl/src/fdt/xfibres_gpu.cc:196: undefined reference to `xfibres_gpu(NEWMAT::Matrix, NEWMAT::Matrix, NEWMAT::Matrix, NEWMAT::Matrix, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

Declaration and definition of function have to same full type declaration
including namespaces.
Index: fsl-5.0.9/src/fdt/CUDA/xfibres_gpu.cu
===================================================================
--- fsl-5.0.9.orig/src/fdt/CUDA/xfibres_gpu.cu
+++ fsl-5.0.9/src/fdt/CUDA/xfibres_gpu.cu
@@ -85,6 +85,7 @@
 #include <fstream>
 
 using namespace Xfibres;
+using namespace NEWMAT;
 
 void xfibres_gpu(	//INPUT
 			const Matrix			datam,
-------------- next part --------------
Fix compilation error with newer gcc:
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::string_to_T(std::string&, std::string const&)'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::string_to_T(bool&, std::string const&)'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::string_to_T(float&, std::string const&)'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::string_to_T(int&, std::string const&)'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::BaseOption::long_form() const'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::BaseOption::short_form() const'
/home/mih/debian/fsl/fsl/lib/libbedpostx_cuda.so: undefined reference to `Utilities::Option<bool>::set_value(std::string const&)'

Make sure that std::string is used consistently with the namespace.
Index: fsl-5.0.9/src/utils/functions.cc
===================================================================
--- fsl-5.0.9.orig/src/utils/functions.cc
+++ fsl-5.0.9/src/utils/functions.cc
@@ -82,7 +82,7 @@ namespace Utilities {
   
   template<> string Option<bool>::value_string() const { return ""; }
 
-  template<> bool Option<bool>::set_value(const string& s)
+  template<> bool Option<bool>::set_value(const std::string& s)
   {
     if(s.length() == 0)
       {
@@ -116,17 +116,17 @@ namespace Utilities {
     return o.print(os);
   }
 
-  bool string_to_T(bool& b, const string& s) {
+  bool string_to_T(bool& b, const std::string& s) {
     b = false;
     return false;
   }
 
-  bool string_to_T(string& d, const string& s) {
+  bool string_to_T(std::string& d, const std::string& s) {
     d = s;
     return true;
   }
 
-  bool string_to_T(int& i, const string& s) {
+  bool string_to_T(int& i, const std::string& s) {
     char *endptr = 0; const char *str = s.c_str();
     i = strtol(str, &endptr, 0);
     if(*endptr == str[s.length()])
@@ -135,7 +135,7 @@ namespace Utilities {
       return false;
   }
 
-  bool string_to_T(float& v, const string& s) {
+  bool string_to_T(float& v, const std::string& s) {
     char *endptr = 0; const char *str = s.c_str();
     v = strtod(str, &endptr);
     if(*endptr == str[s.length()])
@@ -144,7 +144,7 @@ namespace Utilities {
       return false;
   }
 
-  bool string_to_T(vector<int>& vi, const string& s) {
+  bool string_to_T(vector<int>& vi, const std::string& s) {
     string str(s), delin(",");
     if(str.find(":")!=string::npos)
       delin = ":";
@@ -222,7 +222,7 @@ namespace Utilities {
   /*
     @return first short-form key (if any)
   */
-  const string BaseOption::short_form() const
+  const std::string BaseOption::short_form() const
   {
     string::size_type pos(0), np;
     
@@ -243,7 +243,7 @@ namespace Utilities {
   /*
     @return first long-form key (if any)
   */
-  const string BaseOption::long_form() const
+  const std::string BaseOption::long_form() const
   {
     string::size_type pos(0), np;
     


More information about the Neurodebian-devel mailing list