CMake Error at CMakeLists.txt:25 (find_package): By not providing "FindSecp256k1.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Secp256k1", but CMake did not find one.
· 9 comments
I im trying to compile eos/unittests cpp files and I get this error:
fatal error: fc/reflect/reflect.hpp: No such file or directory
#include <fc/reflect/reflect.hpp>
so now I'm trying to install fc library you,ve provided.
This is the command I used and the error I've got.
cmake .
CMake Error at CMakeLists.txt:25 (find_package):
By not providing "FindSecp256k1.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Secp256k1", but CMake did not find one.
Could not find a package configuration file provided by "Secp256k1" with
any of the following names:
Secp256k1Config.cmake
secp256k1-config.cmake
Add the installation prefix of "Secp256k1" to CMAKE_PREFIX_PATH or set
"Secp256k1_DIR" to a directory containing one of the above files. If
"Secp256k1" provides a separate development package or SDK, be sure it has
been installed.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.12)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "/home/poores/fc/CMakeFiles/CMakeOutput.log".
@larryk85
make sure you have compiled and installed secp256k1
https://github.com/cryptonomex/secp256k1-zkp
Then invoke cmake while pointing to the proper directories. Probably something like:
cmake -DSecp256k1_INCLUDE_DIR=/usr/include -DSecp256k1_LIBRARY=/usr/lib .
I'm also starting to look at this library and ran into this :) FC library is an external reference in the eosio/libraries/fc of the eosio itself and I think that's probably how most work on it (just guessing).
You can point a "separate" clone of FC it to a few resources in the working eosio/eos clone that had a successful build. Also, in my separate fork cmake can't find BOOT libraries by default that are setup by eosio_build.sh.
What I do is this, it does work just in regard to the Secp256k1 package:
cmake -DCMAKE_MODULE_PATH=/home/infinidi/src/github.com/infinidi/eos/libraries/fc/CMakeModules -DBOOST_ROOT=/home/infinidi/opt/boost .
make test
There were actually couple of other things missing like the one's that you're seeing in No cmake_minimum_required command is present
above, to be able to build in the fc directory "by itself", so I built a "fake" dev/test harness for myself and it works as a whole with some other options. I can probably throw it on github if there is interest for it from anyone :), it's just for the pure library development outside of the eosio tree for the time being.
Hey @infinidi I wrote a CMakeLists.txt to build fc
separately from eos.
You can check it out here.
It's not perfect, I'm no CMake ninja. But kinda works.
This is how you would call it:
cmake -DSecp256k1_INCLUDE_DIR=${Secp256k1_INCLUDE_DIR} \
-DSecp256k1_LIBRARY=${Secp256k1_LIBRARY} \
-DGMP_LIBRARIES=${GMP_LIBRARIES_DIR} \
-DGMP_INCLUDE_DIR=${GMP_INCLUDE_DIR} \
-DBOOST_ROOT=${BOOST_ROOT} \
I'm actually writing it for a BitBake recipe.
Unfortunately I'm still having problems to link fc
to secp256k1
:(
Hey @bernardoaraujor, some interesting stuff you're doing in general! That's kind of what I was doing with a separate build, but then I took a shortcut and got it to work 'cause I assumed I'll probably have eosio/eos install on my machine at all times where the fc fork is :) If you give me 'till the end of today, I'll commit it, it all works including testing (with custom testers) and secp256k1. I just need to clean out some proprietary stuff. Seems like more people might have it for similar reasons, etc.