Skip to content

Build failure with msvc v142 toolchain #2924

@star-hengxing

Description

@star-hengxing

https://github.com/xmake-io/xmake-repo/actions/runs/10200454230/job/28219976432

C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\f\fbgemm\v0.8.0\source\src\Utils.cc(804,5): error C2760: syntax error: unexpected token '}', expected 'statement'

FBGEMM/src/Utils.cc

Lines 801 to 805 in e3db758

std::swap(input_keys, output_keys);
std::swap(input_values, output_values);
#pragma omp barrier
}
}

I find a workaround from https://developercommunity.visualstudio.com/t/pragma-omp-barrier-ignored-for-std:c/10339559
It work for me.

diff --git a/src/Utils.cc b/src/Utils.cc
index bd970432..a3829247 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -801,6 +801,7 @@ std::pair<K*, V*> radix_sort_parallel(
       std::swap(input_keys, output_keys);
       std::swap(input_values, output_values);
 #pragma omp barrier
+{}
     }
   }
 #ifdef _MSC_VER

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions