529d245738
Change-Id: I088c1035f1f25e7a5cc65077ff0b8cd281fdaf55
31 wiersze
812 B
Markdown
31 wiersze
812 B
Markdown
### This will test cmake lang support: CXX and Fortran
|
|
I. Prepare
|
|
1) You must install cmake version 3.18 or above to support LINK_LANGUAGE.
|
|
Otherwise, Fortran build will fail.
|
|
To download the latest cmake, see https://cmake.org/download/.
|
|
2) If there is no Fortran on your system, you must install it via,
|
|
sudo apt install gfortran
|
|
|
|
II. Build
|
|
```
|
|
mkdir -p build; cd build
|
|
rm -rf *;
|
|
CXX="$(hipconfig -l)"/clang++ FC=$(which gfortran) cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
|
|
cmake ..
|
|
make
|
|
```
|
|
|
|
Note, users may need to add AMD GPU support, if test failed, for example,
|
|
```
|
|
CXX="$(hipconfig -l)"/clang++ FC=$(which gfortran) cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" ..
|
|
```
|
|
III. Test
|
|
```
|
|
./test_fortran
|
|
Succeeded testing Fortran!
|
|
|
|
./test_cpp
|
|
Device name AMD Radeon Graphics
|
|
PASSED!
|
|
```
|