darealshinji / vapoursynth-plugins

A collection of VapourSynth plugins
Other
51 stars 12 forks source link

Getting bugs trying to compile in Debian #4

Closed 9Morello closed 8 years ago

9Morello commented 8 years ago

Hello. I'm getting the following errors when using make:

CXX      src/CTMF.o
src/CTMF.cpp: In function ‘const VSFrameRef* ctmfGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, const VSAPI*)’:
src/CTMF.cpp:211:58: error: ‘ceil’ is not a member of ‘std’
                     const int stripes = static_cast<int>(std::ceil(static_cast<double>(width - 2 * d->radius) / (d->memsize / sizeof(Histogram<16>) - 2 
                                                          ^
src/CTMF.cpp:212:61: error: ‘ceil’ is not a member of ‘std’
                     const int stripeSize = static_cast<int>(std::ceil(static_cast<double>(width + stripes * 2 * d->radius - 2 * d->radius) / stripes));
                                                             ^
src/CTMF.cpp:223:58: error: ‘ceil’ is not a member of ‘std’
                     const int stripes = static_cast<int>(std::ceil(static_cast<double>(width - 2 * d->radius) / (d->memsize / sizeof(Histogram<32>) - 2 
                                                          ^
src/CTMF.cpp:224:61: error: ‘ceil’ is not a member of ‘std’
                     const int stripeSize = static_cast<int>(std::ceil(static_cast<double>(width + stripes * 2 * d->radius - 2 * d->radius) / stripes));
                                                             ^
src/CTMF.cpp:235:58: error: ‘ceil’ is not a member of ‘std’
                     const int stripes = static_cast<int>(std::ceil(static_cast<double>(width - 2 * d->radius) / (d->memsize / sizeof(Histogram<64>) - 2 
                                                          ^
src/CTMF.cpp:236:61: error: ‘ceil’ is not a member of ‘std’
                     const int stripeSize = static_cast<int>(std::ceil(static_cast<double>(width + stripes * 2 * d->radius - 2 * d->radius) / stripes));
                                                             ^
src/CTMF.cpp:247:58: error: ‘ceil’ is not a member of ‘std’
                     const int stripes = static_cast<int>(std::ceil(static_cast<double>(width - 2 * d->radius) / (d->memsize / sizeof(Histogram<256>) - 2
                                                          ^
src/CTMF.cpp:248:61: error: ‘ceil’ is not a member of ‘std’
                     const int stripeSize = static_cast<int>(std::ceil(static_cast<double>(width + stripes * 2 * d->radius - 2 * d->radius) / stripes));
                                                             ^
../../cxx.inc:14: recipe for target 'src/CTMF.o' failed
make[1]: *** [src/CTMF.o] Error 1

I'm trying to compile it on Debian Testing. I installed all dependencies without problems.

darealshinji commented 8 years ago

Someone else reported the same to the upstream developer and he fixed it by including <cmath>. I hope it works now.

9Morello commented 8 years ago

@darealshinji Thanks for the fast answer. I got another problem while building it:

make[1]: Entering directory '/home/morello/vapoursynth-plugins/plugins/fft3dfilter'
  CXX      src/fft3dfilter_c.o
src/fft3dfilter_c.cpp: In function ‘void ApplyWiener2D_C(float (*)[2], int, int, int, int, float, float, float, float, float, const float*, float, const float*, float)’:
src/fft3dfilter_c.cpp:74:158: error: ‘sqrt’ was not declared in this scope
     WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ); // sharp
                                                                                                                                              ^
src/fft3dfilter_c.cpp:114:158: error: ‘sqrt’ was not declared in this scope
             WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) *
                                                                                                                                                      ^
src/fft3dfilter_c.cpp: In function ‘void Sharpen_C(float (*)[2], int, int, int, int, float, float, float, const float*, float, const float*, float)’:
src/fft3dfilter_c.cpp:680:151: error: ‘sqrt’ was not declared in this scope
                  sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) ) ;
                                                                                                                                                    ^
src/fft3dfilter_c.cpp:723:151: error: ‘sqrt’ was not declared in this scope
                  sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) ) *
                                                                                                                                                    ^
src/fft3dfilter_c.cpp: In function ‘void Sharpen_degrid_C(float (*)[2], int, int, int, int, float, float, float, const float*, float, const float (*)[2], float, const float*, float)’:
src/fft3dfilter_c.cpp:772:151: error: ‘sqrt’ was not declared in this scope
                   sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) )) ;
                                                                                                                                                     ^
src/fft3dfilter_c.cpp:837:151: error: ‘sqrt’ was not declared in this scope
                   sfact = (1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) )) *
                                                                                                                                                     ^
src/fft3dfilter_c.cpp: In function ‘void ApplyWiener2D_degrid_C(float (*)[2], int, int, int, int, float, float, float, float, float, const float*, float, const float (*)[2], float, const float*, float)’:
src/fft3dfilter_c.cpp:916:158: error: ‘sqrt’ was not declared in this scope
     WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ); // sharp
                                                                                                                                              ^
