<div dir="ltr">Alp,<div>    I emailed Andrey Bokhanko at Intel to find out if there was any issues with <a href="http://llvm.org">llvm.org</a> using those as templates. My argument was, since these files simply duplicate the commands emitted by <a href="http://build.pl">build.pl</a>, that any cmake file written from scratch is bound to look very similar.</div>
<div>            Jack</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 2:29 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes, these CMake lists looks really good and I have them integrated locally here with LLVM ToT.<br>
<br>
We'll maintain this in parallel along with the existing build system for some time so the CMake setup doesn't have to be feature-complete from the get go.<br>
<br>
LLVM project rules are however that we need explicit contribution from the author/owner of the code -- having the right license isn't sufficient and it's not really trivial code. Some time back I was speaking with people involved and indications were good but it needs to be chased up.<br>

<br>
Jack, could you investigate that, and then we can finalize the integration work when there's a sign-off?<br>
<br>
Thanks for working on this<br>
<br>
Alp.<div><div class="h5"><br>
<br>
<br>
<br>
On 30/05/2014 21:03, Jack Howarth wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Likewise the Cmakefiles.txt in openmp-3.5.0/runtime/src would be modified as..<br>
<br>
cmake_minimum_required(VERSION 2.8.1)<br>
<br>
include_directories(<br>
        .<br>
        include<br>
        include/${OMP_VERSION_NUM}<br>
        i18n<br>
        thirdparty/ittnotify<br>
        ${CMAKE_CURRENT_BINARY_DIR}<br>
        )<br>
set(ASM_SRCS<br>
 z_Linux_asm.S<br>
)<br>
<br>
set(SRCS<br>
 z_Linux_util.c<br>
 kmp_version.c<br>
 kmp_utility.c<br>
 kmp_threadprivate.c<br>
 kmp_taskq.c<br>
 kmp_tasking.c<br>
 kmp_taskdeps.cpp<br>
 kmp_str.c<br>
 kmp_settings.c<br>
 kmp_sched.cpp<br>
 kmp_runtime.c<br>
 kmp_lock.cpp<br>
 kmp_itt.c<br>
 kmp_io.c<br>
 kmp_i18n.c<br>
 kmp_gsupport.c<br>
 kmp_global.c<br>
 kmp_ftn_extra.c<br>
 kmp_ftn_cdecl.c<br>
 kmp_error.c<br>
 kmp_environment.c<br>
 kmp_dispatch.cpp<br>
 kmp_debug.c<br>
 kmp_csupport.c<br>
 kmp_cancel.cpp<br>
 kmp_atomic.c<br>
 kmp_alloc.c<br>
 kmp_affinity.cpp<br>
 ../thirdparty/innotify/<u></u>ittnotify_static.c<br>
)<br>
<br>
set_source_files_properties(${<u></u>SRCS} PROPERTIES LANGUAGE CXX)<br>
<br>
set_source_files_properties(${<u></u>ASM_SRCS} PROPERTIES LANGUAGE CXX)<br>
set_source_files_properties(${<u></u>ASM_SRCS} PROPERTIES COMPILE_FLAGS "-DKMP_GOMP_COMPAT -DKMP_ARCH_X86_64 -x assembler-with-cpp")<br>
<br>
# TODO: config parameter<br>
if(WIN32)<br>
        set(OS_GEN "win")<br>
elseif(UNIX)<br>
        set(OS_GEN "lin")<br>
elseif(APPLE)<br>
        set(OS_GEN "mac")<br>
endif()<br>
<br>
add_custom_command(<br>
        OUTPUT kmp_i18n_id.inc<br></div></div>
        COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/..<u></u>/tools/<a href="http://message-converter.pl" target="_blank">message-converter.pl</a> <<a href="http://message-converter.pl" target="_blank">http://message-converter.pl</a>> --os=${OS_GEN} --arch=${ARCH} --prefix=kmp_i18n --enum=kmp_i18n_id.inc ${CMAKE_CURRENT_SOURCE_DIR}/<u></u>i18n/en_US.txt<br>

        )<br>
