Clone wiki

hcc / OpenMP

The instructions below assume you are in $HOME/hcc. The compiler would be built under $HOME/hcc/build. The OpenMP runtime would be put under $HOME/hcc/openmp.

Build HCC and OpenMP runtime

HCC now comes with OpenMP support by default. But to run OpenMP programs, you’ll need to build OpenMP runtime separately.

  • HCC: HCC compiler
  • OpenMP runtime

HCC Compiler

git clone src
mkdir build
cd build
cmake ../src
make -j4 world 
make -j4
sudo make install
export HCC_HOME=/opt/hcc
export PATH=$HCC_HOME/bin:$PATH

OpenMP runtime

The instructions below assume you are in $HOME/hcc. The build assumes x86-64 architecture.

svn co openmp
cd openmp
svn up -r238878
cd runtime
make compiler=clang arch=x86_64
export C_INCLUDE_PATH=$HOME/hcc/openmp/runtime/exports/common/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$HOME/hcc/openmp/runtime/exports/common/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=$HOME/hcc/openmp/runtime/exports/lin_32e/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$HOME/hcc/openmp/runtime/exports/lin_32e/lib:$LD_LIBRARY_PATH

Running benchmarks

Note: You need to set all environment variables mentioned above with HCC-OpenMP Compiler and OpenMP runtime.

OpenMP samples

This step compiles and runs the OpenMP samples required:

  • omp_hello.c
  • omp_orphan.c
  • omp_workshare1.c
  • md_openmp.c
  • omp_mm.c
  • omp_reduction.c

cd src/omp-sample

You should be able to see all samples compiled and executed without error message.

OpenMP3.1_Validation (OpenUH OpenMP test suite)

cd src/OpenMP3.1_Validation
make clean
make ctest

Note that you will encounter a build error with make clean in the first time, that’s a normal situation.

S Number of failed tests should be 7. These test cases are not supported by upstream clang-omp, so the we cannot yet be supported in Kalmar, and we consider this being regression-free.

  • omp_for_schedule_guided
  • omp_for_schedule_guided + orphaned mode
  • omp_task_untied
  • omp_task_untied + orphaned mode
  • omp_taskyield + orphaned mode
  • omp_task_final
  • omp_task_final + orphaned mode