Hi everyone,
I am trying to compile a C++ code using riscv toolchain (riscv64-unknown-elf-g++ 13.2.0). The C++ code includes the following header files, which the compiler could not find:
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <fftw3.h>
I cloned the Eigen and fftw3 libraries from the following links:
Then, I included the full path to the required header files.
#include "/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Dense"
#include "/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Sparse"
#include "/home/riscv-gnu-toolchain/test_custom_insts/fftw3/api/fftw3.h"
However, using "riscv64-unknown-elf-g++ -std=c++17 main.cpp -o main" command, I'm getting the following errors regarding std. I would appreciate any help to fix these issues. Thank you!
In file included from /home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Core:179,
from /home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Dense:1,
from shihui.cpp:14:
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/NumTraits.h: In static member function 'static constexpr int Eigen::internal::default_digits_impl<T, false, false>::run()':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/NumTraits.h:33:16: error: 'log2' has not been declared in 'std'
33 | using std::log2;
| ^~~~
In file included from /home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Core:19:
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In static member function 'static Scalar Eigen::internal::expm1_impl<Scalar>::run(const Scalar&)':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:457:21: error: 'expm1' has not been declared in 'std'
457 | EIGEN_USING_STD(expm1);
| ^~~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/util/Macros.h:1072:42: note: in definition of macro 'EIGEN_USING_STD'
1072 | #define EIGEN_USING_STD(FUNC) using std::FUNC;
| ^~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In static member function 'static Scalar Eigen::internal::log1p_impl<Scalar>::run(const Scalar&)':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:513:21: error: 'log1p' has not been declared in 'std'
513 | EIGEN_USING_STD(log1p);
| ^~~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/util/Macros.h:1072:42: note: in definition of macro 'EIGEN_USING_STD'
1072 | #define EIGEN_USING_STD(FUNC) using std::FUNC;
| ^~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In static member function 'static Scalar Eigen::internal::nearest_integer_impl<Scalar, IsInteger>::run_rint(const Scalar&)':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:943:21: error: 'rint' has not been declared in 'std'
943 | EIGEN_USING_STD(rint) return rint(x);
| ^~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/util/Macros.h:1072:42: note: in definition of macro 'EIGEN_USING_STD'
1072 | #define EIGEN_USING_STD(FUNC) using std::FUNC;
| ^~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In static member function 'static Scalar Eigen::internal::nearest_integer_impl<Scalar, IsInteger>::run_round(const Scalar&)':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:946:21: error: 'round' has not been declared in 'std'
946 | EIGEN_USING_STD(round) return round(x);
| ^~~~~
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/util/Macros.h:1072:42: note: in definition of macro 'EIGEN_USING_STD'
1072 | #define EIGEN_USING_STD(FUNC) using std::FUNC;
| ^~~~
In file included from /home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/Core:180:
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In function 'T Eigen::numext::absdiff(const T&, const T&) [with T = long double]':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:1163:10: error: 'fabsl' was not declared in this scope; did you mean 'fabsf'?
1163 | return fabsl(x - y);
| ^~~~~
| fabsf
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h: In function 'T Eigen::numext::cbrt(const T&)':
/home/riscv-gnu-toolchain/test_custom_insts/eigen/Eigen/src/Core/MathFunctions.h:1340:19: error: 'cbrt' has not been declared in 'std'
1340 | EIGEN_USING_STD(cbrt);