Fail to make when building my own app

I follow the guide of document for building my application.
I paste the CKKS example from OpenFHE, copy the “CMakeLists.User.txt” to the my folder and rename it.
But when make, I meet a strenge error

(base) lance@407350:~/fhe_example/build# make
[ 50%] Building CXX object CMakeFiles/test.dir/ckks_example.cpp.o
c++: error: unrecognized command line option ‘-fopenmp=libomp’; did you mean ‘-fopenmp-simd’?
c++: error: unrecognized command line option ‘-fopenmp=libomp’; did you mean ‘-fopenmp-simd’?
make[2]: *** [CMakeFiles/test.dir/build.make:63: CMakeFiles/test.dir/ckks_example.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

system list:

OpenFHE 1.0
Platform Ubuntu 20.0
Compiler Clang 10.0

Hi!

Are you able to run the examples from the openfhe repo?

I run this with openfhe

(base) lance@407350:~/openfhe-development/build# bin/examples/pke/simple-integers
Plaintext #1: ( 1 2 3 4 5 6 7 8 9 10 11 12 ... )
Plaintext #2: ( 3 2 1 4 5 6 7 8 9 10 11 12 ... )
Plaintext #3: ( 1 2 5 2 5 6 7 8 9 10 11 12 ... )

Results of homomorphic computations
#1 + #2 + #3: ( 5 6 9 10 15 18 21 24 27 30 33 36 ... )
#1 * #2 * #3: ( 3 8 15 32 125 216 343 512 729 1000 1331 1728 ... )
Left rotation of #1 by 1: ( 2 3 4 5 6 7 8 9 10 11 12 ... )
Left rotation of #1 by 2: ( 3 4 5 6 7 8 9 10 11 12 ... )
Right rotation of #1 by 1: ( 0 1 2 3 4 5 6 7 8 9 10 11 ... )
Right rotation of #1 by 2: ( 0 0 1 2 3 4 5 6 7 8 9 10 ... )

But I want to use openfhe lib in my folder

Glad to hear that you got the examples to work!

Can you share a minimal reproducible example?

This is an odd error, since -fopenmp is defined only in OpenMP_CXX_FLAGS and OpenMP_C_FLAGS
and it looks like that is getting mangled somehow into -fopenmp=libomp

Did you edit the copy of CMakeLists.User.txt to add your specific executable name? that should be the only think you needed to change.

Did you “make install” the openFHE library on you system? The default location requires sudo permission, but you can install it locally by specifying a directory name when you run cmake.

cmake -DCMAKE_INSTALL_PREFIX=/home/dcousins/opt/openfhe .. 

Thank you for your help, but this error magically disappears without any changes, it fixes itself :laughing:
I will try your method at the last time meeting this error.
Danke!

Bitte! Sometimes it is a condition where the build system is left in a funky state…

I have faced the same problem and still could not solve it. I would be grateful if you could help me

@A9252312015k

Please open a new discussion. In that discussion include additional information such as your OS, what version of OpenFHE you’re installing, what errors you’re encountering, what commands you’ve run (please be detailed) and more

Thanks!