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

link failed in mac os. #99

Closed
philsong opened this Issue Jul 27, 2017 · 11 comments

Comments

Projects
None yet
7 participants
@philsong

philsong commented Jul 27, 2017

I am writing a article about how to compile eos in mac os.
http://www.jianshu.com/p/f26ee4cf1d4a

but i still meet a issue in below:
could some one help me? thanks.

[ 55%] Built target WASM
[ 58%] Built target WAST
[ 59%] Linking CXX executable wavm
Undefined symbols for architecture x86_64:
"typeinfo for llvm::Instruction", referenced from:
typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o)
"typeinfo for llvm::RuntimeDyld::MemoryManager", referenced from:
typeinfo for llvm::MCJITMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::raw_ostream", referenced from:
typeinfo for llvm::raw_pwrite_stream in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::MemoryBuffer", referenced from:
typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::ErrorInfoBase", referenced from:
typeinfo for llvm::ErrorInfo<llvm::ErrorList, llvm::ErrorInfoBase> in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::JITSymbolResolver", referenced from:
typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::RTDyldMemoryManager", referenced from:
typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
"typeinfo for llvm::CmpInst", referenced from:
typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libraries/wasm-jit/Source/Programs/wavm] Error 1
make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/wavm.dir/all] Error 2
make: *** [all] Error 2

@philsong philsong changed the title from link failed in maxos. to link failed in mac os. Jul 27, 2017

@nathanhourt

This comment has been minimized.

Contributor

nathanhourt commented Jul 27, 2017

Have you tried with llvm from homebrew rather than installing it manually?

@philsong

This comment has been minimized.

philsong commented Jul 28, 2017

