Clang + OpenMP testing

208 views
Skip to first unread message

Alex Stewart

unread,
Aug 1, 2016, 5:04:08 AM8/1/16
to ceres-...@googlegroups.com
Dear All,

We have added a CL here:


which should enable Ceres to compile with OpenMP support on Clang (>= 3.8) when it is available.  This should include Ubuntu 16.04+ (with the Clang 3.8+ package), and hopefully Xcode 8.

If you are using Clang 3.8+ (or Xcode 8) please can you give this a whirl, and report any issues you find and we will endeavour to fix them.  Success here should mean that you see the following output in the CMake configure phase:

"-- Building with OpenMP."

and not this: "— Building without OpenMP (disabling multithreading).”, and that all of the tests pass.

If OpenMP is still not enabled when you think your version of Clang should support OpenMP, please can you supply the snippet from: <BUILD_DIR>/CMakeFiles/CMakeError.log related to the search for OpenMP which might look something like this (in addition to your OS & Clang details):

---------------------------------------->8----------------------------------------
Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/alex/code/external/ceres-solver/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f80a0/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_f80a0.dir/build.make CMakeFiles/cmTC_f80a0.dir/build
Building C object CMakeFiles/cmTC_f80a0.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc    -DOpenMP_FLAG_DETECTED -fopenmp=libomp   -o CMakeFiles/cmTC_f80a0.dir/src.\
c.o   -c /Users/alex/code/external/ceres-solver/build/CMakeFiles/CMakeTmp/src.c
clang: warning: argument unused during compilation: '-fopenmp=libomp'
/Users/alex/code/external/ceres-solver/build/CMakeFiles/CMakeTmp/src.c:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_f80a0.dir/src.c.o] Error 1
make: *** [cmTC_f80a0/fast] Error 2
---------------------------------------->8----------------------------------------

Thanks!

-Alex
Reply all
Reply to author
Forward
0 new messages