Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RISC-V cross compilation #523

Merged
merged 1 commit into from
Apr 12, 2019
Merged

Support RISC-V cross compilation #523

merged 1 commit into from
Apr 12, 2019

Conversation

nhynes
Copy link
Member

@nhynes nhynes commented Apr 10, 2019

This allows TVM to build using a RISC-V GCC toolchain (https://github.com/rv8-io/musl-riscv-toolchain)

@hcho3
Copy link
Contributor

hcho3 commented Apr 10, 2019

Is using CMake an option for you?

@nhynes
Copy link
Member Author

nhynes commented Apr 10, 2019

I'm using cmake for building the TVM runtime, but plain ol' make for the C++ runtime pack, as per the guide. I'd have to override the defines in either case. This just hides multiple -Ds behind one -D.

@hcho3
Copy link
Contributor

hcho3 commented Apr 11, 2019

@nhynes If you are using CMake all the way, CMake is able to detect endianness as well as the presence of backtrace libs:

dmlc-core/CMakeLists.txt

Lines 83 to 101 in 3ffea86

# Check existence of backtrace(3)
find_package(Backtrace)
if(Backtrace_FOUND)
set(DMLC_EXECINFO_H_PRESENT 1)
set(DMLC_EXECINFO_H ${Backtrace_HEADER})
include_directories(${Backtrace_INCLUDE_DIRS})
list(APPEND dmlccore_LINKER_LIBS ${Backtrace_LIBRARIES})
else()
set(DMLC_EXECINFO_H_PRESENT 0)
endif()
# Check endianness
include(TestBigEndian)
test_big_endian(BIG_ENDIAN)
if(BIG_ENDIAN)
set(DMLC_CMAKE_LITTLE_ENDIAN 0)
else()
set(DMLC_CMAKE_LITTLE_ENDIAN 1)
endif()

The point is moot, however, since you said you have to use plain Make. I will approve this pull request.

@hcho3 hcho3 self-requested a review April 11, 2019 00:26
@szha szha merged commit 82bf4c2 into dmlc:master Apr 12, 2019
@nhynes nhynes deleted the riscv branch April 12, 2019 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants