Skip to content
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

Build failed #21

Closed
Cyclenerd opened this issue Apr 20, 2018 · 17 comments
Closed

Build failed #21

Cyclenerd opened this issue Apr 20, 2018 · 17 comments

Comments

@Cyclenerd
Copy link

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
Copy link
Owner

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

@Cyclenerd
Copy link
Author

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

@kozyilmaz
Copy link
Owner

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

@Cyclenerd
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

With the change the error still appears :(

@zpatshueh
Copy link

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

@kozyilmaz kozyilmaz mentioned this issue Jun 27, 2018
@kozyilmaz
Copy link
Owner

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

@Cyclenerd
Copy link
Author

Works for me. Thank you 👍

@zpatshueh
Copy link

zpatshueh commented Jul 2, 2018 via email

@kozyilmaz kozyilmaz reopened this Jul 2, 2018
@zpatshueh
Copy link

zpatshueh commented Jul 2, 2018 via email

@kozyilmaz
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

Confident that this issue is fixed :)

@kode54
Copy link

kode54 commented Sep 24, 2018

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

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

No branches or pull requests

4 participants