This is an archive of the discontinued LLVM Phabricator instance.

[test-suite][AIX] Fix C++ benchmark compatibility issues on AIX
ClosedPublic

Authored by stevewan on Jul 7 2020, 1:14 PM.

Details

Summary

This reimplements what has been reverted in 630313d.

The old implementation applied the X/OPEN compatibility flag to the entire miniFE benchmark. This caused a build failure with mytimer.cpp due to its usages of struct timezone which is not available on AIX when the said compatibility flag is set. This new fix now also defines "UseTimes" which enables another path in the application to avoid the usages of timezone.

Event Timeline

stevewan created this revision.Jul 7 2020, 1:14 PM
stevewan edited the summary of this revision. (Show Details)Jul 7 2020, 1:15 PM
MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

Why not just append to CXXFLAGS, which already has macro defines?

stevewan marked an inline comment as done.Jul 8 2020, 11:05 AM
stevewan added inline comments.
MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

That was the original fix in D82321. Doing so applies the flag to the entire miniFE benchmark, yet one of the files in the benchmark makes use of timezone which is not available when the X/OPEN mode is specified, and therefore results in build failures.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

The breakage was identified on a non-AIX platform, and the fix now limits the change to AIX. You can continue appending to the list here.

stevewan marked an inline comment as done.Jul 8 2020, 11:35 AM
stevewan added inline comments.
MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

Unfortunately it was also an uncaught breakage on AIX.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

Does defining UseTimes and _XOPEN_SOURCE across the board for the build here work for AIX?

stevewan marked 4 inline comments as done.Jul 8 2020, 2:43 PM
stevewan added inline comments.
MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

Yes. Thanks for the suggestion, I'll update this patch.

Do you mind give a brief explanation of what the UseTimes does? I tried to look for docs but didn't find any.

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

It's one of the "configuration macros" in the application.

stevewan updated this revision to Diff 276577.Jul 8 2020, 3:16 PM
stevewan marked an inline comment as done.

Take a different path in the application to avoid using 'timezone'.

stevewan marked 2 inline comments as done.Jul 8 2020, 3:17 PM
stevewan added inline comments.
MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
5

Got it, thanks!

This revision is now accepted and ready to land.Jul 8 2020, 3:21 PM
stevewan edited the summary of this revision. (Show Details)Jul 8 2020, 3:30 PM
stevewan marked an inline comment as done.