<div dir="ltr">Jonathan,<div>     This doesn't seem to work for me on darwin12…</div><div><br></div><div>% cd openmp/runtime</div><div>% mkdir build</div><div>% cd build</div><div>% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32 ..</div>
<div>...</div><div>% make</div><div>...</div><div>% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32e ..</div><div>...</div><div>% make</div><div><div>Scanning dependencies of target inc</div><div>[  0%] Generating ../exports/mac_32e/include_compat/iomp_lib.h</div>
<div>[  5%] Built target inc</div><div>Scanning dependencies of target needed-headers</div><div>[ 15%] Built target needed-headers</div><div>Scanning dependencies of target lib</div><div>[ 15%] Generating kmp_dummy.o</div>
<div>[ 21%] Generating external-objects.lst</div><div>warning: nm: no name list</div><div>[ 21%] Generating external-symbols.lst</div><div>[ 21%] Generating iomp.o</div><div>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</div>
<div><br></div><div><br></div><div>ld: warning: ignoring file kmp_alloc.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_alloc.o</div><div>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</div>
<div>ld: warning: </div><div>ignoring file kmp_debug.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_debug.o</div><div>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</div>
<div><br></div><div>ignoring file kmp_global.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_global.o</div><div>ld: warning: </div><div>ignoring file kmp_i18n.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_i18n.old: warning: </div>
<div>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: </div><div>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</div>
<div>ld: warning: </div><div>ignoring file kmp_str.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_str.o</div><div>ld: warning: ignoring file kmp_tasking.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_tasking.o</div>
<div>ld: warning: ignoring file kmp_taskq.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_taskq.o</div><div>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: </div>
<div><br></div><div>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: </div><div>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</div>
<div>ignoring file kmp_lock.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_lock.old: warning: </div><div>ignoring file kmp_taskdeps.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_taskdeps.o</div>
<div><br></div><div><br></div><div><br></div><div>ignoring file kmp_cancel.o, file was built for i386 which is not the architecture being linked (x86_64): kmp_cancel.old: warning: </div><div><br></div><div>ignoring file z_Linux_asm.o, file was built for i386 which is not the architecture being linked (x86_64): z_Linux_asm.o</div>
<div>[ 26%] Generating unstripped/libiomp5.dylib</div><div>[ 26%] Generating libiomp5.dylib</div><div>[ 31%] Generating test-touch-rt/.success</div><div>Undefined symbols for architecture x86_64:</div><div>  "_omp_get_max_threads", referenced from:</div>
<div>      _main in test-touch-a2b314.o</div><div>  "_omp_get_num_threads", referenced from:</div><div>      _main in test-touch-a2b314.o</div><div>  "_omp_get_wtime", referenced from:</div><div>      _main in test-touch-a2b314.o</div>
<div>ld: symbol(s) not found for architecture x86_64</div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div>make[2]: *** [test-touch-rt/.success] Error 1</div><div>make[1]: *** [CMakeFiles/lib.dir/all] Error 2</div>
</div><div><br></div><div>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?</div>
<div>                         Jack</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 11:14 AM, Peyton, Jonathan L <span dir="ltr"><<a href="mailto:jonathan.l.peyton@intel.com" target="_blank">jonathan.l.peyton@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Jack,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Right now, after you build the both the 32 and 32e libraries, you should be able to say “make fat” and it will call the lipo command for you.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Keep in mind, the system is setup so that cmake will only include the “fat” target when the configuration is for 32e, and it will not automatically build the
 libraries for you if you specify the “fat” target but both 32 and 32e libraries haven’t been built yet, only an error is spit out.  There are no plans to automate it further.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">There is some instruction on it in Build_With_CMake.txt.<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+Mac Fat Libraries<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+=================<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+On OS X machines, it is possible to build universal (or fat) libraries which<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+include both IA-32 architecture and Intel(R) 64 architecture objects in a<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+single archive; just build the 32 and 32e libraries separately:<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+ $ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Darch=32 ..<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+ $ make<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+ $ cmake -Darch=32e ..<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+ $ make<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+then invoke make again with a special argument as follows:<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+ $ make fat<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+* The fat target is only available for the arch=32e configuration.<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+* The fat libraries will be put in exports/mac_32e/lib while the "thin" libraries<u></u><u></u></span></p>

<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Lucida Console"">+  will be in exports/mac_32e/lib.thin and exports/mac_32/lib.thin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Johnny<u></u><u></u></span></p>
<p class="MsoNormal"><a name="14681326f692e0dd__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Jack Howarth [mailto:<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a>]
<br>
<b>Sent:</b> Friday, June 6, 2014 8:42 PM<br>
<b>To:</b> Peyton, Jonathan L<br>
<b>Cc:</b> <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
<b>Subject:</b> Re: [Openmp-dev] Initial Intel Cmake Build System Patch<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Jonathon,<u></u><u></u></p>
<div>
<p class="MsoNormal">     Thanks. Confirmed to work properly on x86_64-apple-darwin12 with…<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">% cd runtime<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% mkdir build<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% cd build<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Dos=mac -Darch=32 ..<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% make all common<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% file libiomp5.dylib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">libiomp5.dylib: Mach-O dynamically linked shared library i386<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">and<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">% cd runtime<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% mkdir build<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% cd build<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Dos=mac -Darch=32e ..<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% make all common<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">% file libiomp5.dylib<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">libiomp5.dylib: Mach-O 64-bit dynamically linked shared library x86_64<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Are there any plans to tweak this to automate the build of a fat libiomp5.dylib on darwin?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Jun 6, 2014 at 7:02 PM, Peyton, Jonathan L <<a href="mailto:jonathan.l.peyton@intel.com" target="_blank">jonathan.l.peyton@intel.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hello All,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Since everyone wants to see it, this patch is the initial cmake build system we have been developing.  Some quick notes:<u></u><u></u></p>
<p class="MsoNormal">1) The top-level CMakeLists.txt you all have been working on is moved to CMakeLists.txt.old (the src/CMakeLists.txt file is untouched)<u></u><u></u></p>
<p class="MsoNormal">2) There is a Build_With_CMake.txt tutorial that shows the most important features and how to build libiomp5<u></u><u></u></p>
<p class="MsoNormal">3) As a special note, the current
<a href="http://build.pl" target="_blank">build.pl</a> system does five “micro-tests” which test certain features of the newly built libiomp5.so library (basic linking/compilation, library dependencies, etc.)  If you want these to be off in the new CMake system
 just specify it when calling cmake with the flag –Dtests=off<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Please keep in mind this is the initial system and that it can be trimmed back incrementally to what you need.  Right now, it builds nearly identical libraries as
<a href="http://build.pl" target="_blank">build.pl</a>.  On a related note, I attempted ( as suggested by David ) to port libiomp5 to NetBSD to see what walls I would hit.  I hit some
<span style="font-family:Wingdings">J</span> , but eventually got it working (not included in this initial patch).  So I am going to follow up this initial patch with further improvements (to the build system) to make re-targeting in general even easier.  Some
 of these improvements will also help the <a href="http://build.pl" target="_blank">
build.pl</a> system as well.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Just try it.  See what you hate and what you like.  Leave feedback.  I am here on weekdays.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Johnny<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>