Skip to content
  1. Nov 07, 2016
    • Jonas Hahnfeld's avatar
      [OpenMP] Enable ThreadSanitizer to check OpenMP programs · 50fed047
      Jonas Hahnfeld authored
      This patch allows ThreadSanitizer (Tsan) to verify OpenMP programs.
      It means that no false positive will be reported by Tsan when
      verifying an OpenMP programs.
      This patch introduces annotations within the OpenMP runtime module to
      provide information about thread synchronization to the Tsan runtime.
      
      In order to enable the Tsan support when building the runtime, you must
      enable the TSAN_SUPPORT option with the following environment variable:
      
      -DLIBOMP_TSAN_SUPPORT=TRUE
      
      The annotations will be enabled in the main shared library
      (same mechanism of OMPT).
      
      Patch by Simone Atzeni and Joachim Protze!
      
      Differential Revision: https://reviews.llvm.org/D13072
      
      llvm-svn: 286115
      50fed047
  2. Sep 14, 2016
  3. Jun 28, 2016
    • Jonathan Peyton's avatar
      Revert r273898's UNICODE quick fix in favor of CMake's remove_definitions() · cceebeef
      Jonathan Peyton authored
      UNICODE and _UNICODE defintions were added in the LLVM CMake build system.
      While on Unices, the UNICODE/_UNICODE macros don't cause problems, on Windows
      only ittnotify_static.c should be compiled using -DUNICODE.  We are still
      looking at a proper fix, but this change sets the build back to exactly what it
      was doing before.  Also, a comment and TODO were added in the src/CMakeLists.txt
      file to help explain.
      
      llvm-svn: 274052
      cceebeef
  4. Jun 27, 2016
    • Hans Wennborg's avatar
      Fix the Windows build after r273599 · 8065c518
      Hans Wennborg authored
      That patch made all LLVM projects build with -DUNICODE. However, this doesn't
      work for the OpenMP runtime.
      
      But just overriding the flag with -UUNICODE breaks compiling ittnotify_static.c,
      which for some reason needs to be compiled with -DUNICIODE. Note that compiling
      ittnotify.h with -DUNICODE does not work though.
      
      This seems like a mess. This commit fixes it for now, but it would be great
      if someone who works on the OpenMP runtime could fix it properly.
      
      llvm-svn: 273898
      8065c518
  5. May 23, 2016
    • Jonathan Peyton's avatar
      Allow unit testing on Windows · 1ab887d4
      Jonathan Peyton authored
      These changes allow testing on Windows using clang.exe.
      There are two main changes:
      1. Only link to -lm when it actually exists on the system
      2. Create basic versions of pthread_create() and pthread_join() for windows.
         They are not POSIX compliant by any stretch but will allow any existing
         and future tests to use pthread_create() and pthread_join() for testing
         interactions of libomp with os threads.
      
      Differential Revision: http://reviews.llvm.org/D20391
      
      llvm-svn: 270464
      1ab887d4
  6. Mar 16, 2016
    • Jonathan Peyton's avatar
      [CMake] Fix Windows build problem for CMake versions < 3.3 · 8a46c067
      Jonathan Peyton authored
      Building libomp using CMake versions < 3.3 caused a link time error.  These
      errors occurred because when assembling z_Windows_NT-586_asm.asm, the
      definitions: OMPT_SUPPORT, _M_AMD64|_M_IA32 weren't defined on the command line.
      To fix the problem, the COMPILE_FLAGS property for the assembly file is appended
      to instead of the COMPILE_DEFINITIONS property being set.  For whatever reason, the
      COMPILE_DEFINITIONS property doesn't pick up the definitions for assembly files
      for the older CMake versions.
      
      llvm-svn: 263651
      8a46c067
  7. Feb 04, 2016
    • Jonathan Peyton's avatar
      Add LIBOMP_ENABLE_SHARED option for CMake · fd74f900
      Jonathan Peyton authored
      When building executables for Cray supercomputers, statically-linked executables
      are preferred. This patch makes it possible to build the OpenMP runtime as an
      archive for building statically-linked executables.  The patch adds the flag
      LIBOMP_ENABLE_SHARED, which defaults to true. When true, a build of the OpenMP
      runtime yields dynamic libraries. When false, a build of the OpenMP runtime
      yields static libraries. There is no setting that allows both kinds of libraries
      to be built.
      
      Patch by John Mellor-Crummey
      
      Differential Revision: http://reviews.llvm.org/D16525
      
      llvm-svn: 259817
      fd74f900
  8. Jan 26, 2016
  9. Nov 30, 2015
    • Jonathan Peyton's avatar
      Adding Hwloc library option for affinity mechanism · 01dcf36b
      Jonathan Peyton authored
      These changes allow libhwloc to be used as the topology discovery/affinity
      mechanism for libomp.  It is supported on Unices. The code additions:
      * Canonicalize KMP_CPU_* interface macros so bitmask operations are
        implementation independent and work with both hwloc bitmaps and libomp
        bitmaps.  So there are new KMP_CPU_ALLOC_* and KMP_CPU_ITERATE() macros and
        the like. These are all in kmp.h and appropriately placed.
      * Hwloc topology discovery code in kmp_affinity.cpp. This uses the hwloc
        interface to create a libomp address2os object which the rest of libomp knows
        how to handle already.
      * To build, use -DLIBOMP_USE_HWLOC=on and
        -DLIBOMP_HWLOC_INSTALL_DIR=/path/to/install/dir [default /usr/local]. If CMake
        can't find the library or hwloc.h, then it will tell you and exit.
      
      Differential Revision: http://reviews.llvm.org/D13991
      
      llvm-svn: 254320
      01dcf36b
  10. Sep 24, 2015
  11. Sep 21, 2015
    • Jonathan Peyton's avatar
      OpenMP Initial testsuite change to purely llvm-lit based testing · 614c7ef8
      Jonathan Peyton authored
      This change introduces a check-libomp target which is based upon llvm's lit
      test infrastructure. Each test (generated from the University of Houston's
      OpenMP testsuite) is compiled and then run. For each test, an exit status of 0
      indicates success and non-zero indicates failure. This way, FileCheck is not
      needed. I've added a bit of logic to generate symlinks (libiomp5 and libgomp)
      in the build tree so that gcc can be tested as well.  When building out-of-
      tree builds, the user will have to provide llvm-lit either by specifying
      -DLIBOMP_LLVM_LIT_EXECUTABLE or having llvm-lit in their PATH.
      
      Differential Revision: http://reviews.llvm.org/D11821
      
      llvm-svn: 248211
      614c7ef8
  12. Aug 31, 2015
  13. Aug 28, 2015
    • Jonathan Peyton's avatar
      [OpenMP] [CMake] Removing expand-vars.pl in favor of CMake's configure_file() · c0225ca2
      Jonathan Peyton authored
      Currently, the libomp CMake build system uses a Perl script to configure files
      (tools/expand-vars.pl). This patch replaces the use of the Perl script by using
      CMake's configure_file() function. The major changes include:
      1. *.var has every $KMP_* variable changed to @LIBOMP_*@
      2. kmp_config.h.cmake is a new file which contains all the feature macros and
         #cmakedefine lines
      3. Most of the -D lines have been moved from LibompDefinitions.cmake but some
         OS specific MACROs (e.g., _GNU_SOURCE) remain.
      4. All expand-vars.pl related logic is removed from the CMake files.
      
      One important note about this change is that it breaks the old Perl+Makefile
      build system because it can't create kmp_config.h properly.
      
      Differential Review: http://reviews.llvm.org/D12211
      
      llvm-svn: 246314
      c0225ca2
  14. Aug 11, 2015
    • Jonathan Peyton's avatar
      Tidy statistics collection · 45be4500
      Jonathan Peyton authored
      This removes some statistics counters and timers which were not used,
      adds new counters and timers for some language features that were not
      monitored previously and separates the counters and timers into those
      which are of interest for investigating user code and those which are
      only of interest to the developer of the runtime itself.
      The runtime developer statistics are now ony collected if the
      additional #define KMP_DEVELOPER_STATS is set.
      
      Additional user statistics which are now collected include:
      * Count of nested parallelism (omp parallel inside a parallel region)
      * Count of omp distribute occurrences
      * Count of omp teams occurrences
      * Counts of task related statistics (taskyield, task execution, task
        cancellation, task steal)
      * Values passed to omp_set_numtheads
      * Time spent in omp single and omp master
      
      None of this affects code compiled without stats gathering enabled,
      which is the normal library build mode.
      
      This also fixes the CMake build by linking to the standard c++ library
      when building the stats library as it is a requirement.  The normal library
      does not have this requirement and its link phase is left alone.
      
      Differential Revision: http://reviews.llvm.org/D11759
      
      llvm-svn: 244677
      45be4500
  15. Jul 15, 2015
    • Jonathan Peyton's avatar
      Re-indent the CMake refactor to two-space indention · 5b4acbd6
      Jonathan Peyton authored
      I apologize for this nasty commit, but I somehow overlooked Chandler's
      comment to re-indent these files to two space indention.  I know this
      is a horrible commit, but I figured if it was done quickly after the 
      first one, not too many conflicts would arise.
      
      Again, I'm sorry and won't do this again.
      
      llvm-svn: 242301
      5b4acbd6
    • Jonathan Peyton's avatar
      Large Refactor of CMake build system · 2e013352
      Jonathan Peyton authored
      This commit improves numerous functionalities of the OpenMP CMake build 
      system to be more conducive with LLVM's build system and build philosophies.
      The CMake build system, as it was before this commit, was not up to LLVM's 
      standards and did not implement the configuration stage like most CMake based
      build systems offer (check for compiler flags, libraries, etc.) In order to
      improve it dramatically in a short period of time, a large refactoring had 
      to be done.
      The main changes done with this commit are as follows:
      
      * Compiler flag checks - The flags are no longer grabbed from compiler specific
        directories.  They are checked for availability in config-ix.cmake and added
        accordingly inside LibompHandleFlags.cmake.
      * Feature checks were added in config-ix.cmake.  For example, the standard CMake
        module FindThreads is probed for the threading model to use inside the OpenMP
        library.
      * OS detection - There is no longer a LIBOMP_OS variable, OS-specifc build logic
        is wrapped around the WIN32 and APPLE macros with !(WIN32 OR APPLE) meaning 
        a Unix flavor of some sort.
      * Got rid of vestigial functions/macros/variables
      * Added new libomp_append() function which is used everywhere to conditionally
        or undconditionally append to a list
      * All targets have the libomp prefix so as not to interfere with any other
        project
      * LibompCheckLinkerFlag.cmake module was added which checks for linker flags
        specifically for building shared libraries.
      * LibompCheckFortranFlag.cmake module was added which checks for fortran flag
        availability.
      * Removed most of the cruft from the translation between the perl+Makefile based
        build system and this one.  The remaining components that they share are
        perl scripts which I'm in the process of removing.
      
      There is still more left to do.  The perl scripts still need to be removed, and
      a config.h.in file (or similarly named) needs to be added with #cmakedefine lines
      in it.  But this is a much better first step than the previous system.
      
      Differential Revision: http://reviews.llvm.org/D10656
      
      llvm-svn: 242298
      2e013352
  16. Jun 11, 2015
    • Jonathan Peyton's avatar
      Implement recursive CMake. · 5215890c
      Jonathan Peyton authored
      Most CMake build systems put CMakeLists.txt files inside source directories where 
      items need to get built. This change follows that convention by adding a new 
      runtime/src/CMakeLists.txt file. An additional benefit is this helps logically 
      seperate configuring with building as well. This change is mostly just copying and 
      pasting the bottom half of runtime/CMakeLists.txt into runtime/src/CMakeLists.txt, 
      but a few changes had to be made to get it to work. Most of those changes were to 
      directory prefixes.
      
      Differential Revision: http://reviews.llvm.org/D10344
      
      llvm-svn: 239542
      5215890c
  17. May 18, 2015
  18. Jan 13, 2015
  19. Aug 07, 2014
  20. Jun 02, 2014
  21. Jun 01, 2014
    • Alp Toker's avatar
      Add initial CMake build system · 7198f529
      Alp Toker authored
      This is not yet supported for production builds but can already produce working
      binaries on OS X and Linux with clang and gcc.
      
      The intention is to improve support to the point where it can integrate with
      the LLVM runtime platform, cover all platforms, runtime/release build
      configurations and run the tests.
      
      Patch by Jack Howarth!
      
      llvm-svn: 209994
      7198f529
Loading