Skip to content

Commit

Permalink
Update Readme and build options
Browse files Browse the repository at this point in the history
Fixes header include path for Bullseye, see #105 and #107
  • Loading branch information
doe300 committed Feb 9, 2022
1 parent fdcf640 commit 2bed01f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
command: git clone https://github.com/KhronosGroup/OpenCL-Headers.git OpenCL-Headers
- run:
name: configure
command: mkdir build && cd build && LDFLAGS=-Wl,--warn-unresolved-symbols cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOpenCL_INCLUDE_DIRS=../OpenCL-Headers -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DCROSS_COMPILE=ON -DBUILD_TESTING=OFF -DBCMHOST_LIBRARY=/opt/vc/lib/libbcm_host.so -DCROSS_COMPILER_PATH=${HOME}/x-tools/armv6-rpi-linux-gnueabihf/bin -DCROSS_COMPILER_PREFIX="armv6-rpi-linux-gnueabihf-" -DSYSROOT_CROSS=${HOME}/cross -DOpenCL_LIBRARY=${HOME}/cross/usr/lib -DOpenCL_INCLUDE_DIR="${HOME}/cross/usr/include"
command: mkdir build && cd build && LDFLAGS=-Wl,--warn-unresolved-symbols cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOpenCL_INCLUDE_DIRS=../OpenCL-Headers -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DCROSS_COMPILE=ON -DBUILD_TESTING=OFF -DBUILD_ICD=ON -DBCMHOST_LIBRARY=/opt/vc/lib/libbcm_host.so -DCROSS_COMPILER_PATH=${HOME}/x-tools/armv6-rpi-linux-gnueabihf/bin -DCROSS_COMPILER_PREFIX="armv6-rpi-linux-gnueabihf-" -DSYSROOT_CROSS=${HOME}/cross -DOpenCL_LIBRARY=${HOME}/cross/usr/lib -DOpenCL_INCLUDE_DIR="${HOME}/cross/usr/include"
- run:
name: build
command: cd build && make -j`nproc`
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
command: dpkg-deb -x /tmp/vc4cl-stdlib.deb / && dpkg-deb -x /tmp/vc4c.deb / && dpkg-deb -x /tmp/vc4c_testdata.deb /
- run:
name: configure
command: mkdir build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DBUILD_TESTING=ON -DINCLUDE_COMPILER=ON -DMOCK_HAL=ON
command: mkdir build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DBUILD_TESTING=ON -DBUILD_ICD=OFF -DINCLUDE_COMPILER=ON -DMOCK_HAL=ON
- run:
name: make
command: cd build && make -j`nproc`
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
command: git clone https://github.com/KhronosGroup/OpenCL-Headers.git OpenCL-Headers
- run:
name: configure
command: mkdir build && cd build && LDFLAGS=-Wl,--warn-unresolved-symbols cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOpenCL_INCLUDE_DIRS=../OpenCL-Headers -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DCROSS_COMPILE=ON -DBUILD_TESTING=OFF -DINCLUDE_COMPILER=OFF -DBCMHOST_LIBRARY=/opt/vc/lib/libbcm_host.so -DCROSS_COMPILER_PATH=${HOME}/x-tools/armv6-rpi-linux-gnueabihf/bin -DCROSS_COMPILER_PREFIX="armv6-rpi-linux-gnueabihf-" -DSYSROOT_CROSS=${HOME}/cross -DOpenCL_LIBRARY=${HOME}/cross/usr/lib -DOpenCL_INCLUDE_DIR="${HOME}/cross/usr/include"
command: mkdir build && cd build && LDFLAGS=-Wl,--warn-unresolved-symbols cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOpenCL_INCLUDE_DIRS=../OpenCL-Headers -DBUILD_NUMBER=$CIRCLE_BUILD_NUM -DCROSS_COMPILE=ON -DBUILD_TESTING=OFF -DBUILD_ICD=ON -DINCLUDE_COMPILER=OFF -DBCMHOST_LIBRARY=/opt/vc/lib/libbcm_host.so -DCROSS_COMPILER_PATH=${HOME}/x-tools/armv6-rpi-linux-gnueabihf/bin -DCROSS_COMPILER_PREFIX="armv6-rpi-linux-gnueabihf-" -DSYSROOT_CROSS=${HOME}/cross -DOpenCL_LIBRARY=${HOME}/cross/usr/lib -DOpenCL_INCLUDE_DIR="${HOME}/cross/usr/include"
- run:
name: build
command: cd build && make -j`nproc`
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include(CheckSymbolExists)
####
option(INCLUDE_COMPILER "Includes the VC4C compiler" ON)
option(BUILD_TESTING "Build testing program" OFF)
option(BUILD_ICD "Build with support for ICD" ON)
option(BUILD_ICD "Build with support for ICD" OFF)
option(IMAGE_SUPPORT "Experimental image support" OFF)
# Option to enable/disable cross compilation
option(CROSS_COMPILE "Cross compile for Raspbian" OFF)
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The GPU (which is located on the same chip as the CPU) has 12 cores, able of run
The following configuration options are available in CMake:

- `BUILD_TESTING` toggles building of test program (when configured, can be built with `make TestVC4CL`)
- `CMAKE_BUILD_TYPE` set to *Debug*, *Release*, *asan*, *tsan* or *usbsan* to build for the given debug/release mode or with sanitizers enabled
- `CMAKE_BUILD_TYPE` set to *Debug*, *Release*, *RelWithDebInfo*, *asan*, *tsan* or *usbsan* to build for the given debug/release mode or with sanitizers enabled
- `CROSS_COMPILE` toggles whether to cross-compile for the Raspberry Pi. NOTE: The [Raspberry Pi cross-compiler](https://github.com/raspberrypi/tools) is no longer supported!
- `CROSS_COMPILER_PATH` sets the root path to the Raspberry Pi cross compiler (.g. `arm-linux-gnueabihf-g++-6`)
- `INCLUDE_COMPILER` whether to include the [VC4C](https://github.com/doe300/VC4C) compiler. For the compiler to be actually included, the VC4C header and library needs to be found too
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif()

if(MOCK_HAL)
target_compile_definitions(VC4CL PRIVATE MOCK_HAL=1)
elseif(CROSS_COMPILE OR EXISTS "/opt/vc/include/bcm_host.h")
elseif(CROSS_COMPILE OR EXISTS "/opt/vc/include/bcm_host.h" OR EXISTS "/usr/include/bcm_host.h")
find_library(BCMHOST_LIBRARY NAMES bcm_host libbcm_host HINTS "/opt/vc/lib" "/usr/lib/arm-linux-gnueabihf")
find_library(VCSM_LIBRARY NAMES vcsm libvcsm HINTS "/opt/vc/lib" "/usr/lib/arm-linux-gnueabihf")
target_link_libraries(VC4CL ${BCMHOST_LIBRARY} ${VCSM_LIBRARY} ${SYSROOT_LIBRARY_FLAGS})
Expand Down
2 changes: 1 addition & 1 deletion test/TestProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void TestProgram::checkBuildStatus(const cl_program program)
state = VC4CL_FUNC(clGetProgramBuildInfo)(program, Platform::getVC4CLPlatform().VideoCoreIVGPU.toBase(),
CL_PROGRAM_BUILD_LOG, log.size(), log.data(), nullptr);
std::cerr << "Build log: " << log.data() << std::endl;
TEST_ASSERT_EQUALS(CL_BUILD_SUCCESS, status)
}
TEST_ASSERT_EQUALS(CL_SUCCESS, state)
}

bool TestProgram::setup()
Expand Down

0 comments on commit 2bed01f

Please sign in to comment.