<div dir="ltr">Hal,<div> Actually, this needs some additional work to truly mimic the 'make compiler=clang; build. We need additional add_custom_command's to handle this bit…</div><div><br></div><div><div>----- 1/1 --- kmp_dummy.c -----</div>
<div>echo "void __kmp_dummy() {}" > kmp_dummy.c</div><div>----- 1/1 --- kmp_dummy.o -----</div><div>clang -I ./ -I ../../src/ -I ../../src/i18n/ -I ../../src/include/40/ -I ../../src/thirdparty/ittnotify/ -D USE_ITT_BUILD -D NDEBUG -D KMP_ARCH_STR="\"Intel(R) 64\"" -D _GNU_SOURCE -D _REENTRANT -D KMP_USE_ASSERT -D BUILD_I8 -D BUILD_TV -D KMP_LIBRARY_FILE=\"libiomp5.dylib\" -D KMP_VERSION_MAJOR=5 -D CACHE_LINE=64 -D KMP_ADJUST_BLOCKTIME=1 -D BUILD_PARALLEL_ORDERED -D KMP_ASM_INTRINS -D USE_LOAD_BALANCE -D USE_CBLKDATA -D GUIDEDLL_EXPORTS -D KMP_GOMP_COMPAT -D KMP_USE_ADAPTIVE_LOCKS=1 -D KMP_DEBUG_ADAPTIVE_LOCKS=0 -D OMP_50_ENABLED=0 -D OMP_41_ENABLED=0 -D OMP_40_ENABLED=1 -D OMP_30_ENABLED=1 -D USE_ITT_NOTIFY=1 -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_ -I/sw/include -c -fPIC -O2 -Wno-unused-value -Wno-switch -Wno-deprecated-register -fno-exceptions -x c++ -std=c++0x -o kmp_dummy.o kmp_dummy.c</div>
<div>----- 1/1 --- external-objects.lst -----</div><div>perl ../../tools/<a href="http://required-objects.pl">required-objects.pl</a> --os=mac --arch=32e \</div><div> --base ittnotify_static.o kmp_affinity.o kmp_alloc.o kmp_atomic.o kmp_cancel.o kmp_csupport.o kmp_debug.o kmp_dispatch.o kmp_environment.o kmp_error.o kmp_ftn_cdecl.o kmp_ftn_extra.o kmp_global.o kmp_gsupport.o kmp_i18n.o kmp_io.o kmp_itt.o kmp_lock.o kmp_runtime.o kmp_sched.o kmp_settings.o kmp_str.o kmp_taskdeps.o kmp_tasking.o kmp_taskq.o kmp_threadprivate.o kmp_utility.o kmp_version.o z_Linux_asm.o z_Linux_util.o kmp_dummy.o --extra --print-extra > external-objects.lst.tmp</div>
<div>warning: nm: no name list</div><div>echo "kmp_dummy.o" >> external-objects.lst.tmp</div><div>mv external-objects.lst.tmp external-objects.lst</div><div>----- 1/1 --- external-symbols.lst -----</div><div>
nm -goj $(cat external-objects.lst) > external-symbols.lst.0.tmp</div><div>cut -f2 -d" " external-symbols.lst.0.tmp > external-symbols.lst.1.tmp</div><div>mv external-symbols.lst.1.tmp external-symbols.lst</div>
<div>----- 1/1 --- iomp.o -----</div><div>ld -r -unexported_symbols_list external-symbols.lst \</div><div> -non_global_symbols_strip_list external-symbols.lst \</div><div> -filelist external-objects.lst \</div>
<div> -o iomp.o ittnotify_static.o kmp_affinity.o kmp_alloc.o kmp_atomic.o kmp_cancel.o kmp_csupport.o kmp_debug.o kmp_dispatch.o kmp_environment.o kmp_error.o kmp_ftn_cdecl.o kmp_ftn_extra.o kmp_global.o kmp_gsupport.o kmp_i18n.o kmp_io.o kmp_itt.o kmp_lock.o kmp_runtime.o kmp_sched.o kmp_settings.o kmp_str.o kmp_taskdeps.o kmp_tasking.o kmp_taskq.o kmp_threadprivate.o kmp_utility.o kmp_version.o z_Linux_asm.o z_Linux_util.o</div>
<div>----- 1/1 --- unstripped/.dir -----</div><div>mkdir -p unstripped/</div><div>touch unstripped/.dir</div><div>----- 1/1 --- unstripped/libiomp5.dylib.lst -----</div><div>echo iomp.o > unstripped/libiomp5.dylib.lst</div>
</div><div><br></div><div>I'll see if I can puzzle that out on darwin over the weekend.</div><div> Jack</div><div>ps IMHO, we should try to have the cmake build follow the same exact steps as the 'make compiler=clang' build to maintain continuity.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 11:46 PM, Jack Howarth <span dir="ltr"><<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hal,<div> The attached Cmakefiles.txt, for placement in openmp/runtime/src, is as simple as I think the file can be and still reproduce the build obtained from <a href="http://build.pl" target="_blank">build.pl</a> with 'make compiler=clang'.</div>
<div>Between the syntax required for the perl scripts in the tools subdirectory and the syntax requirements of cmake, I don't see this changing much. Everything in there is essential to the build. For instance, if you drop….</div>
<div><br></div><div><div>set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)</div><div>set_source_files_properties(${ASM_SOURCES} PROPERTIES LANGUAGE CXX)</div></div><div><br></div><div>you will get compile time errors in clang for z_Linux_util.c on darwin which wants to use a c++ compiler here.</div>
<span class="HOEnZb"><font color="#888888">
<div> Jack</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 8:13 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jack,<br>
<br>
No, I based my makefile on a manual examination of the various .mk files in the runtime/src directory (+ some trial and error). It is for a port of the library to a ppc64-based system, so you'll need to make some changes (like adding back the asm file) to make it work on Darwin.<br>
<br>
-Hal<br>
<div><br>
----- Original Message -----<br>
> From: "Jack Howarth" <<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br>
> Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a>, "C. Bergström" <<a href="mailto:cbergstrom@pathscale.com" target="_blank">cbergstrom@pathscale.com</a>><br>
</div><div>> Sent: Friday, May 30, 2014 7:04:59 PM<br>
> Subject: Re: [Openmp-dev] (no subject)<br>
><br>
><br>
> Hal,<br>
</div><div><div>> Did you base your Makefile on the behavior of <a href="http://build.pl" target="_blank">build.pl</a> from 'make<br>
> compiler=gcc'? On darwin, I find that the exact build as replicated<br>
> from the behavior of <a href="http://build.pl" target="_blank">build.pl</a> using 'make compiler=clang' produces a<br>
> different object file list….<br>
><br>
><br>
><br>
> --- Makefile.bgq 2014-05-30 19:59:16.000000000 -0400<br>
> +++ Makefile.jwh 2014-05-30 20:01:08.000000000 -0400<br>
> @@ -7,10 +7,10 @@<br>
><br>
> CPPFLAGS = ${FEATURE_FLAGS} -D__float128='long double'<br>
><br>
> -CC = powerpc64-bgq-linux-gcc<br>
> -CXX = powerpc64-bgq-linux-g++<br>
> +CC = clang<br>
> +CXX = clang++<br>
><br>
> -all: build/libiomp5.a build/libiomp5.so<br>
> +all: build/libiomp5.a build/libiomp5.dylib<br>
><br>
> build/.dir:<br>
> mkdir -p build<br>
> @@ -28,6 +28,7 @@<br>
> ${CC} -x c++ -c ${CPPFLAGS} -g -O3 -Isrc -Ibuild -o $@ $<<br>
><br>
> OBJS = build/kmp_alloc.o \<br>
> + build/kmp_affinity.o \<br>
> build/kmp_atomic.o \<br>
> build/kmp_cancel.o \<br>
> build/kmp_csupport.o \<br>
> @@ -37,8 +38,8 @@<br>
> build/kmp_error.o \<br>
> build/kmp_ftn_cdecl.o \<br>
> build/kmp_ftn_extra.o \<br>
> - build/kmp_ftn_stdcall.o \<br>
> build/kmp_global.o \<br>
> + build/kmp_gsupport.o \<br>
> build/kmp_i18n.o \<br>
> build/kmp_io.o \<br>
> build/kmp_itt.o \<br>
> @@ -53,7 +54,8 @@<br>
> build/kmp_utility.o \<br>
> build/kmp_version.o \<br>
> build/kmp_lock.o \<br>
> - build/z_Linux_util.o<br>
> + build/z_Linux_util.o \<br>
> + build/ittnotify_static.o<br>
><br>
> BGSYS_FLOOR=$(shell readlink /bgsys/drivers/ppcfloor)<br>
> build/libiomp5.so: $(OBJS)<br>
> [prrg4:~/llvm-svn/openmp-3.5.0/runtime] howarth%<br>
><br>
><br>
><br>
><br>
><br>
> On Fri, May 30, 2014 at 7:30 PM, Hal Finkel < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> ><br>
> wrote:<br>
><br>
><br>
><br>
> ----- Original Message -----<br>
> > From: "Jack Howarth" < <a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a> ><br>
><br>
> > To: "Hal Finkel" < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> ><br>
</div></div>> > Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a> , "C. Bergström" <<br>
<div><div>> > <a href="mailto:cbergstrom@pathscale.com" target="_blank">cbergstrom@pathscale.com</a> ><br>
><br>
> > Sent: Friday, May 30, 2014 6:21:19 PM<br>
> > Subject: Re: [Openmp-dev] (no subject)<br>
> ><br>
> ><br>
><br>
> > Hal,<br>
> > Also note that they are replicating the build from <a href="http://build.pl" target="_blank">build.pl</a> down to<br>
> > the exact order of source file compilation. So the question arises,<br>
> > to what degree is is it invalid to even glance at their<br>
> > Cmakelist.txt for overall ideas on how to do this. Considering that<br>
> > they are simply emitting the same build commands as <a href="http://build.pl" target="_blank">build.pl</a> (to<br>
> > which we already have license), I imagine we would have to code in<br>
> > a<br>
> > very similar manner even if done from scratch, i.e., use instances<br>
> > of add_custom_command to manually emit the same <a href="http://build.pl" target="_blank">build.pl</a> commands.<br>
> > There probably aren't that many ways to code that in cmake.<br>
> > Jack<br>
><br>
> Yep, I understand. That's why what you did could be considered<br>
> imprudent ;) -- In any case, let's give C. a chance to solve this<br>
> problem for you.<br>
><br>
> In case that does not work out and it makes things easier, I've<br>
> attached another alternate makefile that I use to build this<br>
> library. Converting this into cmake form is also not too hard.<br>
><br>
> -Hal<br>
><br>
><br>
> ><br>
> ><br>
> ><br>
> > On Fri, May 30, 2014 at 7:10 PM, Jack Howarth <<br>
> > <a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a> > wrote:<br>
> ><br>
> ><br>
> ><br>
> > Hal,<br>
> > Even if that is problematic, starting over is fairly<br>
> > straight-forward. Their CMakelists.txt is simply a directly<br>
> > repetition of the commands emitted from the build as done by<br>
> > <a href="http://build.pl" target="_blank">build.pl</a> . So if they are difficult about it, just take a printout<br>
><br>
><br>
> > of the output for the current build with 'make compiler=clang" and<br>
> > code the Cmakelist.txt from that. If you look carefully, you will<br>
> > see that they are replicating this down to the exact order of the<br>
> > parameters on the compiler calls. It is very difficult to see how<br>
> > that could be intellectual property in any fashion since<br>
> > replicating<br>
> > the output of the <a href="http://build.pl" target="_blank">build.pl</a> currently in <a href="http://llvm.org" target="_blank">llvm.org</a> 's openmp results<br>
> > in the same ordering. Note that their files are only a crude<br>
> > starting point and nowhere near what we will need for llvm.<br>
> > Jack<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Fri, May 30, 2014 at 6:40 PM, Hal Finkel < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> ><br>
> > wrote:<br>
> ><br>
> ><br>
> > Jack,<br>
> ><br>
> > Before you go too far with this, do we have Pathscale's explicit<br>
> > contribution of their build files? (I've cc'd C. Bergstrom so that<br>
> > he can comment directly).<br>
> ><br>
> > Thanks,<br>
> > Hal<br>
> ><br>
> ><br>
> ><br>
> > ----- Original Message -----<br>
> > > From: "Jack Howarth" < <a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.com</a> ><br>
> > > To: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
> > > Sent: Friday, May 30, 2014 5:28:33 PM<br>
> > > Subject: [Openmp-dev] (no subject)<br>
> > ><br>
> > ><br>
> > ><br>
> > > Attached is a first pass at modifying the cmakefiles from<br>
> > > <a href="https://github.com/pathscale/openmprtl/blob/master/itt/libomp_oss" target="_blank">https://github.com/pathscale/openmprtl/blob/master/itt/libomp_oss</a><br>
> > > to<br>
> > > build openmp. I noticed that the existing <a href="http://build.pl" target="_blank">build.pl</a> doesn't<br>
> > > actually<br>
> > > build a fat shared library on darwin. The attached changes can<br>
> > > does<br>
> > > this in an indirect fashion with…<br>
> > ><br>
> > ><br>
> > > % cd runtime<br>
> > > % mkdir build_32<br>
> > > % cd build_32<br>
> > > % cmake -DARCH="32" ..<br>
> > > % make VERBOSE=1<br>
> > > % cd ..<br>
> > > % mkdir build_32e<br>
> > > % cmake -DARCH="32e" ..<br>
> > > % make VERBOSE=1<br>
> > > % cd ..<br>
> > > % lipo ./build_32/src/libiomp5.dylib<br>
> > > ./build_32e/src/libiomp5.dylib<br>
> > > -create -o libiomp5.dylib<br>
> > > % file libiomp5.dylib<br>
> > ><br>
> > > libiomp5.dylib: Mach-O universal binary with 2 architectures<br>
> > > libiomp5.dylib (for architecture x86_64): Mach-O 64-bit<br>
> > > dynamically<br>
> > > linked shared library x86_64<br>
> > > libiomp5.dylib (for architecture i386): Mach-O dynamically linked<br>
> > > shared library i386<br>
> > ><br>
> > ><br>
> > > Normally we could do this in cmake by passing '-arch i386 -arch<br>
> > > x86_64' but use of assembly code in the build gums that up.<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><br>
> > ><br>
> ><br>
> > --<br>
> > Hal Finkel<br>
> > Assistant Computational Scientist<br>
> > Leadership Computing Facility<br>
> > Argonne National Laboratory<br>
> ><br>
> ><br>
> ><br>
><br>
> --<br>
> Hal Finkel<br>
> Assistant Computational Scientist<br>
> Leadership Computing Facility<br>
> Argonne National Laboratory<br>
><br>
><br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>