SheffieldML / GPc

Gaussian process code in C++ including some implementations of GP-LVM and IVM.
MIT License
67 stars 28 forks source link

The problem of CKern.cpp file #8

Open Cinderella0709 opened 4 years ago

Cinderella0709 commented 4 years ago

Dear authors,

When I installed this software, just "make gp", I got an error, which is shown as follow:

/usr/include/c++/7/bits/basic_string.h:6284:5: note: template argument deduction/substitution failed: CKern.cpp:4185:27: note: 'std::ostream {aka std::basic_ostream}' is not derived from 'const std:: __cxx11::basic_string<_CharT, _Traits, _Alloc>'    out « kern.display(out);                                      ^ make: *** [makefile:117: CKern.o] Error 1

I realized that I didn't install dependencies, so I installed BLAS, LAPACK and g77 compiler (gfortran I have installed). Then I redownloaded this repo, and get the same error. I don't know what's wrong.

Looking forward to your reply!

Regards, Ella

lawrennd commented 4 years ago

Hi Ella,

Thanks for reaching out. It's been a while since I compiled this, so it might take me a bit to look at it. Would you be able to help by describing what system your compiling on and which C++ compiler.

Neil

Cinderella0709 commented 4 years ago

Dear authors,

Thanks for your instant reply, the specific information of my platform as follow:

Ubuntu 18.04 LTS x86_64 gcc (Ubuntu 7.5.0-3ubuntu1\~18.04) 7.5.0 g++ (Ubuntu 7.5.0-3ubuntu1\~18.04) 7.5.0

Regards, Ella

kuevpr commented 3 years ago

Hello. I had the same issue as Cinderella0709.

I got the program to compile by changing the source code. In file CKERN.cpp line 4185-4816, I replaced the two lines originally given as out << kern.display(out); return out;

To this one-line statement return kern.display(out);

I think this should be fine since kern.display() is handling all the printing and returns the ostream passed into it. The original code on line 4185 effectively had out << out; once kern.display() had finished and returned the ostream.

Since I'm just now starting to use this code, I can't say if this "fix" actually retains the intended functionality of the operator<< override, but at least it compiles now.

lawrennd commented 3 years ago

Great that you're using it and thanks for the fix!

If you don't encounter problems would you mind submitting a pull request?

(Sorry Ella for letting this drop before!)