add_custom_command(<br>
        OUTPUT kmp_i18n_default.inc<br>
        COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/..<u></u>/tools/<a href="http://message-converter.pl" target="_blank">message-converter.pl</a> <<a href="http://message-converter.pl" target="_blank">http://message-converter.pl</a>> --os=${OS_GEN} --arch=${ARCH} --prefix=kmp_i18n --default=kmp_i18n_default.inc ${CMAKE_CURRENT_SOURCE_DIR}/<u></u>i18n/en_US.txt<br>

        )<br>
add_custom_command(<br>
        OUTPUT omp.h<br>
        COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/..<u></u>/tools/<a href="http://expand-vars.pl" target="_blank">expand-vars.pl</a> <<a href="http://expand-vars.pl" target="_blank">http://expand-vars.pl</a>> --strict -D Revision=\"\\$$Revision\" -D Date=\"\\$$Date\" -D KMP_TYPE=\"Performance\" -D KMP_ARCH=\"\\\"${ARCH_STR}\\\"<u></u>\" -D KMP_VERSION_MAJOR=${VERSION} -D KMP_VERSION_MINOR=0 -D KMP_VERSION_BUILD=00000000 -D KMP_BUILD_DATE=\"${BUILD_TIME} UTC\" -D KMP_TARGET_COMPILER=12 -D KMP_DIAG=0 -D KMP_DEBUG_INFO=0 -D OMP_VERSION=${OMP_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/<u></u>include/${OMP_VERSION_NUM}/<u></u>omp.h.var omp.h<div class="">
<br>
        )<br>
add_custom_command(<br>
        OUTPUT z_Linux_asm.o<br>
        COMMAND g++ -c -o z_Linux_asm.o -DKMP_GOMP_COMPAT -DKMP_ARCH_X86_64 -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${<u></u>ASM_SRCS}<br>
)<br>
<br>
add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc omp.h z_Linux_asm.o)<br>
<br>
<br>
add_library(iomp5 SHARED ${SRCS} z_Linux_asm.o)<br>
add_dependencies(iomp5 gen_kmp_i18n)<br>
<br>
<br>
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/<u></u>omp.h<br>
        DESTINATION include/${PSC_FULL_VERSION})<br>
<br>
foreach(targ ${PATH64_ENABLE_TARGETS})<br>
        set(targ_arch ${_PATH64_TARGET_ARCH_${targ}}<u></u>)<br>
        set(targ_bits ${_PATH64_TARGET_BITS_${targ}}<u></u>)<br>
        install(FILES ${CMAKE_BINARY_DIR}/Xcompiler/<u></u>lib/libiomp5.so<br>
                        DESTINATION ${PATH64_LIB_PATH}/${targ_<u></u>arch}/${targ_bits})<br>
endforeach()<br>
<br>
<br></div>
…which still needs expanded to handle the fact that darwin builds this twice at 64 and 32 bit for a fat binary of the shared library. I don't think there is a lot of leeway in constructing such cmake files are they are simply duplicating the commands emitted by <a href="http://build.pl" target="_blank">build.pl</a> <<a href="http://build.pl" target="_blank">http://build.pl</a>>.<br>

           Jack<div><div class="h5"><br>
<br>
On Fri, May 30, 2014 at 1:24 PM, Jack Howarth <<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.<u></u>com</a> <mailto:<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@<u></u>gmail.com</a>>> wrote:<br>

<br>
       Using the overall file locations and structure from the<br>
    openmprtl site, this shouldn't be that hard to set the cmake build<br>
    machinery up. For example, the Cmakefiles.txt<br>
    in openmp-3.5.0/runtime would just be something like…<br>
<br>
    cmake_minimum_required(VERSION 2.8.1)<br>
<br>
    project(libiomp)<br>
<br>
    enable_language(C ASM)<br>
<br>
    set(VERSION 5)<br>
    set(OMP_VERSION_NUM "40")<br>
