Openmvg: OpenMP errors occur in domset when building source in Visual studio 2017 with OpenMP

Created on 13 Jul 2017  ·  7Comments  ·  Source: openMVG/openMVG

When building source with Visual studio 2017 with OpenMP,some errors occur in file domset.cpp .
the lines in domset.cpp :
https://github.com/openMVG/openMVG/blob/master/src/software/SfM/clustering/domSetLibrary/domset.cc#L437-440
https://github.com/openMVG/openMVG/blob/master/src/software/SfM/clustering/domSetLibrary/domset.cc#L454-458
https://github.com/openMVG/openMVG/blob/master/src/software/SfM/clustering/domSetLibrary/domset.cc#L468-471
size_t should be modified to int or int64 when OpenMP options on .

question

All 7 comments

size_t can be replaced by intptr_t

It should compile fine, since here you see some casting: https://github.com/openMVG/openMVG/blob/master/src/software/SfM/clustering/domSetLibrary/domset.cc#L19

Can you copy paste here the error message you have in Visual Studio?

L455-457 as follow:

#if OPENMVG_USE_OPENMP
#pragma omp parallel for
#endif
    for ( size_t i = 0; i < numX; i++ )
    {
      Rp( i, i ) = R( i, i );
    }

the error message:
error C3016: “i”: OpenMP“for”语句中的索引变量必须是有符号的整型.
I translate it into English with Google.
Error C3016: "i": The index variable in the OpenMP "for" statement must be a signed integer.

Ok, got it.
It should be changed to something like:

#if OPENMVG_USE_OPENMP
#pragma omp parallel for
#endif
for_parallel( i, numX )

Will do the update soon.

Thank you for your feedback.
Please, can you give a try again to the develop branch?

Yes, I have updated the source code with the develop branch and compiled it with Visual Studio 2017. It's works fine.
Thanks.

Please, can you close the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuancaimaiyi picture yuancaimaiyi  ·  4Comments

learnmano picture learnmano  ·  6Comments

tw0023 picture tw0023  ·  5Comments

CanCanZeng picture CanCanZeng  ·  3Comments

itsdsk picture itsdsk  ·  6Comments