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

Using Eigen/Sparse #21

Closed
mhsamavatian opened this issue Mar 22, 2019 · 2 comments
Closed

Using Eigen/Sparse #21

mhsamavatian opened this issue Mar 22, 2019 · 2 comments

Comments

@mhsamavatian
Copy link

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

@ftramer
Copy link
Owner

ftramer commented Mar 24, 2019

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".

@Karssadin
Copy link

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.

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

No branches or pull requests

3 participants