Jonathan,
This doesn’t seem to work for me on darwin12…
% cd openmp/runtime
% mkdir build
% cd build
% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32 …
…
% make
…
% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32e …
…
% make
Scanning dependencies of target inc
[ 0%] Generating …/exports/mac_32e/include_compat/iomp_lib.h
[ 5%] Built target inc
Scanning dependencies of target needed-headers
[ 15%] Built target needed-headers
Scanning dependencies of target lib
[ 15%] Generating kmp_dummy.o
[ 21%] Generating external-objects.lst
warning: nm: no name list
[ 21%] Generating external-symbols.lst
[ 21%] Generating iomp.o
ld: warning: ld: warning: ld: warning: ignoring file kmp_version.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_version.oignoring file kmp_ftn_extra.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_ftn_extra.oignoring file kmp_ftn_cdecl.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_ftn_cdecl.o
ld: warning: ignoring file kmp_alloc.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_alloc.o
ld: warning: ld: warning: ignoring file kmp_atomic.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_atomic.oignoring file kmp_csupport.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_csupport.o
ld: warning:
ignoring file kmp_debug.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_debug.o
ld: warning: ld: warning: ld: warning: ignoring file kmp_itt.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_itt.oignoring file kmp_error.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_error.old: warning: ignoring file kmp_environment.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_environment.o
ignoring file kmp_global.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_global.o
ld: warning:
ignoring file kmp_i18n.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_i18n.old: warning:
ignoring file kmp_io.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_io.old: warning: ld: warning:
ignoring file kmp_settings.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_settings.oignoring file kmp_runtime.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_runtime.o
ld: warning:
ignoring file kmp_str.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_str.o
ld: warning: ignoring file kmp_tasking.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_tasking.o
ld: warning: ignoring file kmp_taskq.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_taskq.o
ld: warning: ld: warning: ignoring file kmp_threadprivate.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_threadprivate.oignoring file kmp_utility.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_utility.old: warning:
ignoring file ittnotify_static.o, file was built for i386 which is not the architecture being linked (x86_64): ittnotify_static.old: warning: ld: warning: ld: warning: ld: warning:
ld: warning: ignoring file z_Linux_util.o, file was built for i386 which is not the architecture being linked (x86_64): z_Linux_util.old: warning: ignoring file kmp_gsupport.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_gsupport.old: warning: ignoring file kmp_affinity.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_affinity.oignoring file kmp_dispatch.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_dispatch.oignoring file kmp_sched.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_sched.o
ignoring file kmp_lock.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_lock.old: warning:
ignoring file kmp_taskdeps.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_taskdeps.o
ignoring file kmp_cancel.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_cancel.old: warning:
ignoring file z_Linux_asm.o, file was built for i386 which is not the architecture being linked (x86_64): z_Linux_asm.o
[ 26%] Generating unstripped/libiomp5.dylib
[ 26%] Generating libiomp5.dylib
[ 31%] Generating test-touch-rt/.success
Undefined symbols for architecture x86_64:
“_omp_get_max_threads”, referenced from:
_main in test-touch-a2b314.o
“_omp_get_num_threads”, referenced from:
_main in test-touch-a2b314.o
“_omp_get_wtime”, referenced from:
_main in test-touch-a2b314.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [test-touch-rt/.success] Error 1
make[1]: *** [CMakeFiles/lib.dir/all] Error 2
You need to execute a limited form of make clean in between the two build the would delete the previous object files but not the previously built shared libraries. Does this already exist in the cmake support but is undocumented?
Jack