<br>
    # set debug as default build<br>
    if("${BUILD_TYPE}" STREQUAL "")<br>
            set(BUILD_TYPE "Debug")<br>
    endif()<br>
<br>
    # set 64bit as default architecture<br>
    if("${ARCH}" STREQUAL "")<br>
            set(ARCH "32e")<br>
    endif()<br>
    set(ARCH_STR "Intel(R) 64")<br>
<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_ITT_BUILD")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D NDEBUG")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D<br>
    KMP_ARCH_STR=\"\\\"${ARCH_STR}<u></u>\\\"\"")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D _GNU_SOURCE")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D _REENTRANT")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_USE_ASSERT")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_I8")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_TV")<br>
    if(APPLE)<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D<br>
    KMP_LIBRARY_FILE=\\\"libiomp5.<u></u>dylib\\\"")<br>
    else()<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D<br>
    KMP_LIBRARY_FILE=\\\"libiomp5.<u></u>so\\\"")<br>
    endif()<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_VERSION_MAJOR=${VERSION}")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D CACHE_LINE=64")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_ADJUST_BLOCKTIME=1")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D BUILD_PARALLEL_ORDERED")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_ASM_INTRINS")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_LOAD_BALANCE")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_CBLKDATA")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D GUIDEDLL_EXPORTS")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_GOMP_COMPAT")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")<br>
<br>
    if("${OMP_VERSION_NUM}" STREQUAL "40")<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_50_ENABLED=0")<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_41_ENABLED=0")<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_40_ENABLED=1")<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -D OMP_30_ENABLED=1")<br>
    endif()<br>
<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D USE_ITT_NOTIFY=1")<br>
    set(COMMON_FLAGS "${COMMON_FLAGS} -D<br>
    INTEL_ITTNOTIFY_PREFIX=__kmp_<u></u>itt_")<br>
<br>
    set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -fPIC")<br>
<br>
    if(${BUILD_TYPE} STREQUAL "Debug")<br>
            set(COMMON_FLAGS "${COMMON_FLAGS} -g")<br>
    endif()<br>
<br>
    # Silence some warnings<br>
    set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-unused-value")<br>
    set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-switch")<br>
    set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -Wno-switch")<br>
<br>
    # Disable exception handling.<br>
    set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS} -fno-exceptions")<br>
<br>
    # Disable use of EBP as general purpose register.<br>
    if(NOT ${ARCH} STREQUAL "64")<br>
            set(C_CXX_COMMON_FLAGS "${C_CXX_COMMON_FLAGS}<br>
    -fno-omit-frame-pointer")<br>
    endif()<br>
<br>
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}<br>
    ${C_CXX_COMMON_FLAGS}")<br>
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}<br>
    ${C_CXX_COMMON_FLAGS}")<br>
<br>
    add_subdirectory(src)<br>
<br>
       IMHO, I don't think there is much intellectual property here as<br>
    it is a fairly standard cmake syntax which is adjusted to mimic<br></div></div>
    the flags emitted by the current <a href="http://build.pl" target="_blank">build.pl</a> <<a href="http://build.pl" target="_blank">http://build.pl</a>><div class=""><br>
    scripts (which is how I made my adjustments anyway).<br>
           Jack<br>
<br>
<br>
    On Fri, May 30, 2014 at 12:37 PM, Jack Howarth<br>
    <<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@gmail.<u></u>com</a><br></div><div class="">
    <mailto:<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@<u></u>gmail.com</a>>> wrote:<br>
<br>
        Alp,<br>
            Are you thinking of these?<br>
<br>
        <a href="https://github.com/pathscale/openmprtl/blob/master/itt/libomp_oss/CMakeLists.txt" target="_blank">https://github.com/pathscale/<u></u>openmprtl/blob/master/itt/<u></u>libomp_oss/CMakeLists.txt</a><br>
<br>
                   Jack<br>
        ps Worse case we can at least look at those as a template on<br>
        how to construct ours.<br>
