Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Build fails due to : ld: library not found for -lssl #1256

Closed
jmininger opened this issue Apr 3, 2018 · 7 comments
Closed

Build fails due to : ld: library not found for -lssl #1256

jmininger opened this issue Apr 3, 2018 · 7 comments

Comments

@jmininger
Copy link

jmininger commented Apr 3, 2018

MacOS High Sierra v10.13.3
Xcode 9.2

Cmake and make directives:

cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address -DCMAKE_CXX_FLAGS="-DLOG_LEVEL=LOG_LEVEL_TRACE -Wno-error=pointer-bool-conversion" ..
make -j4
[  0%] Performing configure step for 'capnp'
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Jacquin/peloton/BUILD/external/capnp-prefix/src/capnp-build
[  1%] Performing build step for 'capnp'
[  1%] Building CXX object src/kj/CMakeFiles/kj.dir/array.c++.o

...

[ 98%] Building CXX object src/CMakeFiles/peloton.dir/__/third_party/adaptive_radix_tree/Tree.cpp.o
[ 98%] Linking CXX shared library ../lib/libpeloton-d.dylib
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libpeloton-d.0.0.5.dylib] Error 1
make[1]: *** [src/CMakeFiles/peloton.dir/all] Error 2
make: *** [all] Error 2

-- ******************* Peloton Configuration Summary *******************
-- General:
--   Version           :   0.0.5
--   Git               :   28c1eb05b
--   System            :   Darwin
--   Compiler          :   /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ ( )
--   Release CXX flags :   -O3 -DNDEBUG -DLOG_LEVEL=LOG_LEVEL_TRACE -Wno-error=pointer-bool-conversion -std=c++1y -D__PELOTONFILE__='"$(subst /Users/Jacquin/peloton/,,$(abspath $<))"' -fcolor-diagnostics -fPIC -Wall -Wextra -Werror -mcx16 -Wno-invalid-offsetof -march=native -Wno-tautological-undefined-compare -Wno-unused-private-field -Wno-braced-scalar-init -Wno-constant-conversion -Wno-potentially-evaluated-expression -Wno-infinite-recursion -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/opt/openssl/include -Wno-strict-aliasing -Wno-implicit-fallthrough -fsanitize=address -fsanitize-address-use-after-scope
--   Debug CXX flags   :   -g -O0 -ggdb -fno-omit-frame-pointer -fno-optimize-sibling-calls -DLOG_LEVEL=LOG_LEVEL_TRACE -Wno-error=pointer-bool-conversion -std=c++1y -D__PELOTONFILE__='"$(subst /Users/Jacquin/peloton/,,$(abspath $<))"' -fcolor-diagnostics -fPIC -Wall -Wextra -Werror -mcx16 -Wno-invalid-offsetof -march=native -Wno-tautological-undefined-compare -Wno-unused-private-field -Wno-braced-scalar-init -Wno-constant-conversion -Wno-potentially-evaluated-expression -Wno-infinite-recursion -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/opt/openssl/include -Wno-strict-aliasing -Wno-implicit-fallthrough -fsanitize=address -fsanitize-address-use-after-scope
--   Build type        :   Debug
--
--   BUILD_docs        :   ON
--
-- Dependencies:
--   Linker flags      :
--   Boost             :   Yes (ver. 1.66)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.5.1)
--   capnproto         :   No
--   LLVM              :   Yes (ver. 3.7.1)
--
-- Documentaion:
--   Doxygen           :   No
--   config_file       :
--
-- Install:
--   Install path      :   /Users/Jacquin/peloton/BUILD/install
--
-- Configuring done
CMake Warning (dev) in src/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "peloton" has an INTERFACE_LINK_LIBRARIES property which differs
  from its LINK_INTERFACE_LIBRARIES_DEBUG properties.

  INTERFACE_LINK_LIBRARIES:

    peloton-proto;peloton-capnp;/usr/local/lib/libboost_system-mt.dylib;/usr/local/lib/libboost_filesystem-mt.dylib;/usr/local/lib/libboost_thread-mt.dylib;/usr/local/lib/libboost_chrono-mt.dylib;/usr/local/lib/libboost_date_time-mt.dylib;/usr/local/lib/libboost_atomic-mt.dylib;/usr/local/lib/libgflags.dylib;$<$<NOT:$<CONFIG:DEBUG>>:/usr/local/lib/libtbb.dylib>;$<$<CONFIG:DEBUG>:/usr/local/lib/libtbb.dylib>;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libcapnp-rpc.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libcapnp.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libkj-async.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libkj.a;/usr/local/lib/libprotobuf.dylib;/usr/local/lib/libtensorflow.so;/usr/local/lib/libevent.dylib;/usr/local/lib/libevent_pthreads.dylib;/usr/local/lib/libpqxx.dylib;/usr/local/pgsql/lib/libpq.dylib;-lssl -lcrypto;LLVMCore;LLVMMCJIT;LLVMX86CodeGen;LLVMX86Desc;LLVMX86Info;LLVMX86CodeGen;LLVMX86AsmPrinter;LLVMX86AsmParser;LLVMX86Desc;LLVMX86Info;LLVMX86Disassembler;peloton-proto;pg_query

  LINK_INTERFACE_LIBRARIES_DEBUG:

    peloton-proto;peloton-capnp;/usr/local/lib/libboost_system-mt.dylib;/usr/local/lib/libboost_filesystem-mt.dylib;/usr/local/lib/libboost_thread-mt.dylib;/usr/local/lib/libboost_chrono-mt.dylib;/usr/local/lib/libboost_date_time-mt.dylib;/usr/local/lib/libboost_atomic-mt.dylib;/usr/local/lib/libgflags.dylib;/usr/local/lib/libtbb.dylib;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libcapnp-rpc.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libcapnp.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libkj-async.a;/Users/Jacquin/peloton/BUILD/external/capnp-install/lib/libkj.a;/usr/local/lib/libprotobuf.dylib;/usr/local/lib/libtensorflow.so;/usr/local/lib/libevent.dylib;/usr/local/lib/libevent_pthreads.dylib;/usr/local/lib/libpqxx.dylib;/usr/local/pgsql/lib/libpq.dylib;-lssl -lcrypto;LLVMCore;LLVMMCJIT;LLVMX86CodeGen;LLVMX86Desc;LLVMX86Info;LLVMX86CodeGen;LLVMX86AsmPrinter;LLVMX86AsmParser;LLVMX86Desc;LLVMX86Info;LLVMX86Disassembler;peloton-proto;pg_query

