<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">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>
<div>             Jack</div></div><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 class=""><br>
----- Original Message -----<br>
> From: "Jack Howarth" <<a href="mailto:howarth.mailing.lists@gmail.com">howarth.mailing.lists@gmail.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
> Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu">openmp-dev@dcs-maillist2.engr.illinois.edu</a>, "C. Bergström" <<a href="mailto:cbergstrom@pathscale.com">cbergstrom@pathscale.com</a>><br>

</div><div class="">> Sent: Friday, May 30, 2014 7:04:59 PM<br>
> Subject: Re: [Openmp-dev] (no subject)<br>
><br>
><br>
> Hal,<br>
</div><div><div class="h5">> 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">hfinkel@anl.gov</a> ><br>
> wrote:<br>
><br>
><br>
><br>
> ----- Original Message -----<br>
> > From: "Jack Howarth" < <a href="mailto:howarth.mailing.lists@gmail.com">howarth.mailing.lists@gmail.com</a> ><br>
><br>
> > To: "Hal Finkel" < <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> ><br>
</div></div>> > Cc: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu">openmp-dev@dcs-maillist2.engr.illinois.edu</a> , "C. Bergström" <<br>
<div class="HOEnZb"><div class="h5">> > <a href="mailto:cbergstrom@pathscale.com">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">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">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">howarth.mailing.lists@gmail.com</a> ><br>
> > > To: <a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu">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">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>