Codebase list libcorkipset / 49e2bbb
Support the Tilera platform This patch provides build and test script updates for the Tilera platform. The cmake scripts autodetect if you are configuring on a system with a Tilera MDE installed, so you can use the normal `cmake` command in a build directory with standard cmake options. Note that we turn off building the documentation on Tilera, even if Sphinx is installed. The major modification to our standard workflow is testing: replace `make test` with `./tile-test`. This assumes there is a working connection to a Tilera device. Installation requires sudo access, i.e., `sudo make install`. If you intend to use these files regularly, then you should use an installation prefix that includes `$TILERA_ROOT/tile`. One good example is `$TILERA_ROOT/tile/usr/local`, but you can use any directory you want that is supported by the various `tile-monitor` upload and mount options. John Zachary 11 years ago
4 changed file(s) with 67 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2727
2828 string(REGEX REPLACE "-dev.*" "-dev" BASE_VERSION "${VERSION}")
2929
30 find_package(PkgConfig)
31
32 #-----------------------------------------------------------------------
33 # Check for building on Tilera
34 # If the Tilera environment is installed, then $TILERA_ROOT is defined
35 # as the path to the active MDE.
36
37 if(DEFINED ENV{TILERA_ROOT})
38 set(TILERA TRUE)
39 set(TILERA_ROOT $ENV{TILERA_ROOT})
40 message("-- Configuring for Tilera MDE ${TILERA_ROOT}")
41 set(ENV{PKG_CONFIG_PATH}
42 "${TILERA_ROOT}/tile/usr/lib/pkgconfig:${TILERA_ROOT}/tile/usr/local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}"
43 )
44 set(CMAKE_SYSTEM_NAME "Tilera")
45 set(CMAKE_SYSTEM_PROCESSOR "tilegx")
46 set(CMAKE_C_COMPILER "${TILERA_ROOT}/bin/tile-gcc")
47 set(CMAKE_LINKER "${TILERA_ROOT}/bin/tile-ld")
48 set(TILERA_MONITOR "${TILERA_ROOT}/bin/tile-monitor")
49 #add_definitions(-std=gnu99)
50 set(CMAKE_FIND_ROOT_PATH "${TILERA_ROOT}/tile")
51 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
52 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
53 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
54 endif()
55
3056 #-----------------------------------------------------------------------
3157 # Check for prerequisite libraries
32
33 find_package(PkgConfig)
3458
3559 pkg_check_modules(CORK REQUIRED libcork)
3660 include_directories(${CORK_INCLUDE_DIRS})
1515 )
1616
1717 set(GENERATE_DOC TRUE)
18
19 if (TILERA)
20 message(STATUS "Note: We don't build documentation on the Tilera platform")
21 set(GENERATE_DOC FALSE)
22 endif (TILERA)
1823
1924 if (NOT SPHINX_EXECUTABLE)
2025 message(WARNING "Unable to find Sphinx documentation generator")
3333 #-----------------------------------------------------------------------
3434 # Command-line tests
3535
36 if(TILERA)
37 configure_file(tile-test ${CMAKE_BINARY_DIR}/tile-test COPYONLY)
38 endif(TILERA)
39
3640 find_program(
3741 CRAM_EXECUTABLE
3842 NAMES cram
0 #!/usr/bin/env bash
1
2 if [ ! -x $TILERA_ROOT/bin/tile-monitor ]; then
3 # If no tile-monitor is installed, then there is nothing to test.
4 echo "No tile-monitor installed in $TILERA_ROOT/bin"
5 exit 1
6 fi
7
8 export TEST_DIR="/tmp/test"
9 export TILERA_COMMON_ARGS=" \
10 --debug-on-crash \
11 --mkdir $TEST_DIR/build \
12 --mkdir $TEST_DIR/tests \
13 --tile standard \
14 --mount-tile /usr \
15 --mount-tile /lib \
16 --upload . $TEST_DIR/build \
17 --upload ../tests $TEST_DIR/tests \
18 --env LD_LIBRARY_PATH="$TEST_DIR/build/src:/usr/local/lib:/usr/lib:/lib" \
19 --env PATH="/usr/local/bin:$PATH" \
20 --cd $TEST_DIR/build \
21 --run -+- ctest -+- --quit"
22
23 export TILERA_DEV_ARGS="--resume $TILERA_COMMON_ARGS"
24 $TILERA_ROOT/bin/tile-monitor $TILERA_DEV_ARGS
25
26 ## Uncomment the following four lines and comment the previous two if
27 ## you want to run the tests on the Tilera simulator.
28 #export SIM_IMAGE_SIZE="4x4"
29 #export TILERA_SIM_ARGS=" \
30 # --image $SIM_IMAGE_SIZE $TILERA_COMMON_ARGS --functional"
31 #$TILERA_ROOT/bin/tile-monitor $TILERA_SIM_ARGS