new issue:
In file included from /Users/phil/work/X-work/eos/libraries/chain/include/eos/chain/types.hpp:41:
/Users/phil/work/X-work/eos/libraries/fc/include/fc/static_variant.hpp:388:34: error: class template partial specialization is not more specialized than the primary template
[-Winvalid-partial-specialization]
template<typename... T> struct get_typename<T...> { static const char* name() { return typeid(static_variant<T...>).name(); } };
^
/Users/phil/work/X-work/eos/libraries/fc/include/fc/reflect/typename.hpp:18:30: note: template is declared here
template class get_typename{};
^
In file included from /Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:33:
/Users/phil/work/X-work/eos/libraries/chain/include/eos/chain/producer_object.hpp:52:2: warning: using ordered_non_unique is not deterministic [-W#warnings]
#warning using ordered_non_unique is not deterministic
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:340:2: warning: TODO: Populate generated blocks with generated transactions [-W#warnings]
#warning TODO: Populate generated blocks with generated transactions
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:447:2: warning: TODO: Process generated transaction [-W#warnings]
#warning TODO: Process generated transaction
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:446:26: warning: unused variable 'trx' [-Wunused-variable]
for(const auto& trx : thread.generated_input ) {
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:429:13: warning: unused variable 'next_block_num' [-Wunused-variable]
uint32_t next_block_num = next_block.block_num();
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:495:2: warning: TODO: Use a real chain_id here (where is this stored? Do we still need it?) [-W#warnings]
#warning TODO: Use a real chain_id here (where is this stored? Do we still need it?)
^
/Users/phil/work/X-work/eos/libraries/chain/chain_controller.cpp:1137:30: warning: unused variable 'outputs' [-Wunused-variable]
const vector& outputs = vo["output"].get_array();
^
7 warnings and 1 error generated.
make[2]: *** [libraries/chain/CMakeFiles/eos_chain.dir/chain_controller.cpp.o] Error 1
make[1]: *** [libraries/chain/CMakeFiles/eos_chain.dir/all] Error 2
make: *** [all] Error 2

@hh3755

This comment has been minimized.

hh3755 commented Jul 29, 2017

Same problem here,I install the llvm manually instead of using brew install llvm

with the following cmake command:

export WASM_LLVM_CONFIG=~/develop/eos/environment/wasm-compiler/llvm/bin/llvm-config
## using manually installed llvm
export LLVM_DIR=~/develop/eos/environment/llvm/clang-llvm-4.0.0-x86_64-apple-darwin/lib/cmake/llvm
cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2l -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2l/lib ..

if i didn't use the manually install llvm,I got the following error when cmake:

- Configuring ChainBase on OS X

CMake Error at libraries/wasm-jit/Source/Runtime/CMakeLists.txt:26 (find_package):

Could not find a package configuration file provided by "LLVM" (requested

version 4.0) with any of the following names:

LLVMConfig.cmake

llvm-config.cmake

Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set

"LLVM_DIR" to a directory containing one of the above files.  If "LLVM"

provides a separate development package or SDK, be sure it has been

installed.

-- Configuring incomplete, errors occurred!

and then cmake succeed, but when make -j4,I will got another error,any help will be appreciated,thanks.

[ 70%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/network/url.cpp.o
[ 70%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/compress/smaz.cpp.o
[ 70%] Linking CXX executable Test
[ 71%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/compress/zlib.cpp.o
[ 71%] Linking CXX static library libfc.a
[ 72%] Building CXX object libraries/wasm-jit/Source/Programs/CMakeFiles/Disassemble.dir/Disassemble.cpp.o
Undefined symbols for architecture x86_64:
Undefined symbols for architecture x86_64:
  "typeinfo for llvm::Instruction", referenced from:
  "typeinfo for llvm::Instruction", referenced from:
      typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o)
      typeinfo for llvm::SelectInst in libRuntime.a(LLVMEmitIR.cpp.o)
  "typeinfo for llvm::RuntimeDyld::MemoryManager", referenced from:
  "typeinfo for llvm::RuntimeDyld::MemoryManager", referenced from:
      typeinfo for llvm::MCJITMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
      typeinfo for llvm::MCJITMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::raw_ostream", referenced from:
  "typeinfo for llvm::raw_ostream", referenced from:
      typeinfo for llvm::raw_pwrite_stream in libRuntime.a(LLVMJIT.cpp.o)
      typeinfo for llvm::raw_pwrite_stream in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::MemoryBuffer", referenced from:
  "typeinfo for llvm::MemoryBuffer", referenced from:
      typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o)
      typeinfo for llvm::ObjectMemoryBuffer in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::ErrorInfoBase", referenced from:
      typeinfo for llvm::ErrorInfo<llvm::ErrorList, llvm::ErrorInfoBase> in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::ErrorInfoBase", referenced from:
      typeinfo for llvm::ErrorInfo<llvm::ErrorList, llvm::ErrorInfoBase> in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::JITSymbolResolver", referenced from:
  "typeinfo for llvm::JITSymbolResolver", referenced from:
      typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o)
      typeinfo for LLVMJIT::NullResolver in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::RTDyldMemoryManager", referenced from:
      typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::RTDyldMemoryManager", referenced from:
      typeinfo for LLVMJIT::UnitMemoryManager in libRuntime.a(LLVMJIT.cpp.o)
  "typeinfo for llvm::CmpInst", referenced from:
  "typeinfo for llvm::CmpInst", referenced from:
      typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o)
      typeinfo for llvm::FCmpInst in libRuntime.a(LLVMEmitIR.cpp.o)
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
clangclang: : error: errorlinker command failed with exit code 1 (use -v to see invocation): linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [libraries/wasm-jit/Source/Programs/Test] Error 1make[2]: *** [libraries/wasm-jit/Source/Programs/wavm] Error 1

make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/Test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [libraries/wasm-jit/Source/Programs/CMakeFiles/wavm.dir/all] Error 2
[ 72%] Linking CXX executable Disassemble
[ 72%] Built target Disassemble
[ 72%] Built target fc
make: *** [all] Error 2
@skenan

This comment has been minimized.

skenan commented Jul 29, 2017

@hh3755 Which Xcode version do you use? I am not sure if it's related with the XCode. When I tried to compile, I have many problems. And upgrade the Xcode >=8.3.3 solve that.

@philsong

This comment has been minimized.

philsong commented Jul 30, 2017

resolved:
see my update:
http://www.jianshu.com/p/f26ee4cf1d4a

the core change:

echo "export WASM_LLVM_CONFIG=~/wasm-compiler/llvm/build/bin/llvm-config" >> ~/.zshrc

echo "export LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm" >> ~/.zshrc

@philsong philsong closed this Jul 30, 2017

@hh3755

This comment has been minimized.

hh3755 commented Jul 30, 2017

@skenan I'm using brew, not install xcode directly. And @philsong 's method worked.

After using:

brew install llvm

brew install the version of llvm@4.0.1 for me,changed the coresponding LLVM_DIR ,run the cmd like following:

export WASM_LLVM_CONFIG=~/develop/eos/environment/wasm-compiler/llvm/bin/llvm-config
export LLVM_DIR=/usr/local/Cellar/llvm/4.0.1/lib/cmake/llvm
cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2l -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2l/lib ..

Then everything went ok. Thanks everybody.

@skenan skenan referenced this issue Jul 31, 2017

Closed

osx build error #106

@jin-cheng-li

This comment has been minimized.

jin-cheng-li commented Jul 31, 2017

cmake .. error when build eos

-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using custom FindBoost.cmake
-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- thread
-- date_time
-- system
-- filesystem
-- program_options
-- signals
-- serialization
-- chrono
-- unit_test_framework
-- context
-- locale
-- Using custom FindBoost.cmake
-- Boost version: 1.64.0
-- Found the following Boost libraries:
-- coroutine
-- Configuring Eos on OS X
-- Using WASM clang => /Users/lijincheng/wasm-compiler/llvm/bin/clang
-- Using WASM llc => /Users/lijincheng/wasm-compiler/llvm/bin/llc
-- Using WASM llvm-link => /Users/lijincheng/wasm-compiler/llvm/bin/llvm-link
-- Found Secp256k1: /usr/local/lib/libsecp256k1.a
CMake Error at /usr/local/Cellar/cmake/3.9.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find GMP (missing: GMP_LIBRARIES GMP_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.9.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
libraries/fc/CMakeModules/FindGMP.cmake:50 (find_package_handle_standard_args)
libraries/fc/CMakeLists.txt:20 (find_package)

@jin-cheng-li

This comment has been minimized.

jin-cheng-li commented Aug 1, 2017

solved by: brew install gmp

@nathanhourt

This comment has been minimized.

Contributor

nathanhourt commented Aug 1, 2017

This issue has tracked several different errors at this point, I think, and I'm not sure if any of them are still outstanding, so I'm closing it. Open a new issue if some problems persist.

@nathanhourt nathanhourt reopened this Aug 1, 2017

@heifner

This comment has been minimized.

Contributor

heifner commented Sep 12, 2017

This should be closed. Looks like it was reopened on accident. Closing.

@heifner heifner closed this Sep 12, 2017

@facadev

This comment has been minimized.

facadev commented Dec 24, 2017

Tweaking the environment variables doesn't fix the issue for me.

I tried building LLVM from source, installing llvm (v4 and v5) with brew and modifying relevant environment variables to ensure the build script finds the right LLVM, LLC, clang binaries. Neither works.

ljrprocc pushed a commit to bithacks-tech/myeosio that referenced this issue Jul 4, 2018

Merge pull request EOSIO#99 from enumivo/staging
rename various EOS_* strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment