Skip to content

Build and Run on Corona

Cameron Smith edited this page Sep 1, 2020 · 17 revisions

Download

git clone [email protected]:SCOREC/omega_h.git
cd omega_h
git checkout clang11_hip

Create envCoronaRocm.sh with the following contents:

module load opt
module load rocm/3.6.0
module unload intel

Build for host using Clang11

source envCoronaClang11.sh
mkdir build-omega-clang11
cd !$
cmake ../omega_h \
  -DCMAKE_INSTALL_PREFIX=$PWD/install \
  -DBUILD_SHARED_LIBS=OFF \
  -DOmega_h_USE_HIP=OFF \
  -DOmega_h_USE_Kokkos=OFF \
  -DOmega_h_USE_MPI=OFF \
  -DCMAKE_CXX_COMPILER=/opt/rocm-3.6.0/llvm/bin/clang++ \
  -DOmega_h_CXX_WARNINGS=OFF \
  -DBUILD_TESTING=ON

make -j4
ctest # all tests should pass

Build for GPUs using hipcc

source envCoronaClang11.sh
mkdir build-omega-rocm36
cd !$
rocm=/opt/rocm-3.6.0
export HIP_PATH=$rocm/hip
export CMAKE_PREFIX_PATH=$rocm:$CMAKE_PREFIX_PATH
cmake ../omega_h \
  -DCMAKE_INSTALL_PREFIX=$PWD/install \
  -DBUILD_SHARED_LIBS=OFF \
  -DOmega_h_USE_HIP=ON \
  -DOmega_h_USE_Kokkos=OFF \
  -DCMAKE_CXX_FLAGS="--amdgpu-target=gfx906" \
  -DHIP_PATH=${rocm}/hip \
  -DOmega_h_USE_MPI=OFF \
  -DCMAKE_CXX_COMPILER=hipcc \
  -DOmega_h_CXX_WARNINGS=OFF \
  -DBUILD_TESTING=ON

make

Produces the following errors:

cd /g/g19/smith516/develop/build-omega-rocm35/src && /opt/rocm-3.6.0/bin/hipcc   -I/g/g19/smith516/develop/omega_h/src -I/g/g19/smith516/develop/build-omega-rocm35/src -I/g/g19/smith516/develop/omega_h/tpl  --amdgpu-target=gfx906   -std=c++11 -o CMakeFiles/omega_h.dir/Omega_h_array.cpp.o -c /g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp
In file included from /g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:1:
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:283:1: error: no matching constructor for initialization of 'Write<signed char>'
OMEGA_H_EXPL_INST_DECL(I8)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:278:25: note: expanded from macro 'OMEGA_H_EXPL_INST_DECL'
  extern template class HostWrite<T>;                                          \
                        ^~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:77:16: note: in implicit move constructor for 'Omega_h::HostWrite<Omega_h::I8>' first required here
    : Write<T>(HostWrite<T>(l, name_in)) {}
               ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:392:1: note: in instantiation of member function 'Omega_h::Write<signed char>::Write' requested here
