build on riscv : g++: error : missing argument to '-march=
Hello, I will report this error when building under the riscv architecture. Is there any solution?
root@df8743386e44:/rocksdbjni/rocksdb-7.4.5# make static_lib
g++: error: missing argument to '-march='
g++: error: '-march=native': ISA string must begin with rv32 or rv64
@adamretter do you know whether people have tried RocksDB on RISC-V?
@siying Yes, I have attempted to build it on RISCV in the past. I think I was previously able to get as far as the linking stage with version v7.0.3 before I hit an issue.
I have not tried to rebuild it on RISCV for sometime as I had difficulties getting stable access to RISCV hardware, let me take a look and see...
Okay, I have been able to get access to a RISCV system again. I tried again building v7.0.3 using the command make static_lib and I saw these issues:
In file included from utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h:62,
from utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h:59,
from utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc:56:
utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h:141:2: error: #error No timer implementation for this platform
141 | #error No timer implementation for this platform
| ^~~~~
utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h: In function ‘tokutime_t toku_time_now()’:
utilities/transactions/lock/range/range_tree/lib/locktree/../portability/toku_time.h:143:1: error: no return statement in function returning non-void [-Werror=return-type]
143 | }
| ^
cc1plus: all warnings being treated as errors
make: *** [Makefile:2468: utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.o] Error 1
make: *** Waiting for unfinished jobs....
I then tried building the HEAD of the main branch (again using make static_lib) and it appeared to compile and link without any problem :-)