File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ This new release adds support for sparse cost matrices and a new lazy EMD solver
1717- Fix deprecated JAX function in ` ot.backend.JaxBackend ` (PR #771 , Issue #770 )
1818- Add test for build from source (PR #772 , Issue #764 )
1919- Fix device for batch Ot solver in ` ot.batch ` (PR #784 , Issue #783 )
20+ - Fix openmp flags on macOS (PR #789 )
2021
2122## 0.9.6.post1
2223
Original file line number Diff line number Diff line change @@ -33,7 +33,18 @@ def get_openmp_flag(compiler):
3333 # Default flag for GCC and clang:
3434 omp_flag = ["-fopenmp" ]
3535 if sys .platform .startswith ("darwin" ):
36- omp_flag += ["-Xpreprocessor" , "-lomp" ]
36+ omp_flag = ["-Xpreprocessor" , "-fopenmp" ]
37+ omp_flag += ["-I/usr/local/opt/libomp/include" ]
38+ # Assuming `brew install libomp` on recent macOS
39+ if os .path .isfile ("/opt/homebrew/opt/libomp/lib/libomp.dylib" ):
40+ omp_flag += ["-I/opt/homebrew/opt/libomp/include" ]
41+ omp_flag += ["/opt/homebrew/opt/libomp/lib/libomp.dylib" ]
42+ else :
43+ # Assuming `brew install libomp` on old macOS
44+ if os .path .isfile ("/usr/local/opt/libomp/lib/libomp.dylib" ):
45+ omp_flag += ["-I/usr/local/opt/libomp/include" ]
46+ omp_flag += ["/usr/local/opt/libomp/lib/libomp.dylib" ]
47+
3748 return omp_flag
3849
3950
You can’t perform that action at this time.
0 commit comments