[Openmp-dev] Integration with LLVM CMake build when doing Universal Binary

Jonathan Buschmann jonthn at pinacea.com
Sat May 23 09:04:28 PDT 2015


Hello openmp-dev,

When trying a build with everything under the LLVM hierarchy (in this case openmp subversion trunk saved under projects/libiomp) I encountered this error :

[ 42%] Building C object projects/libiomp/runtime/CMakeFiles/iomp5.dir/src/z_Linux_asm.s.o
/tmp/llvm/projects/libiomp/runtime/src/z_Linux_asm.s:702:8: error: register %rbp is only available in 64-bit mode
pushq %rbp       
           ^~~~
…

I usually do a "Universal build" (32-bit / 64-bit in the same bin/lib) something like :

 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;i386"

so you end up with the compilation done this way :

[ 42%] Building C object projects/libiomp/runtime/CMakeFiles/iomp5.dir/src/z_Linux_asm.s.o
cd /tmp/llvm/build/projects/libiomp/runtime && /usr/bin/cc  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Diomp5_EXPORTS -DKMP_ARCH_X86_64 -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default  -DNDEBUG -arch x86_64 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fPIC -I/tmp/llvm/build/projects/libiomp/runtime -I/tmp/llvm/projects/libiomp/runtime -I/tmp/llvm/build/include -I/tmp/llvm/include -I/tmp/llvm/projects/libiomp/runtime/src -I/tmp/llvm/projects/libiomp/runtime/src/i18n -I/tmp/llvm/projects/libiomp/runtime/src/include/41 -I/tmp/llvm/projects/libiomp/runtime/src/thirdparty/ittnotify    -D USE_ITT_BUILD -D KMP_ARCH_STR="\"Intel(R) 64\"" -D BUILD_I8 -D KMP_LIBRARY_FILE=\"libiomp5.dylib\" -D KMP_VERSION_MAJOR=5 -D KMP_NESTED_HOT_TEAMS -D CACHE_LINE=64 -D KMP_ADJUST_BLOCKTIME=1 -D BUILD_PARALLEL_ORDERED -D KMP_ASM_INTRINS -D USE_ITT_NOTIFY=1 -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_ -D _GNU_SOURCE -D _REENTRANT -D BUILD_TV -D USE_CBLKDATA -D KMP_GOMP_COMPAT -D USE_LOAD_BALANCE -D KMP_USE_ASSERT -D GUIDEDLL_EXPORTS -D KMP_STATS_ENABLED=0 -D OMPT_SUPPORT=0 -D OMPT_BLAME=1 -D OMPT_TRACE=1 -D OMP_50_ENABLED=0 -D OMP_41_ENABLED=1 -D OMP_40_ENABLED=1 -D OMP_30_ENABLED=1 -D KMP_USE_ADAPTIVE_LOCKS=1 -D KMP_DEBUG_ADAPTIVE_LOCKS=0 -D KMP_USE_INTERNODE_ALIGNMENT=0 -x assembler-with-cpp -o CMakeFiles/iomp5.dir/src/z_Linux_asm.s.o   -c /tmp/llvm/projects/libiomp/runtime/src/z_Linux_asm.s

The flag -arch i386 conflicts with the -DKMP_ARCH_X86_64 and produce the result above (or at least I think so).

Would it be possible to support building with -DCMAKE_OSX_ARCHITECTURES="x86_64;i386" ?

Regards,

 jonathan



More information about the Openmp-dev mailing list