INST(I8)
^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:383:18: note: expanded from macro 'INST'
  template class Write<T>;                                                     \
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit move constructor)
class Write {
      ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit copy constructor)
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:44:3: note: candidate constructor not viable: no known conversion from 'Write<signed char>' to 'Omega_h::LO' (aka 'int') for 1st argument
  Write(LO size_in, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:47:3: note: candidate constructor not viable: no known conversion from 'Write<signed char>' to 'std::initializer_list<signed char>' for 1st argument
  Write(std::initializer_list<T> l, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:48:3: note: candidate constructor not viable: no known conversion from 'Write<signed char>' to 'HostWrite<signed char>' for 1st argument
  Write(HostWrite<T> host_write);
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:32:18: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
  OMEGA_H_INLINE Write()
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:45:3: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
  Write(LO size_in, T value, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:46:3: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
  Write(LO size_in, T offset, T stride, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:231:22: note: passing argument to parameter 'write_in' here
  HostWrite(Write<T> write_in);
                     ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:284:1: error: no matching constructor for initialization of 'Write<int>'
OMEGA_H_EXPL_INST_DECL(I32)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:278:25: note: expanded from macro 'OMEGA_H_EXPL_INST_DECL'
  extern template class HostWrite<T>;                                          \
                        ^~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:77:16: note: in implicit move constructor for 'Omega_h::HostWrite<Omega_h::I32>' first required here
    : Write<T>(HostWrite<T>(l, name_in)) {}
               ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:393:1: note: in instantiation of member function 'Omega_h::Write<int>::Write' requested here
INST(I32)
^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:383:18: note: expanded from macro 'INST'
  template class Write<T>;                                                     \
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit move constructor)
class Write {
      ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit copy constructor)
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:44:3: note: candidate constructor not viable: no known conversion from 'Write<int>' to 'Omega_h::LO' (aka 'int') for 1st argument
  Write(LO size_in, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:47:3: note: candidate constructor not viable: no known conversion from 'Write<int>' to 'std::initializer_list<int>' for 1st argument
  Write(std::initializer_list<T> l, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:48:3: note: candidate constructor not viable: no known conversion from 'Write<int>' to 'HostWrite<int>' for 1st argument
  Write(HostWrite<T> host_write);
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:32:18: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
  OMEGA_H_INLINE Write()
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:45:3: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
  Write(LO size_in, T value, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:46:3: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
  Write(LO size_in, T offset, T stride, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:231:22: note: passing argument to parameter 'write_in' here
  HostWrite(Write<T> write_in);
                     ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:285:1: error: no matching constructor for initialization of 'Write<long>'
OMEGA_H_EXPL_INST_DECL(I64)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:278:25: note: expanded from macro 'OMEGA_H_EXPL_INST_DECL'
  extern template class HostWrite<T>;                                          \
                        ^~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:77:16: note: in implicit move constructor for 'Omega_h::HostWrite<Omega_h::I64>' first required here
    : Write<T>(HostWrite<T>(l, name_in)) {}
               ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:394:1: note: in instantiation of member function 'Omega_h::Write<long>::Write' requested here
INST(I64)
^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:383:18: note: expanded from macro 'INST'
  template class Write<T>;                                                     \
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit move constructor)
class Write {
      ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit copy constructor)
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:44:3: note: candidate constructor not viable: no known conversion from 'Write<long>' to 'Omega_h::LO' (aka 'int') for 1st argument
  Write(LO size_in, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:47:3: note: candidate constructor not viable: no known conversion from 'Write<long>' to 'std::initializer_list<long>' for 1st argument
  Write(std::initializer_list<T> l, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:48:3: note: candidate constructor not viable: no known conversion from 'Write<long>' to 'HostWrite<long>' for 1st argument
  Write(HostWrite<T> host_write);
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:32:18: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
  OMEGA_H_INLINE Write()
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:45:3: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
  Write(LO size_in, T value, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:46:3: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
  Write(LO size_in, T offset, T stride, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:231:22: note: passing argument to parameter 'write_in' here
  HostWrite(Write<T> write_in);
                     ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:286:1: error: no matching constructor for initialization of 'Write<double>'
OMEGA_H_EXPL_INST_DECL(Real)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:278:25: note: expanded from macro 'OMEGA_H_EXPL_INST_DECL'
  extern template class HostWrite<T>;                                          \
                        ^~~~~~~~~
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:77:16: note: in implicit move constructor for 'Omega_h::HostWrite<Omega_h::Real>' first required here
    : Write<T>(HostWrite<T>(l, name_in)) {}
               ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:395:1: note: in instantiation of member function 'Omega_h::Write<double>::Write' requested here
INST(Real)
^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.cpp:383:18: note: expanded from macro 'INST'
  template class Write<T>;                                                     \
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit move constructor)
class Write {
      ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:24:7: note: candidate constructor (the implicit copy constructor)
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:44:3: note: candidate constructor not viable: no known conversion from 'Write<double>' to 'Omega_h::LO' (aka 'int') for 1st argument
  Write(LO size_in, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:47:3: note: candidate constructor not viable: no known conversion from 'Write<double>' to 'std::initializer_list<double>' for 1st argument
  Write(std::initializer_list<T> l, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:48:3: note: candidate constructor not viable: no known conversion from 'Write<double>' to 'HostWrite<double>' for 1st argument
  Write(HostWrite<T> host_write);
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:32:18: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
  OMEGA_H_INLINE Write()
                 ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:45:3: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
  Write(LO size_in, T value, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:46:3: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
  Write(LO size_in, T offset, T stride, std::string const& name = "");
  ^
/g/g19/smith516/develop/omega_h/src/Omega_h_array.hpp:231:22: note: passing argument to parameter 'write_in' here
  HostWrite(Write<T> write_in);
                     ^
4 errors generated when compiling for gfx906.
make[2]: *** [src/CMakeFiles/omega_h.dir/Omega_h_array.cpp.o] Error 1
make[2]: Leaving directory `/g/g19/smith516/develop/build-omega-rocm35'
make[1]: *** [src/CMakeFiles/omega_h.dir/all] Error 2
make[1]: Leaving directory `/g/g19/smith516/develop/build-omega-rocm35'
make: *** [all] Error 2