Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubangoTelecom committed Oct 23, 2020
1 parent 3bbed18 commit 16d5514
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmakegen_jetson_arm64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
REM sudo apt-get update
REM sudo apt-get install gcc-aarch64-linux-gnu
REM sudo apt install g++-aarch64-linux-gnu

mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLIB_BUILD_TYPE=STATIC -DCMAKE_VERBOSE_MAKEFILE=on -DTOOLCHAIN_CROSS_TRIPLET="aarch64-linux-gnu" -DCMAKE_TOOLCHAIN_FILE:PATH="../compv/jetson.arm64.toolchain.cmake"
cd ..

@echo off
REM to build: cd build && make
REM If you're using a Windows machine without "make" command then using the one under %TOOLCHAIN_ARM64%/bin/make
12 changes: 12 additions & 0 deletions cmakegen_linux_arm64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
REM sudo apt-get update
REM sudo apt-get install gcc-aarch64-linux-gnu
REM sudo apt install g++-aarch64-linux-gnu

mkdir build
cd build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLIB_BUILD_TYPE=STATIC -DCMAKE_VERBOSE_MAKEFILE=on -DTOOLCHAIN_CROSS_TRIPLET="aarch64-linux-gnu" -DCMAKE_TOOLCHAIN_FILE:PATH="../compv/linux.arm64.toolchain.cmake"
cd ..

@echo off
REM to build: cd build && make
REM If you're using a Windows machine without "make" command then using the one under %TOOLCHAIN_ARM64%/bin/make
5 changes: 5 additions & 0 deletions common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ if ("${TARGET_OS}" MATCHES "PI")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMPV_OS_PI=1 -mfpu=neon-vfpv4 -funsafe-math-optimizations")
endif ()

# NVIDIA Jetson
if ("${TARGET_OS}" MATCHES "JETSON")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMPV_OS_JETSON=1")
endif ()

# ARM64 cross compilation
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ARM_NEON__ -ftree-vectorize -funsafe-math-optimizations -march=armv8-a")
Expand Down
4 changes: 4 additions & 0 deletions jetson.arm64.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include(linux.arm64.toolchain.cmake)

set (CROSSCOMPILING_TARGET_OS "JETSON")
set (TARGET_OS "JETSON")

0 comments on commit 16d5514

Please sign in to comment.