UoB-HPC / cloverleaf_sycl

Other
4 stars 1 forks source link

CXX_EXTRA_FLAGS does not support passing multiple flags #4

Open andreipoe opened 4 years ago

andreipoe commented 4 years ago

Building fails when CXX_EXTRA_FLAGS contains more than one flag:

cmake -Btest -H. -DCMAKE_BUILD_TYPE=Release -DSYCL_RUNTIME=HIPSYCL -DCXX_EXTRA_FLAGS='-march=armv8.3-a+sve -ffp-contract=fast'
cmake --build test --target clover_leaf --config Release -j 1 -v

The flags aren't properly passed to the compiler (full paths removed for clarity):

...
[  3%] Building SYCL object CMakeFiles/clover_leaf.dir/src/accelerate.cpp.o
syclcc-clang  -I... -W...  -O3 "-march=armv8.3-a+sve -ffp-contract=fast" -pthread -o ...
cc1plus: error: invalid feature modifier in ‘-march=armv8.3-a+sve -ffp-contract=fast’

Setting a single flag, e.g. -DCXX_EXTRA_FLAGS=-march=armv8.3-a+sve, works correctly.