<br>
<br>
        On Fri, May 30, 2014 at 11:00 AM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a><br></div><div class="">
        <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>>> wrote:<br>
<br>
<br>
            On 30/05/2014 17:51, Jack Howarth wrote:<br>
<br>
                Should it be an out of source build like libcxx?<br>
<br>
<br>
            Yep, exactly.<br>
<br>
            Will try to dig up the CMake files, they're pretty neat.<br>
            Some Intel/icc-specific functionality is missing IIRC but<br>
            otherwise fine.<br>
<br>
            Alp.<br>
<br>
<br>
<br>
                On Fri, May 30, 2014 at 8:56 AM, John Leidel (jleidel)<br>
                <<a href="mailto:jleidel@micron.com" target="_blank">jleidel@micron.com</a> <mailto:<a href="mailto:jleidel@micron.com" target="_blank">jleidel@micron.com</a>><br></div>
                <mailto:<a href="mailto:jleidel@micron.com" target="_blank">jleidel@micron.com</a><div class=""><br>
                <mailto:<a href="mailto:jleidel@micron.com" target="_blank">jleidel@micron.com</a>>>> wrote:<br>
<br>
                    Why not structure this as an LLVM "project" as<br>
                defined in<br>
                <a href="http://llvm.org/docs/Projects.html" target="_blank">http://llvm.org/docs/Projects.<u></u>html</a>?<br>
<br>
<br>
                    John D. Leidel<br>
<br>
                    On May 30, 2014, at 7:30 AM, Alp Toker<br>
                <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>><br></div>
                    <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>>>><div><div class="h5"><br>
                wrote:<br>
<br>
                    ><br>
                    > On 30/05/2014 15:18, Jack Howarth wrote:<br>
                    >>    Has anyone started on integrating the openmp<br>
                build into the<br>
                    llvm build yet? If not, I would suggest we start<br>
                by borrowing the<br>
                    build machinery files from polly as the starting<br>
                point. Like<br>
                    polly, openmp provides a support library for the<br>
                compiler and<br>
                    should be built in the tools subdirectory..<br>
                    ><br>
                    > Polly is completely different to the OpenMP<br>
                runtime. Polly uses<br>
                    LLVM libraries, and can be seen as part of the<br>
                compilation host<br>
                    toolchain, while this is an independent runtime<br>
                library that runs<br>
                    on the target. So the build systems are tangential.<br>
                    ><br>
                    ><br>
                    >> Also, the polly cmake  and autogen directories<br>
                are fairly<br>
                    spartan so they should be easy to refashion for<br>
                openmp.<br>
                    ><br>
                    > There's a simple CMake setup on one of the<br>
                GitHub branches of<br>
                    this project, C. Bergström may know better if they<br>
                can be<br>
                    contributed. Either way that's closer to what's<br>
                needed here.<br>
                    ><br>
                    > Alp.<br>
                    ><br>
                    ><br>
                    >>           Jack<br>
                    >><br>
                    >><br>
                    >> ______________________________<u></u>_________________<br>
                    >> Openmp-dev mailing list<br>
                    >> <a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.<u></u>illinois.edu</a><br>
                <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a>><br></div></div>
                    <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a><div class=""><br>
                <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a>>><br>
<br>
                    >><br>
                <a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/openmp-dev</a><br>
                    ><br>
                    > --<br>
                    > <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
                    > the browser experts<br>
                    ><br>
                    > ______________________________<u></u>_________________<br>
                    > Openmp-dev mailing list<br>
                    > <a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-maillist2.engr.<u></u>illinois.edu</a><br>
                <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a>><br></div>
                    <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a><div class=""><br>
                <mailto:<a href="mailto:Openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">Openmp-dev@dcs-<u></u>maillist2.engr.illinois.edu</a>>><br>
                    > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/openmp-dev</a><br>
<br>
<br>
<br>
            --             <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
            the browser experts<br>
<br>
<br>
<br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</div></div></blockquote></div><br></div>