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

Error while running examples #186

Closed
hdk0102 opened this issue Jul 3, 2020 · 2 comments
Closed

Error while running examples #186

hdk0102 opened this issue Jul 3, 2020 · 2 comments

Comments

@hdk0102
Copy link

hdk0102 commented Jul 3, 2020

Hello,

It seems like I have successfully built SEAL, through cmake . and make, since I see the following.

[ 98%] Built target seal_obj
Scanning dependencies of target seal
[100%] Linking CXX static library lib/libseal-3.5.a
**[100%] Built target seal**

Then I did sudo make install and it seemed to work fine as well.

But when I tried to run an example cpp file (native/examples/4_ckks_basics.cpp) via following command,

gcc 4_ckks_basics.cpp -o test.out

I receive the following error:

4_ckks_basics.cpp:4:10: fatal error: 'seal/seal.h' file not found
#include "seal/seal.h"
         ^~~~~~~~~~~~~
1 error generated.

Now I look into my SEAL folder, I realize I don't have seal.h file.

Does anyone know why?

Thanks everyone !!!

Best,
DK

@kimlaine
Copy link
Contributor

kimlaine commented Jul 5, 2020

There are multiple problems with what you are trying to do:

  • The examples cannot be built independently: 4_ckks_basics.cpp has no main function.
  • You are not telling the compiler where SEAL header files are; this is what it's complaining about. You are also not telling the linker where libseal-3.5.a is. You'll need to set some compiler flags for this.
  • If you built SEAL using C++17, you would also need to pass -std=c++17 to the compiler.

The right way to fix these issues is building the examples along with SEAL:

cmake . -DSEAL_BUILD_EXAMPLES=ON
make -j

The examples executable will be bin/sealexamples. See README.md for more details.

@hdk0102
Copy link
Author

hdk0102 commented Jul 7, 2020

Hi Kim,

Thanks so much! Following your comment, I could successfully run the examples.
Thank you again, Kim!

Best,
DK

@hdk0102 hdk0102 closed this as completed Jul 7, 2020
@hdk0102 hdk0102 changed the title Error while building Error while running examples Jul 7, 2020
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

2 participants