Open prvsousa opened 7 years ago
We have not used CMake so far, but it looks like a promising alternative to the Makefiles that we currently use. We will look into CMake and see what it offers. Of course we would be happy if someone wants to support us with that.
That is something I wanted to do for a while and I am working on this right now. My CMake is not that good, so I will not promise anything.
I've been using CMake to build ABY for a project for several months now. You can find it here
My setup is the following:
I have a directory containing a folder ABY
(cloned from this repo) and a folder myproject
.
ABY
contains the CMakeLists.txt I linked to above.
myproject
contains a CMakeLists.txt using the ABY
folder as a CMake subdirectory in the following way:
...
add_subdirectory(../ABY ${CMAKE_BINARY_DIR}/aby EXCLUDE_FROM_ALL)
include_directories(../ABY/src/abycore)
...
add_executable(myproject <the usual stuff here>)
target_link_libraries(myproject ABY)
Maybe that helps :) I hope I didn't miss anything. Feel free to use and modify it.
Oh @KloolK this helps me so much!! Thanks!
I have not figured out yet, what is the optimal way to manage external dependencies and publish the own targets in CMake. In my project I am using these files in combination with ExternalProject_Add.
2017/02/21: Since OTExtension and ABY ship slightly different versions of for example util/cbitvector.h, I ran into problems when linking my application to abycore and OTExtension. I resorted to copying the ot/ files again and updated the CMake files accordingly.
Hi @KloolK , do you remember this issue? When you say :
# Build ABY as static library (building as shared library would require -fPIC when building miracl.a)
How can I build miracl.a with -fPIC? Any hint?
Hi @patricia93sousa Are you sure you need to build ABY as a shared library?
If you have to, add the -fPIC in the build scripts of Miracl located here in the official repo. I guess you will have to modify the linux64 file there and add the -fPIC flag to most of the lines starting with gcc
or g++
. I'm not really sure though.
Maybe the better place to ask is the Miracl repo. Especially if you are using some other platform.
Hi,
I already try to put the -fPIC in the gcc and g++ under the miracl script linux64 but without success in the compile of the shared library . I got the error to recompile with -fPIC and the error is related to the big.o file... this is so strange. But yea, maybe I have to ask in the miracl official. I only ask here because in the cmake you have that comment , and I thought that you probably know the solutions.
Thanks anyway.
The error that I got was:
/usr/bin/ld: ../src/abycore/ENCRYPTO_utils/miracl_lib/big.o: relocation R_X86_64_32S against '_ZNKSt5ctypeIcE8do_widenEc' can not be used when making a shared object; recompile with -fPIC
Has anyone ever made "cmakefiles" for this project?