Skip to content

Getting Started

Joshua Hoke Davis edited this page Jan 23, 2020 · 3 revisions

Here are the instructions to get starting with our project.

Obtaining our code.

First thing you want to do is to clone our git repository. Create a folder on your home directory to host our files, then clone the repository.

#!bash

> mkdir SOLLVE
> cd SOLLVE
> git clone [email protected]:crpl_cisc/sollve_vv.git
> cd sollve_vv

Now you should have access to our repository. Test cases are located in libomptarget/test/offloading.

Compiling and running

These instructions are for compiling and running the code in summitdev. However, running on a different environment should be similar, assuming there is support for OpenMP 4.5 and offloading on your machine.

Required modules:

module load cuda/8.0.61-1

Makefile to compile them all

There is a Makefile that will compile all the tests at once. This makefile is located inside libomptarget/test/offloading.

Here is how to use this makefile

#!bash

> make help
OpenMP Offloading Validation Suite

Do make CC=ccompiler CXX=cppcompiler [VERBOSE=1] [LOGS=1] [rule] (e.g. make CC=clang CXX=clang++ all), where rule may be one of:
  all
    Build and run all the OpenMP tests.
  clean
    Remove all executables from bin/ directory
  compilers
    Shows available compiler configuration

You need to load the particular module of the compiler you intend to use. This makefile will create a folder called bin with the compiled binaries.

GCC

#!bash

module load gcc/7.1.1-20170802
#Makefile
make CC=gcc CXX=g++ all

#Manual compilation C
gcc  -O3 -fopenmp -foffload="-lm" -lm file_to_compile.c -o binary_file.o
#Manual compilation C++
g++  -O3 -fopenmp -foffload="-lm" -lm file_to_compile.cpp -o binary_file.o

CLANG

#!bash

module load clang/20170502
#Makefile
make CC=clang CXX=clang++ all

#Manual compilation C
clang -O3 -fopenmp -fopenmp-targets=nvptx64-nvida-cuda file_to_compile.c -o binary_file.o
#Manual compilation C++
clang++ -O3 -fopenmp -fopenmp-targets=nvptx64-nvida-cuda file_to_compile.cpp -o binary_file.o