src/fft3dfilter_c.cpp:980:158: error: ‘sqrt’ was not declared in this scope
             WienerFactor *= 1 + sharpen*wsharpen[w]*sqrt( psd*sigmaSquaredSharpenMax/((psd + sigmaSquaredSharpenMin)*(psd + sigmaSquaredSharpenMax)) ) *
                                                                                                                                                      ^
../../cxx.inc:14: recipe for target 'src/fft3dfilter_c.o' failed
darealshinji commented 8 years ago

That's the square root function defined in math.h. I've added #include <math.h> and make the plugin link with -lm as suggested here. Which gcc version are you using? It's weird that I've never had issues with gcc 4.8.

9Morello commented 8 years ago

I'm using 5.3.1 (the one Debian Testing currently ships with). I'll try compiling again.

Edit:

I got a similar error.


src/FFT3DFilter.cpp: In function ‘void SigmasToPattern(float, float, float, float, int, int, int, float, float*)’:
src/FFT3DFilter.cpp:200:38: error: ‘sqrt’ was not declared in this scope
     constexpr float ft2 = sqrt( 0.5f ) / 2; /* frequency for sigma2 */
                                      ^
src/FFT3DFilter.cpp: In constructor ‘FFT3DFilter::FFT3DFilter(float, float, int, int, int, int, int, int, float, float, float, float, float, float, bool, bool, int, int, int, int, bool, float, float, float, float, float, float, float, float, float, int, int, VSVideoInfo, VSNodeRef*)’:
src/FFT3DFilter.cpp:398:62: error: ‘cosf’ was not declared in this scope
             wanxl[i] = cosf( pi * (i - ow + 0.5f) / (ow * 2) ); /* left analize window (half-cosine) *
                                                              ^
src/FFT3DFilter.cpp:403:62: error: ‘cosf’ was not declared in this scope
             wanyl[i] = cosf( pi * (i - oh + 0.5f) / (oh * 2) );
                                                              ^
src/FFT3DFilter.cpp:424:68: error: ‘cosf’ was not declared in this scope
             wanxl[i] = sqrt( cosf( pi * (i - ow + 0.5f) / (ow * 2) ) );
                                                                    ^
src/FFT3DFilter.cpp:424:70: error: ‘sqrt’ was not declared in this scope
             wanxl[i] = sqrt( cosf( pi * (i - ow + 0.5f) / (ow * 2) ) );
                                                                      ^
src/FFT3DFilter.cpp:429:68: error: ‘cosf’ was not declared in this scope
             wanyl[i] = sqrt( cosf( pi * (i - oh + 0.5f) / (oh * 2) ) );
                                                                    ^
src/FFT3DFilter.cpp:429:70: error: ‘sqrt’ was not declared in this scope
             wanyl[i] = sqrt( cosf( pi * (i - oh + 0.5f) / (oh * 2) ) );
                                                                      ^
src/FFT3DFilter.cpp:460:63: error: ‘cosf’ was not declared in this scope
             wsynxl[i] = cosf( pi * (i - ow + 0.5f) / (ow * 2) );
                                                               ^
src/FFT3DFilter.cpp:467:63: error: ‘cosf’ was not declared in this scope
             wsynyl[i] = cosf( pi * (i - oh + 0.5f) / (oh * 2) );
                                                               ^
src/FFT3DFilter.cpp:484:66: error: ‘exp’ was not declared in this scope
             wsharpen[i] = 1 - exp( -d2 / (2 * scutoff * scutoff) );
                                                                  ^
src/FFT3DFilter.cpp:502:52: error: ‘exp’ was not declared in this scope
             wdehalo[i] = exp( -0.7f * d2 * hr * hr ) - exp( -d2 * hr * hr ); /* some window with max a
                                                    ^
src/FFT3DFilter.cpp:527:46: error: ‘sqrtf’ was not declared in this scope
     sigmaNoiseNormed2D = sigma / sqrtf( norm );
                                              ^
src/FFT3DFilter.cpp: In function ‘void SetPattern(const float (*)[2], int, int, int, int, int, int, int, const float*, float*, float&, float, const float (*)[2])’:
src/FFT3DFilter.cpp:1271:60: error: ‘sqrt’ was not declared in this scope
     psigma = sqrt( sigmaSquared / (weight * bh * outwidth) ); /* mean std deviation (sigma) */
darealshinji commented 8 years ago

Okay, so that one needed math.h too. It should now work (I hope).

9Morello commented 8 years ago

@darealshinji This time, "make" worked, but I'm getting an error when trying to install it with "sudo make install":

Makefile:23: *** unterminated call to function 'foreach': missing ')'. Stop.

darealshinji commented 8 years ago

Should work now.

9Morello commented 8 years ago

@darealshinji It worked now, thanks!