Page MenuHomePhabricator

[test-suite] SPEC2017 CPU CactuBSSN floating point tests.
ClosedPublic

Authored by naromero77 on Jan 28 2021, 10:39 AM.

Diff Detail

Repository
rT test-suite

Event Timeline

naromero77 created this revision.Jan 28 2021, 10:39 AM
naromero77 requested review of this revision.Jan 28 2021, 10:39 AM

Is someone available to review this patch?

Meinersbur added inline comments.Feb 1 2021, 6:06 PM
External/SPEC/CFP2017rate/507.cactuBSSN_r/CMakeLists.txt
14–49

I would like to suggest a different approach:

add_definitions($<$<COMPILE_LANGUAGE:Fortran>:FCODE>)
add_definitions($<$<COMPILE_LANGUAGE:C>:CCODE>)
add_definitions($<$<COMPILE_LANGUAGE:CXX>:CCODE CCTK_DISABLE_RESTRICT=1>)
set_property(TARGET ${PROG} PROPERTY C_STANDARD 11)

or

set(CMAKE_C_STANDARD 11)

(the last one sets the default for all upcoming targets; however, it is also a global variable but should only be changed within this add_subdirectory scope -- I think). At least the -std=c99 flag is something the cmake should determine.

Meinersbur added inline comments.Feb 1 2021, 6:11 PM
External/SPEC/CFP2017rate/507.cactuBSSN_r/CMakeLists.txt
14–49

add_compile_definitions should be preferred over add_definitions

  • Use cleaner and more modern CMake.

With respect to origin/main.

Meinersbur accepted this revision.Feb 3 2021, 7:07 PM

LGTM

External/SPEC/CFP2017rate/507.cactuBSSN_r/CMakeLists.txt
51–53

test-suite style usually defines compilation/linking options before adding the target (e.g. by setting LDFALGS, CFLAGS, CXXCLAGS), add_compile_definitions would be more consistent than target_compile_definitions.

But I also don't think its important.

This revision is now accepted and ready to land.Feb 3 2021, 7:07 PM
naromero77 added inline comments.Feb 3 2021, 8:25 PM
External/SPEC/CFP2017rate/507.cactuBSSN_r/CMakeLists.txt
51–53

At first I tried using add_compile_definitions, but the the generator expression was not being expanded correctly. It was being partially merged with the absolute path to the object file. I spent several hours trying to debug this but had no success:

I then found this recommendation:
https://stackoverflow.com/questions/55536140/defining-preprocessor-in-modern-cmake

and went with target_compile_definitions instead.

I see. Maybe it's worth reporting as a cmake bug?