kozyilmaz / zcash-apple

Zcash for Apple platforms
78 stars 21 forks source link

Build failed #21

Closed Cyclenerd closed 6 years ago

Cyclenerd commented 6 years ago

I am having trouble compiling the current build.

Output:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ git clone https://github.com/kozyilmaz/zcash-apple.git
[...]
$ cd zcash-apple/
$ source environment
$ PRINT_DEBUG=y make all
[...]
6 warnings generated.
3 warnings generated.
1 warning generated.
  CCLD     pkg-config
Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      _g_iconv in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      _g_convert_with_iconv in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      _g_convert_with_fallback in libglib-2.0.a(libglib_2_0_la-gconvert.o)
  "_libiconv_close", referenced from:
      _g_iconv_close in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      _g_convert in libglib-2.0.a(libglib_2_0_la-gconvert.o)
      _g_convert_with_fallback in libglib-2.0.a(libglib_2_0_la-gconvert.o)
  "_libiconv_open", referenced from:
      _g_iconv_open in libglib-2.0.a(libglib_2_0_la-gconvert.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[6]: *** [pkg-config] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [pkgconfig_build] Error 2
make[2]: *** [build] Error 1
make[1]: *** [pkgconfig_all] Error 2
make: *** [tools_all] Error 2

My system:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.4
BuildVersion:   17E199
$ clang -v
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix

Ask for help and tips. Many Thanks.

kozyilmaz commented 6 years ago

Hey @Cyclenerd, do you have brew installed? Is it possible for you to try without it?

Cyclenerd commented 6 years ago

I have MacPorts installed. This is something similar to brew. Is there any way I can keep MacPorts.

kozyilmaz commented 6 years ago

It's creating a lot of havoc with self-compiled GNU tools, how about moving it just to try.

Cyclenerd commented 6 years ago

Homebrew autoconf and automake is no longer used. Unfortunately, I still get the same error.

Here are a few details. Any ideas?

--> gcc:
/usr/bin/gcc
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

--> clang:
/usr/bin/clang
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

--> autoconf:
/Users/nils/zcash-apple/tools/o/bin/autoconf
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

--> automake:
/Users/nils/zcash-apple/tools/o/bin/automake
automake (GNU automake) 1.15.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

--> libtool:
/usr/bin/libtool
kozyilmaz commented 6 years ago

Thanks for the information, I think configure still thinks its a GNU iconv, anyway can you please execute these commands and paste the output:

$ echo $PATH
$ nm /usr/lib/libiconv.dylib | grep iconv_open
$ nm /opt/local/lib/libiconv.dylib | grep iconv_open

and the output of this command on top level

$ cat tools/pkgconfig/pkg-config-0.29.2/glib/config.h |grep LIBICONV

and can you please make the change below in this file tools/pkgconfig/Makefile and try again. Appreciate if you paste the output

-       ( cd pkg-config-$(PKGCONFIG_VERSION); ./configure --prefix=${BSPTOOLS} -with-internal-glib; )
+       ( cd pkg-config-$(PKGCONFIG_VERSION); ./configure --prefix=${BSPTOOLS} -with-internal-glib --with-libiconv=native; )
Cyclenerd commented 6 years ago

I agree with you. Something else from /opt has to be used. If I rename the folder temporarily, everything is compiled.

nils@macbookpro zcash-apple $ source environment
nils@macbookpro zcash-apple $ echo $PATH
/Users/nils/zcash-apple/tools/o/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS

nils@macbookpro zcash-apple $ nm /usr/lib/libiconv.dylib | grep iconv_open
000000000000188d T _iconv_open

nils@macbookpro zcash-apple $ nm /opt/local/lib/libiconv.dylib | grep iconv_open
0000000000001c5c T _libiconv_open
0000000000002fa1 T _libiconv_open_into

nils@macbookpro zcash-apple $ cat tools/pkgconfig/pkg-config-0.29.2/glib/config.h |grep LIBICONV
/* #undef USE_LIBICONV_GNU */
#define USE_LIBICONV_NATIVE 1

With adjusted Makefile, the same error comes.

kozyilmaz commented 6 years ago

Unable to find why autotools are confused yet, but it detects /opt/local/lib/libiconv.dylib but tries to link with /usr/lib/libiconv.dylib

Can you try this one?

-       ( cd pkg-config-$(PKGCONFIG_VERSION); ./configure --prefix=${BSPTOOLS} -with-internal-glib; )
+       ( cd pkg-config-$(PKGCONFIG_VERSION); LT_SYS_LIBRARY_PATH=/opt/local/lib ./configure --prefix=${BSPTOOLS} -with-internal-glib; )
Cyclenerd commented 6 years ago

With the change the error still appears :(

zpatshueh commented 6 years ago

I am having the same issue as above... any solution?!

kozyilmaz commented 6 years ago

Hey @Cyclenerd @zpatshueh! Can you give it another shot with the latest master? Thanks!

Cyclenerd commented 6 years ago

Works for me. Thank you 👍

zpatshueh commented 6 years ago

Hi Kazim,

Its showing me a different error now.. looks like i am missing a header file? any pointer?

In file included from libs/thread/src/future.cpp:6:

In file included from ./boost/thread/detail/config.hpp:11:

In file included from ./boost/config.hpp:57:

In file included from ./boost/config/platform/macos.hpp:28:

./boost/config/detail/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found

include

          ^~~~~~~~~~

1 error generated.

...failed darwin.compile.c++ bin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi/future.o...

darwin.compile.c++ bin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi/pthread/thread.o

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"

"-mmacosx-version-min=10.8" "-stdlib=libc++" -std=c++11 -fvisibility=hidden -I/Users/patshueh/zcash/zcash-apple/zcash/zcash_v1.1.1/depends/x86_64-apple-darwin17.6.0/include -O3 -Wall -pedantic -gdwarf-2 -fexceptions -Wno-long-long -Wno-inline -m64 -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -fpermissive -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi/pthread/thread.o" "libs/thread/src/pthread/thread.cpp"

In file included from libs/thread/src/pthread/thread.cpp:9:

In file included from ./boost/thread/detail/config.hpp:11:

In file included from ./boost/config.hpp:57:

In file included from ./boost/config/platform/macos.hpp:28:

./boost/config/detail/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found

include

          ^~~~~~~~~~

1 error generated.

...failed darwin.compile.c++ bin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi/pthread/thread.o...

...skipped <pbin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi>libboost_thread.a(clean) for lack of <pbin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi>pthread/thread.o...

...skipped <pbin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi>libboost_thread.a for lack of <pbin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi>pthread/thread.o...

...skipped <pstage/lib>libboost_thread.a for lack of <pbin.v2/libs/thread/build/darwin-darwin-4.2.1/release/link-static/threadapi-pthread/threading-multi>libboost_thread.a...

...failed updating 50 targets...

...skipped 30 targets...

make[3]: *** [/Users/patshueh/zcash/zcash-apple/zcash/zcash_v1.1.1/depends/work/build/x86_64-apple-darwin17.6.0/boost/1_66_0-78db3903264/./.stamp_built] Error 1

make[2]: *** [zcash_build] Error 2

make[1]: *** [build] Error 1

make: *** [zcash_all] Error 2

On Sun, Jul 1, 2018 at 7:25 AM Kazım Özyılmaz notifications@github.com wrote:

Hey @Cyclenerd https://github.com/Cyclenerd @zpatshueh https://github.com/zpatshueh! Can you give it another shot with the latest master? Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kozyilmaz/zcash-apple/issues/21#issuecomment-401567176, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae9PMAji5QGY1ZfM7isOAsr6EG1CH8FAks5uB-y6gaJpZM4TdPGF .

--

Pat Shueh Director, PreSales - Asia Pacific & Japan M (+61) 416 139 693 M (+65) 9788 9460 https://blog.zimperium.com/ www.zimperium.com

zpatshueh commented 6 years ago

$ xcrun --sdk macosx --show-sdk-version

10.13

On Mon, Jul 2, 2018 at 4:40 PM Kazım Özyılmaz notifications@github.com wrote:

Reopened #21 https://github.com/kozyilmaz/zcash-apple/issues/21.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kozyilmaz/zcash-apple/issues/21#event-1710790317, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae9PMCkAzv71O_IWtA3hXtvY6wpi0VbCks5uCcBsgaJpZM4TdPGF .

--

Pat Shueh Director, PreSales - Asia Pacific & Japan M (+61) 416 139 693 M (+65) 9788 9460 https://blog.zimperium.com/ www.zimperium.com

kozyilmaz commented 6 years ago

Hi @zpatshueh, did you run the build command on an existing (possibly failed) installation. I changed something that may affect all the package at configure level so can you please start a clean build and let me know the output? Sorry for the trouble:

Please open a new terminal window
$ git clone https://github.com/kozyilmaz/zcash-apple.git
$ cd zcash-apple
$ source environment
$ PRINT_DEBUG=y make all
kozyilmaz commented 6 years ago

Hi @zpatshueh are you able to try it with a clean build? I released the v1.1.2 today. If it works just let me know so I can close this issue. Thanks!

kozyilmaz commented 6 years ago

Confident that this issue is fixed :)

kode54 commented 6 years ago

Experiencing this issue with a fresh checkout today, using Xcode 10.

https://gist.github.com/kode54/c41a2dae475d06af458561f77d654c06

Same missing unistd.h when building boost.

$ xcrun --sdk macosx --show-sdk-version
10.14