Using Eigen/Sparse
mhsamavatian opened this issue · 2 comments
I was trying to add #include <Eigen/Sparse> in sgxdnn_main.cpp or .hpp (or layers/conv2D.hpp) but I get some errors when I make the main Makefile in the root directory (slalom).
Errors are:
Include/eigen3_sgx/Eigen/src/SparseCore/SparseMatrixBase.h:213:17: error: ‘ostream’ in namespace ‘std’ does not name a type
friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m)
^
In file included from Include/eigen3_sgx/Eigen/SparseCore:42:0,
from Include/eigen3_sgx/Eigen/Sparse:26,
from SGXDNN/sgxdnn_main.hpp:6,
from Enclave/sgxdnn.cpp:3:
Include/eigen3_sgx/Eigen/src/SparseCore/SparseMatrix.h:788:17: error: ‘ostream’ in namespace ‘std’ does not name a type
friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m)
^
In file included from Include/eigen3_sgx/Eigen/SparseCore:45:0,
from Include/eigen3_sgx/Eigen/Sparse:26,
from SGXDNN/sgxdnn_main.hpp:6,
from Enclave/sgxdnn.cpp:3:
Include/eigen3_sgx/Eigen/src/SparseCore/SparseVector.h:332:17: error: ‘ostream’ in namespace ‘std’ does not name a type
friend std::ostream & operator << (std::ostream & s, const SparseVector& m)
^
In file included from Include/eigen3_sgx/Eigen/SparseLU:44:0,
from Include/eigen3_sgx/Eigen/Sparse:31,
from SGXDNN/sgxdnn_main.hpp:6,
from Enclave/sgxdnn.cpp:3:
Include/eigen3_sgx/Eigen/src/SparseLU/SparseLU.h: In member function ‘void Eigen::SparseLU<_MatrixType, _OrderingType>::factorize(const MatrixType&)’:
Include/eigen3_sgx/Eigen/src/SparseLU/SparseLU.h:661:9: error: ‘ostringstream’ is not a member of ‘std’
std::ostringstream returnInfo;
^
Include/eigen3_sgx/Eigen/src/SparseLU/SparseLU.h:662:9: error: ‘returnInfo’ was not declared in this scope
returnInfo << info;
^
Makefile:228: recipe for target 'Enclave/sgxdnn.o' failed
make: *** [Enclave/sgxdnn.o] Error 1
I do not see the error when I make only SGXDNN in SGXDNN folder.
any suggestion?
Thanks
If you're compiling for SGX, then "std::ostream" won't be defined. This is because "ostream" requires a call to the operating system, which is prohibited in SGX. You'd have to rewrite parts of Eigen/sparse to remove any uses of "ostream".
any suggestion? Thanks
Hello, have you solved the problem yet? I also want to use eigen in SGX and have the same problem as you.