This warning is for project developers.  Use -Wno-dev to suppress it.

I also suppressed a number of warnings as shown below. They were all of the same variety--the only difference being that each had a different template argument-- so I've only included one of them.

In file included from /Users/Jacquin/peloton/src/index/bwtree_index.cpp:15:
In file included from /Users/Jacquin/peloton/src/include/index/index_key.h:27:
/Users/Jacquin/peloton/src/include/index/generic_key.h:70:34: warning: address of array 'this->data' will always evaluate to 'true' [-Wpointer-bool-conversion]
    storage::Tuple tuple(schema, data);
                   ~~~~~         ^~~~
/Users/Jacquin/peloton/src/index/bwtree_index.cpp:64:23: note: in instantiation of member function 'peloton::index::GenericKey<8>::GetInfo' requested here
            index_key.GetInfo().c_str(),
                      ^
In file included from /Users/Jacquin/peloton/src/index/bwtree_index.cpp:15:
In file included from /Users/Jacquin/peloton/src/include/index/index_key.h:27:
@mbutrovich
Copy link
Contributor

Just Googling around, it seems like reinstalling the Command Line Tools is a common solution for this problem:

https://groups.google.com/forum/#!topic/crystal-lang/tMcFSbvYRlA
brianmario/mysql2#795

Those links recommend xcode-select --install, however I think that will install the latest version which isn't what you want. Try reinstalling 9.2 following the link from the Installation wiki.

Out of curiosity, before you do that what is the output of "clang -v"?

@jmininger
Copy link
Author

jmininger commented Apr 3, 2018

Thank you for the suggestion.
Here is the compiler info:

clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@mbutrovich
Copy link
Contributor

That version builds Peloton okay for me. It seems like wires are crossed on your system with respect to where to look for the SSL library. Apple rolled their own starting with El Capitan, but you likely have some OpenSSL packages installed via Homebrew as well that might be mixing things up if you symlinked them into other places. All I can suggest at this point is reloading your dyld cache...

sudo update_dyld_shared_cache -force

...and perhaps checking for any weirdness with Homebrew with...

brew doctor

Beyond that it's tough to say why linking in the SSL library is failing on your machine.

@poojanilangekar
Copy link
Contributor

What the version of SSL installed on your machine?
You can figure that out using the openssl version command

@jmininger
Copy link
Author

OpenSSL 1.0.2l 25 May 2017

@poojanilangekar
Copy link
Contributor

The version seems fine. I think there is an issue with the path. Find the location of your current OpenSSL installation using which openssl. Now add the path you find without the trailing openssl to the $PATH variable. Let me know if it fixes your issue.

@jmininger
Copy link
Author

I was finally able to build it after reinstalling Xcode command line tools (as suggested above), and after uninstalling anaconda and reinstalling python3. I still had to use the
-DCMAKE_CXX_FLAGS="-Wno-error=pointer-bool-conversion" for the build to work though. Thank you for your suggestions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants