[test-suite] r302960 - cmake: Refactor SPEC CMakefiles

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 15:15:58 PDT 2017


Author: matze
Date: Fri May 12 17:15:57 2017
New Revision: 302960

URL: http://llvm.org/viewvc/llvm-project?rev=302960&view=rev
Log:
cmake: Refactor SPEC CMakefiles

Move common macros/adjustments from External/SPEC/CMakeLists.txt into
SpecCPUXXX.cmake this allows to use
 TEST_SUITE_SUBDIRS=External/SPEC/CINT2000
which would otherwise lack the macrso from External/SPEC/CMakeLists.txt

Added:
    test-suite/trunk/External/SPEC/SpecCPU2000.cmake
    test-suite/trunk/External/SPEC/SpecCPU2006.cmake
    test-suite/trunk/External/SPEC/SpecCPU95.cmake
Modified:
    test-suite/trunk/External/SPEC/CFP2000/CMakeLists.txt
    test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt
    test-suite/trunk/External/SPEC/CINT2000/CMakeLists.txt
    test-suite/trunk/External/SPEC/CINT2006/CMakeLists.txt
    test-suite/trunk/External/SPEC/CINT95/CMakeLists.txt
    test-suite/trunk/External/SPEC/CMakeLists.txt

Modified: test-suite/trunk/External/SPEC/CFP2000/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2000/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2000/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CFP2000/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,17 +1,16 @@
-list(APPEND LDFLAGS -lm)
-list(APPEND CPPFLAGS -DSPEC_CPU2000)
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  list(APPEND CPPFLAGS -DSPEC_CPU2000_LP64)
-endif()
+include(${CMAKE_SOURCE_DIR}/External/SPEC/SpecCPU2000.cmake)
+if(TEST_SUITE_SPEC2000_ROOT)
+  list(APPEND LDFLAGS -lm)
 
-macro(cfp2000_subdir BENCHMARK)
-  set(BENCHMARK_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CFP2000/${BENCHMARK})
-  set(PROG ${BENCHMARK})
-  file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
-  add_subdirectory(${BENCHMARK})
-endmacro()
+  macro(cfp2000_subdir BENCHMARK)
+    set(BENCHMARK_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CFP2000/${BENCHMARK})
+    set(PROG ${BENCHMARK})
+    file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
+    add_subdirectory(${BENCHMARK})
+  endmacro()
 
-cfp2000_subdir(177.mesa)
-cfp2000_subdir(179.art)
-cfp2000_subdir(183.equake)
-cfp2000_subdir(188.ammp)
+  cfp2000_subdir(177.mesa)
+  cfp2000_subdir(179.art)
+  cfp2000_subdir(183.equake)
+  cfp2000_subdir(188.ammp)
+endif()

Modified: test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CFP2006/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,42 +1,10 @@
-list(APPEND CPPFLAGS -DSPEC_CPU)
-
-if(TARGET_OS STREQUAL "Darwin")
-  list(APPEND CPPFLAGS -DSPEC_CPU_MACOSX)
-elseif(TARGET_OS STREQUAL "Linux")
-  list(APPEND CPPFLAGS -DSPEC_CPU_LINUX)
+include(${CMAKE_SOURCE_DIR}/External/SPEC/SpecCPU2006.cmake)
+if(TEST_SUITE_SPEC2006_ROOT)
+  cpu2006_subdir(433.milc)
+  cpu2006_subdir(444.namd)
+  cpu2006_subdir(447.dealII)
+  cpu2006_subdir(450.soplex)
+  cpu2006_subdir(453.povray)
+  cpu2006_subdir(470.lbm)
+  cpu2006_subdir(482.sphinx3)
 endif()
-
-if(ARCH STREQUAL "x86")
-  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND CPPFLAGS -DSPEC_CPU_X64)
-  else()
-    list(APPEND CPPFLAGS -DSPEC_CPU_IA32)
-  endif()
-endif()
-
-include(TestBigEndian)
-test_big_endian(IS_BIGENDIAN)
-if(IS_BIGENDIAN)
-  list(APPEND CPPFLAGS -DSPEC_CPU_BIGENDIAN)
-else()
-  list(APPEND CPPFLAGS -DSPEC_CPU_LITTLEENDIAN)
-endif()
-
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  list(APPEND CPPFLAGS -DSPEC_CPU_LP64)
-endif()
-
-macro(cpu2006_subdir BENCHMARK)
-  set(BENCHMARK_DIR ${TEST_SUITE_SPEC2006_ROOT}/benchspec/CPU2006/${BENCHMARK})
-  set(PROG ${BENCHMARK})
-  file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp ${BENCHMARK_DIR}/src/*.cc)
-  add_subdirectory(${BENCHMARK})
-endmacro()
-
-cpu2006_subdir(433.milc)
-cpu2006_subdir(444.namd)
-cpu2006_subdir(447.dealII)
-cpu2006_subdir(450.soplex)
-cpu2006_subdir(453.povray)
-cpu2006_subdir(470.lbm)
-cpu2006_subdir(482.sphinx3)

Modified: test-suite/trunk/External/SPEC/CINT2000/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2000/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT2000/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT2000/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,24 +1,22 @@
-list(APPEND CPPFLAGS -DSPEC_CPU2000)
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  list(APPEND CPPFLAGS -DSPEC_CPU2000_LP64)
-endif()
-
-macro(cint2000_subdir BENCHMARK)
-  set(BENCHMARK_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CINT2000/${BENCHMARK})
-  set(PROG ${BENCHMARK})
-  file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
-  add_subdirectory(${BENCHMARK})
-endmacro()
+include(${CMAKE_SOURCE_DIR}/External/SPEC/SpecCPU2000.cmake)
+if(TEST_SUITE_SPEC2000_ROOT)
+  macro(cint2000_subdir BENCHMARK)
+    set(BENCHMARK_DIR ${TEST_SUITE_SPEC2000_ROOT}/benchspec/CINT2000/${BENCHMARK})
+    set(PROG ${BENCHMARK})
+    file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
+    add_subdirectory(${BENCHMARK})
+  endmacro()
 
-cint2000_subdir(164.gzip)
-cint2000_subdir(175.vpr)
-cint2000_subdir(176.gcc)
-cint2000_subdir(181.mcf)
-cint2000_subdir(186.crafty)
-cint2000_subdir(197.parser)
-cint2000_subdir(252.eon)
-cint2000_subdir(253.perlbmk)
-cint2000_subdir(254.gap)
-cint2000_subdir(255.vortex)
-cint2000_subdir(256.bzip2)
-cint2000_subdir(300.twolf)
+  cint2000_subdir(164.gzip)
+  cint2000_subdir(175.vpr)
+  cint2000_subdir(176.gcc)
+  cint2000_subdir(181.mcf)
+  cint2000_subdir(186.crafty)
+  cint2000_subdir(197.parser)
+  cint2000_subdir(252.eon)
+  cint2000_subdir(253.perlbmk)
+  cint2000_subdir(254.gap)
+  cint2000_subdir(255.vortex)
+  cint2000_subdir(256.bzip2)
+  cint2000_subdir(300.twolf)
+endif()

Modified: test-suite/trunk/External/SPEC/CINT2006/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2006/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT2006/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT2006/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,47 +1,15 @@
-list(APPEND CPPFLAGS -DSPEC_CPU)
-
-if(TARGET_OS STREQUAL "Darwin")
-  list(APPEND CPPFLAGS -DSPEC_CPU_MACOSX)
-elseif(TARGET_OS STREQUAL "Linux")
-  list(APPEND CPPFLAGS -DSPEC_CPU_LINUX)
+include(${CMAKE_SOURCE_DIR}/External/SPEC/SpecCPU2006.cmake)
+if(TEST_SUITE_SPEC2006_ROOT)
+  cpu2006_subdir(400.perlbench)
+  cpu2006_subdir(401.bzip2)
+  cpu2006_subdir(403.gcc)
+  cpu2006_subdir(429.mcf)
+  cpu2006_subdir(445.gobmk)
+  cpu2006_subdir(456.hmmer)
+  cpu2006_subdir(458.sjeng)
+  cpu2006_subdir(462.libquantum)
+  cpu2006_subdir(464.h264ref)
+  cpu2006_subdir(471.omnetpp)
+  cpu2006_subdir(473.astar)
+  cpu2006_subdir(483.xalancbmk)
 endif()
-
-if(ARCH STREQUAL "x86")
-  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND CPPFLAGS -DSPEC_CPU_X64)
-  else()
-    list(APPEND CPPFLAGS -DSPEC_CPU_IA32)
-  endif()
-endif()
-
-include(TestBigEndian)
-test_big_endian(IS_BIGENDIAN)
-if(IS_BIGENDIAN)
-  list(APPEND CPPFLAGS -DSPEC_CPU_BIGENDIAN)
-else()
-  list(APPEND CPPFLAGS -DSPEC_CPU_LITTLEENDIAN)
-endif()
-
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-  list(APPEND CPPFLAGS -DSPEC_CPU_LP64)
-endif()
-
-macro(cpu2006_subdir BENCHMARK)
-  set(BENCHMARK_DIR ${TEST_SUITE_SPEC2006_ROOT}/benchspec/CPU2006/${BENCHMARK})
-  set(PROG ${BENCHMARK})
-  file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
-  add_subdirectory(${BENCHMARK})
-endmacro()
-
-cpu2006_subdir(400.perlbench)
-cpu2006_subdir(401.bzip2)
-cpu2006_subdir(403.gcc)
-cpu2006_subdir(429.mcf)
-cpu2006_subdir(445.gobmk)
-cpu2006_subdir(456.hmmer)
-cpu2006_subdir(458.sjeng)
-cpu2006_subdir(462.libquantum)
-cpu2006_subdir(464.h264ref)
-cpu2006_subdir(471.omnetpp)
-cpu2006_subdir(473.astar)
-cpu2006_subdir(483.xalancbmk)

Modified: test-suite/trunk/External/SPEC/CINT95/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT95/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT95/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT95/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,17 +1,11 @@
-list(APPEND CPPFLAGS -DSPEC_CPU95)
-
-macro(cint95_subdir BENCHMARK)
-  set(BENCHMARK_DIR ${TEST_SUITE_SPEC95_ROOT}/benchspec/CINT95/${BENCHMARK})
-  set(PROG ${BENCHMARK})
-  file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
-  add_subdirectory(${BENCHMARK})
-endmacro()
-
-cint95_subdir(099.go)
-cint95_subdir(124.m88ksim)
-#cint95_subdir(126.gcc)  # uses nonstandard lvalue casts (without clang support)
-cint95_subdir(129.compress)
-cint95_subdir(130.li)
-cint95_subdir(132.ijpeg)
-cint95_subdir(134.perl)
-cint95_subdir(147.vortex)
+include(${CMAKE_SOURCE_DIR}/External/SPEC/SpecCPU95.cmake)
+if(TEST_SUITE_SPEC95_ROOT)
+  cint95_subdir(099.go)
+  cint95_subdir(124.m88ksim)
+  #cint95_subdir(126.gcc)  # uses nonstandard lvalue casts (without clang support)
+  cint95_subdir(129.compress)
+  cint95_subdir(130.li)
+  cint95_subdir(132.ijpeg)
+  cint95_subdir(134.perl)
+  cint95_subdir(147.vortex)
+endif()

Modified: test-suite/trunk/External/SPEC/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CMakeLists.txt?rev=302960&r1=302959&r2=302960&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CMakeLists.txt Fri May 12 17:15:57 2017
@@ -1,42 +1,5 @@
-if(TARGET_OS STREQUAL "Darwin")
-  # Work around built in -Werror=implicit-function-declaration default on iOS
-  list(APPEND CPPFLAGS -Wno-implicit-function-declaration)
-endif()
-
-# SPEC supports three "run types": ref, train and test
-if(NOT TEST_SUITE_RUN_TYPE STREQUAL "train" AND
-   NOT TEST_SUITE_RUN_TYPE STREQUAL "test" AND
-   NOT TEST_SUITE_RUN_TYPE STREQUAL "ref")
-  message(FATAL_ERROR
-          "TEST_SUITE_RUN_TYPE must be 'train', 'test' or 'ref' for SPEC")
-endif()
-
-llvm_externals_find(TEST_SUITE_SPEC95_ROOT "spec95" "SPEC CPU95")
-if(TEST_SUITE_SPEC95_ROOT)
-  add_subdirectory(CINT95)
-  # Note that all CFP95 tests are fortran so not supported by cmake/lit yet
-endif()
-
-llvm_externals_find(TEST_SUITE_SPEC2000_ROOT "speccpu2000" "SPEC CPU2000")
-if(TEST_SUITE_SPEC2000_ROOT)
-  file(READ ${TEST_SUITE_SPEC2000_ROOT}/version VERSION)
-  if (VERSION VERSION_LESS 1.3)
-    message(WARNING "
-    Expected SPEC2000 version 1.3 or newer, found ${VERSION}
-")
-  endif()
-  add_subdirectory(CFP2000)
-  add_subdirectory(CINT2000)
-endif()
-
-llvm_externals_find(TEST_SUITE_SPEC2006_ROOT "speccpu2006" "SPEC CPU2006")
-if(TEST_SUITE_SPEC2006_ROOT)
-  file(READ ${TEST_SUITE_SPEC2006_ROOT}/version.txt VERSION)
-  if (VERSION VERSION_LESS 1.2)
-    message(WARNING "
-    Expected SPEC2006 version 1.2 or newer, found ${VERSION}
-")
-  endif()
-  add_subdirectory(CINT2006)
-  add_subdirectory(CFP2006)
-endif()
+add_subdirectory(CINT95)
+add_subdirectory(CINT2000)
+add_subdirectory(CFP2000)
+add_subdirectory(CINT2006)
+add_subdirectory(CFP2006)

Added: test-suite/trunk/External/SPEC/SpecCPU2000.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/SpecCPU2000.cmake?rev=302960&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/SpecCPU2000.cmake (added)
+++ test-suite/trunk/External/SPEC/SpecCPU2000.cmake Fri May 12 17:15:57 2017
@@ -0,0 +1,28 @@
+include(External)
+llvm_externals_find(TEST_SUITE_SPEC2000_ROOT "speccpu2000" "SPEC CPU2000")
+if(TEST_SUITE_SPEC2000_ROOT)
+  # SPEC supports three "run types": ref, train and test
+  if(NOT TEST_SUITE_RUN_TYPE STREQUAL "train" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "test" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "ref")
+    message(FATAL_ERROR
+            "TEST_SUITE_RUN_TYPE must be 'train', 'test' or 'ref' for SPEC")
+  endif()
+
+  file(READ ${TEST_SUITE_SPEC2000_ROOT}/version VERSION)
+  if (VERSION VERSION_LESS 1.3)
+    message(WARNING "
+    Expected SPEC2000 version 1.3 or newer, found ${VERSION}
+")
+  endif()
+
+  list(APPEND CPPFLAGS -DSPEC_CPU2000)
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    list(APPEND CPPFLAGS -DSPEC_CPU2000_LP64)
+  endif()
+
+  if(TARGET_OS STREQUAL "Darwin")
+    # Work around built in -Werror=implicit-function-declaration default on iOS
+    list(APPEND CPPFLAGS -Wno-implicit-function-declaration)
+  endif()
+endif()

Added: test-suite/trunk/External/SPEC/SpecCPU2006.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/SpecCPU2006.cmake?rev=302960&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/SpecCPU2006.cmake (added)
+++ test-suite/trunk/External/SPEC/SpecCPU2006.cmake Fri May 12 17:15:57 2017
@@ -0,0 +1,58 @@
+include(External)
+llvm_externals_find(TEST_SUITE_SPEC2006_ROOT "speccpu2006" "SPEC CPU2006")
+if(TEST_SUITE_SPEC2006_ROOT)
+  # SPEC supports three "run types": ref, train and test
+  if(NOT TEST_SUITE_RUN_TYPE STREQUAL "train" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "test" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "ref")
+    message(FATAL_ERROR
+            "TEST_SUITE_RUN_TYPE must be 'train', 'test' or 'ref' for SPEC")
+  endif()
+
+  file(READ ${TEST_SUITE_SPEC2006_ROOT}/version.txt VERSION)
+  if (VERSION VERSION_LESS 1.2)
+    message(WARNING "
+    Expected SPEC2006 version 1.2 or newer, found ${VERSION}
+")
+  endif()
+
+  list(APPEND CPPFLAGS -DSPEC_CPU)
+
+  if(TARGET_OS STREQUAL "Darwin")
+    list(APPEND CPPFLAGS -DSPEC_CPU_MACOSX)
+  elseif(TARGET_OS STREQUAL "Linux")
+    list(APPEND CPPFLAGS -DSPEC_CPU_LINUX)
+  endif()
+
+  if(ARCH STREQUAL "x86")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+      list(APPEND CPPFLAGS -DSPEC_CPU_X64)
+    else()
+      list(APPEND CPPFLAGS -DSPEC_CPU_IA32)
+    endif()
+  endif()
+
+  include(TestBigEndian)
+  test_big_endian(IS_BIGENDIAN)
+  if(IS_BIGENDIAN)
+    list(APPEND CPPFLAGS -DSPEC_CPU_BIGENDIAN)
+  else()
+    list(APPEND CPPFLAGS -DSPEC_CPU_LITTLEENDIAN)
+  endif()
+
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    list(APPEND CPPFLAGS -DSPEC_CPU_LP64)
+  endif()
+
+  if(TARGET_OS STREQUAL "Darwin")
+    # Work around built in -Werror=implicit-function-declaration default on iOS
+    list(APPEND CPPFLAGS -Wno-implicit-function-declaration)
+  endif()
+
+  macro(cpu2006_subdir BENCHMARK)
+    set(BENCHMARK_DIR ${TEST_SUITE_SPEC2006_ROOT}/benchspec/CPU2006/${BENCHMARK})
+    set(PROG ${BENCHMARK})
+    file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp ${BENCHMARK_DIR}/src/*.cc)
+    add_subdirectory(${BENCHMARK})
+  endmacro()
+endif()

Added: test-suite/trunk/External/SPEC/SpecCPU95.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/SpecCPU95.cmake?rev=302960&view=auto
==============================================================================
--- test-suite/trunk/External/SPEC/SpecCPU95.cmake (added)
+++ test-suite/trunk/External/SPEC/SpecCPU95.cmake Fri May 12 17:15:57 2017
@@ -0,0 +1,25 @@
+include(External)
+llvm_externals_find(TEST_SUITE_SPEC95_ROOT "spec95" "SPEC CPU95")
+if(TEST_SUITE_SPEC95_ROOT)
+  # SPEC supports three "run types": ref, train and test
+  if(NOT TEST_SUITE_RUN_TYPE STREQUAL "train" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "test" AND
+     NOT TEST_SUITE_RUN_TYPE STREQUAL "ref")
+    message(FATAL_ERROR
+            "TEST_SUITE_RUN_TYPE must be 'train', 'test' or 'ref' for SPEC")
+  endif()
+
+  list(APPEND CPPFLAGS -DSPEC_CPU95)
+
+  if(TARGET_OS STREQUAL "Darwin")
+    # Work around built in -Werror=implicit-function-declaration default on iOS
+    list(APPEND CPPFLAGS -Wno-implicit-function-declaration)
+  endif()
+
+  macro(cint95_subdir BENCHMARK)
+    set(BENCHMARK_DIR ${TEST_SUITE_SPEC95_ROOT}/benchspec/CINT95/${BENCHMARK})
+    set(PROG ${BENCHMARK})
+    file(GLOB Source ${BENCHMARK_DIR}/src/*.c ${BENCHMARK_DIR}/src/*.cpp)
+    add_subdirectory(${BENCHMARK})
+  endmacro()
+endif()




More information about the llvm-commits mailing list