error: ‘vl_infinity_d’ not specified in enclosing ‘parallel’
peijason opened this issue · comments
Failed to build current vlfeat-0.9.21, my ENV:
➜ vlfeat git:(master) lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
➜ vlfeat git:(master) gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
make results:
➜ vlfeat git:(master) make
Detected compiler: gcc 9
GCC <= 4.6.0 detected, disabling AVX.
The MALTAB version will be detected in the next phase of Make
CC bin/glnxa64/objs/kmeans.o
In file included from vl/kmeans.h:21,
from vl/kmeans.c:363:
vl/kmeans.c: In function ‘_vl_kmeans_quantize_f’:
vl/mathop.h:92:37: error: ‘vl_infinity_d’ not specified in enclosing ‘parallel’
92 | #define VL_INFINITY_D (vl_infinity_d.value)
| ~~~~~~~~~~~~~~^~~~~~~
vl/kmeans.c:685:34: note: in expansion of macro ‘VL_INFINITY_D’
685 | TYPE bestDistance = (TYPE) VL_INFINITY_D ;
| ^~~~~~~~~~~~~
In file included from vl/kmeans.c:1782:
vl/kmeans.c:672:9: error: enclosing ‘parallel’
672 | #pragma omp parallel default(none) \
| ^~~
In file included from vl/kmeans.c:1788:
vl/kmeans.c: In function ‘_vl_kmeans_quantize_d’:
vl/kmeans.c:685:27: error: ‘vl_infinity_d’ not specified in enclosing ‘parallel’
685 | TYPE bestDistance = (TYPE) VL_INFINITY_D ;
vl/kmeans.c:672:9: error: enclosing ‘parallel’
672 | #pragma omp parallel default(none) \
| ^~~
make: *** [make/dll.mak:111: bin/glnxa64/objs/kmeans.o] Error 1
Did you resolve this problem ?
reproduced
Hi I reproduced this problem also. Any workaround ?
Solved...
Remove all default(None) in file vl/kmeans.c
.
However, I now have a further issue:
⨯ make ARCH=glnxa64 MKOCTFILE=/usr/local/bin/mkoctfile
brought me a further issue:
make ARCH=glnxa64 MKOCTFILE=/usr/local/bin/mkoctfile 12:41:28
Detected compiler: gcc 9
GCC <= 4.6.0 detected, disabling AVX.
The MALTAB version will be detected in the next phase of Make
MEX toolbox/mex/mexa64/vl_hikmeanspush.mexa64
mex: unrecognized option '-glnxa64'
mex: unrecognized option '-O'
mex: unrecognized option '-largeArrayDims'
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=mex)
restricted \write18 enabled.
entering extended mode
! I can't find file `"CFLAGS=$CFLAGS "'.
<*> "CFLAGS=$CFLAGS "
LDFLAGS=$LDFLAGS -DVL_DISABLE_AVX -I. -Itoolbox ./too...
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
My env:
OS: Ubuntu 20.04
That is why I'm using option: -glnxa64
.
Thanks, it solved my issue.
Hi @peijason,
Actually I did not encounter this issue when compiling vlfeat doing the following:
- git clone https://github.com/vlfeat/vlfeat.git vlfeat
- cd vlfeat
- make
Here are the first lines when doing the previous commands:
Detected compiler: gcc 9
GCC <= 4.6.0 detected, disabling AVX.
MATLAB support disabled
The MALTAB version will be detected in the next phase of Make
CC bin/glnxa64/objs/kmeans.o
CC bin/glnxa64/objs/mathop_avx.o
CC bin/glnxa64/objs/kdtree.o
I have also tried and it depends if latex is installed on the local system : Works with
make MEX=$MATLABROOT/bin/
See #76
On my ubuntu 20.04, I had also to add libiomp5.so dependency by installing intel-mkl-full package
sudo apt install intel-mkl-full
@peijason You are the best, thanks for your solution. I was trying to build vl_sift.mex so I can use it inside Octave.. not fun. But here is what worked for me:
mkoctfile --mex -v --output "toolbox/mex/octave/mexa64/vl_sift.mex" -DVL_DISABLE_AVX -DMATLAB_MEX_FILE -I. -Itoolbox "./toolbox/sift/vl_sift.c" -Lbin/glnxa64 -lvl -lm
For some reason, while your command worked and put many vl_*mex files in toolbox/mex.octave, it did not build sift. Not sure why. The other error I got was that mxMalloc_800 not recognized.
For this, I just removed all the _800
tags in the source code. Then it worked. Hope it helps.
I am also using 20.04.
For me removing default(none)
from vl/kmeans.c
worked to some extend. I also had to remove the following from toolbox/mexutils.h
:
/* these attributes suppress undefined symbols warning with GCC */
#ifdef VL_COMPILER_GNUC
#if (! defined(HAVE_OCTAVE))
EXTERN_C void __attribute__((noreturn))
mexErrMsgIdAndTxt (const char * identifier, const char * err_msg, ...) ;
#else
extern void __attribute__((noreturn))
mexErrMsgIdAndTxt (const char *id, const char *s, ...);
#endif
#endif
I don't have octave and it was complaining about a missing ;
before
EXTERN_C void
^
It then compiled with matlab support.
Edit: OS: ubuntu 20.04, matlab2020b