-
Notifications
You must be signed in to change notification settings - Fork 119
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
required boost-libs not in Debian stable #2
Comments
The error is unrelated with Boost. Cheers |
BTW generally speaking I prefer to avoid statically linked libs in targets because in that case libs will be traced as well or they have to be explicitly ignored by a specific address range filter |
That's a good point I didn't think about. Does something speak against providing both, e.g. the dynamically linked one for the "straight forward textbook analysis" and the static linked version for people using different systems/compilers/versions of the libraries? Occasionally I need to run |
Hmm, why not. If I do as following: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94864e5..29bc4c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8)
project(Whitebox_crypto_AES)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++0x")
-
+SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+SET(BUILD_SHARED_LIBRARIES OFF)
+SET(CMAKE_EXE_LINKER_FLAGS "-static")
set(SOURCE_FILES
base.h
base.cpp
@@ -47,6 +49,13 @@ set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED COMPONENTS program_options serialization iostreams random)
include_directories(${Boost_INCLUDE_DIRS})
+find_library(GMP_LIB gmp PATHS /usr/local /opt/local $ENV{HOME}/gmp $ENV{HOME}/gmp/lib /usr)
+if(NOT GMP_LIB)
+ message(FATAL_ERROR "gmp library not found. Rerun cmake with -DCMAKE_PREFIX_PATH=\"<path to lib1>;<path to lib2>\"")
+endif()
+message("GMP_LIB: ${GMP_LIB}")
+include_directories(${GMP_INCLUDE_PATH})
+
# Linking
-target_link_libraries(main ${NTL_LIB} ${Boost_LIBRARIES})
-target_link_libraries(testing ${NTL_LIB} ${Boost_LIBRARIES})
+target_link_libraries(main ${NTL_LIB} ${GMP_LIB} ${Boost_LIBRARIES})
+target_link_libraries(testing ${NTL_LIB} ${GMP_LIB} ${Boost_LIBRARIES}) Then I end up with a 2Mb binary with deps to the std libs:
I tried to add |
After setting |
Hi, while trying to update the Orka image I found out that Debian Stable currently contains version 1.55 of all boost libs. When installing them, the build still fails:
Installing the packages from sid in stable doesn't sound like a good idea, so I'd suggest to build a statically
linked binary if nothing speaks against that. In my opinion, this is the easiest way for users to get everything up and running.
The text was updated successfully, but these errors were encountered: