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 failure on OSX #2

Closed
joehuchette opened this issue May 4, 2016 · 6 comments
Closed

Build failure on OSX #2

joehuchette opened this issue May 4, 2016 · 6 comments

Comments

@joehuchette
Copy link

joehuchette commented May 4, 2016

I'm trying to Pkg.build on OSX with julia v0.4.5, and I'm getting undefined symbol errors from GMP. Any ideas?

  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> Pkg.build("CDDLib")
INFO: Building FreeType
INFO: Building GLFW
INFO: Building CDDLib
INFO: Attempting to Create directory /Users/huchette/.julia/v0.4/CDDLib/deps/downloads
INFO: Directory /Users/huchette/.julia/v0.4/CDDLib/deps/downloads already created
INFO: Downloading file https://github.com/blegat/cddlib/archive/d26c8f8a4c9443d886f95201e1356b74b9408ac5.zip
INFO: Done downloading file https://github.com/blegat/cddlib/archive/d26c8f8a4c9443d886f95201e1356b74b9408ac5.zip
INFO: Attempting to Create directory /Users/huchette/.julia/v0.4/CDDLib/deps/src
INFO: Directory /Users/huchette/.julia/v0.4/CDDLib/deps/src already created
INFO: Attempting to Create directory /Users/huchette/.julia/v0.4/CDDLib/deps
INFO: Directory /Users/huchette/.julia/v0.4/CDDLib/deps already created
INFO: Path /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5 already created
INFO: Attempting to Create directory /Users/huchette/.julia/v0.4/CDDLib/deps/builds/libcddgmp
INFO: Directory /Users/huchette/.julia/v0.4/CDDLib/deps/builds/libcddgmp already created
INFO: Changing Directory to /Users/huchette/.julia/v0.4/CDDLib/deps/builds/libcddgmp
INFO: Changing Directory to /Users/huchette/.julia/v0.4/CDDLib/deps/builds/libcddgmp
INFO: Changing Directory to /Users/huchette/.julia/v0.4/CDDLib/deps/builds/libcddgmp
Making install in lib-src
 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/install-sh -c -d '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib'
 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/install-sh -c -d '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/include'
mkdir: /Users/huchette/.julia/v0.4/CDDLib/deps/usr: File exists
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libcdd.la '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib'
 /usr/bin/install -c -m 644 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src/cddstd.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src/cdd.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src/cddmp.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src/cddtypes.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src/setoper.h '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/include'
libtool: install: /usr/bin/install -c .libs/libcdd.0.dylib /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcdd.0.dylib
libtool: install: (cd /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib && { ln -s -f libcdd.0.dylib libcdd.dylib || { rm -f libcdd.dylib && ln -s libcdd.0.dylib libcdd.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libcdd.lai /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcdd.la
libtool: install: /usr/bin/install -c .libs/libcdd.a /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcdd.a
libtool: install: chmod 644 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcdd.a
libtool: install: ranlib /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcdd.a
Making install in src
make[2]: Nothing to be done for `install-data-am'.
 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/install-sh -c -d '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c scdd lcdd redcheck fourier projection adjacency allfaces testcdd1 testshoot testcdd2 testlp1 testlp2 testlp3 '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin'
libtool: install: /usr/bin/install -c .libs/scdd /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/scdd
libtool: install: /usr/bin/install -c .libs/lcdd /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/lcdd
libtool: install: /usr/bin/install -c .libs/redcheck /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/redcheck
libtool: install: /usr/bin/install -c .libs/fourier /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/fourier
libtool: install: /usr/bin/install -c .libs/projection /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/projection
libtool: install: /usr/bin/install -c .libs/adjacency /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/adjacency
libtool: install: /usr/bin/install -c .libs/allfaces /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/allfaces
libtool: install: /usr/bin/install -c .libs/testcdd1 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testcdd1
libtool: install: /usr/bin/install -c .libs/testshoot /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testshoot
libtool: install: /usr/bin/install -c .libs/testcdd2 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testcdd2
libtool: install: /usr/bin/install -c .libs/testlp1 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testlp1
libtool: install: /usr/bin/install -c .libs/testlp2 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testlp2
libtool: install: /usr/bin/install -c .libs/testlp3 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin/testlp3
Making install in lib-src-gmp
 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/install-sh -c -d '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/include'
 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/install-sh -c -d '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libcddgmp.la '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib'
 /usr/bin/install -c -m 644 /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddstd.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cdd.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddmp.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddtypes.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddstd_f.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cdd_f.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddmp_f.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/cddtypes_f.h /Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp/setoper.h '/Users/huchette/.julia/v0.4/CDDLib/deps/usr/include'
libtool: install: /usr/bin/install -c .libs/libcddgmp.0.dylib /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcddgmp.0.dylib
libtool: install: (cd /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib && { ln -s -f libcddgmp.0.dylib libcddgmp.dylib || { rm -f libcddgmp.dylib && ln -s libcddgmp.0.dylib libcddgmp.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libcddgmp.lai /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcddgmp.la
libtool: install: /usr/bin/install -c .libs/libcddgmp.a /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcddgmp.a
libtool: install: chmod 644 /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcddgmp.a
libtool: install: ranlib /Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/libcddgmp.a
Making install in src-gmp
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o projection_gmp projection.o ../lib-src-gmp/libcddgmp.la
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o fourier_gmp fourier.o ../lib-src-gmp/libcddgmp.la
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o adjacency_gmp adjacency.o ../lib-src-gmp/libcddgmp.la
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o testlp2_gmp testlp2.o ../lib-src-gmp/libcddgmp.la
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o testlp3_gmp testlp3.o ../lib-src-gmp/libcddgmp.la
libtool: link: gcc -g -O2 -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o .libs/projection_gmp projection.o  -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib ../lib-src-gmp/.libs/libcddgmp.dylib
Undefined symbols for architecture x86_64:
  "___gmpq_init", referenced from:
      _main in projection.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[1]: *** [projection_gmp] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: link: gcc -g -O2 -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o .libs/adjacency_gmp adjacency.o  -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib ../lib-src-gmp/.libs/libcddgmp.dylib
libtool: link: gcc -g -O2 -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o .libs/fourier_gmp fourier.o  -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib ../lib-src-gmp/.libs/libcddgmp.dylib
Undefined symbols for architecture x86_64:
  "___gmpq_clear", referenced from:
      _main in adjacency.o
  "___gmpq_init", referenced from:
      _main in adjacency.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[1]: *** [adjacency_gmp] Error 1
Undefined symbols for architecture x86_64:
  "___gmpq_clear", referenced from:
      _main in fourier.o
  "___gmpq_init", referenced from:
      _main in fourier.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[1]: *** [fourier_gmp] Error 1
libtool: link: gcc -g -O2 -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o .libs/testlp3_gmp testlp3.o  -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib ../lib-src-gmp/.libs/libcddgmp.dylib
libtool: link: gcc -g -O2 -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -o .libs/testlp2_gmp testlp2.o  -L/usr/local/lib -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib ../lib-src-gmp/.libs/libcddgmp.dylib
Undefined symbols for architecture x86_64:
  "___gmpq_set_si", referenced from:
      _main in testlp2.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[1]: *** [testlp2_gmp] Error 1
make: *** [install-recursive] Error 1
===============================[ ERROR: CDDLib ]================================

LoadError: failed process: Process(setenv(`make -j8 install`,Union{ASCIIString,UTF8String}["LSCOLORS=exfxcxdxbxGxDxabagacad","PATH=/Users/huchette/.julia/v0.4/CDDLib/deps/usr/bin:/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin:/Applications/Julia-0.4.5.app/Contents/Resources/julia/libexec/git-core:/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin:/Applications/Julia-0.4.5.app/Contents/Resources/julia/libexec/git-core:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Users/huchette/baron-osx64:/usr/texbin/","EDITOR=nano","LD_LIBRARY_PATH=/Users/huchette/Applications/ILOG/CPLEX_Studio126/cplex/bin/x86-64_osx","TEXINPUTS=:/Users/huchette/Dropbox/latex/sty","TK_LIBRARY=/System/Library/Frameworks/Tk.framework/Versions/8.5/Resources/Scripts","GREP_COLOR=37;45","ITERM_PROFILE=Default","LESS_TERMCAP_us=\e[01;32m","LESS_TERMCAP_mb=\e[01;31m","VISUAL=nano","GIT_TEMPLATE_DIR=/Applications/Julia-0.4.5.app/Contents/Resources/julia/share/git-core","Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.dPsnp0yqso/Render","USER=huchette","GREP_COLORS=mt=37;45","LESS=-F -g -i -M -R -S -w -X -z-4","vcs_info_msg_0_=.","SHELL=/bin/zsh","TMPDIR=/var/folders/gb/yjt8smfx2v51bvshtc_hdxy80000gn/T/","LESS_TERMCAP_me=\e[0m","LESS_TERMCAP_so=\e[00;47;30m","LESS_TERMCAP_se=\e[0m","ITERM_SESSION_ID=w0t0p1:D20DBE3D-E1FA-44D9-AA6E-3AC57778D18C","TERM=xterm-256color","HOME=/Users/huchette","XPC_FLAGS=0x0","LESS_TERMCAP_md=\e[01;31m","XPC_SERVICE_NAME=0","GIT_EXEC_PATH=/Applications/Julia-0.4.5.app/Contents/Resources/julia/libexec/git-core","__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0","BROWSER=open","LANG=en_US.UTF-8","LOGNAME=huchette","SHLVL=1","BARON_EXEC=/Users/huchette/baron-osx64/baron","SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.GhimodtFUS/Listeners","OLDPWD=/Users/huchette/.julia/v0.4/CollisionAvoidance","_=/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin/julia","PAGER=less","LESS_TERMCAP_ue=\e[0m","SECURITYSESSIONID=186a7","TERM_PROGRAM_VERSION=2.9.20160426","COMMAND_MODE=unix2003","PWD=/Users/huchette/.julia/v0.4/METADATA","DISPLAY=/private/tmp/com.apple.launchd.i1z2XTnpdz/org.macosforge.xquartz:0","TERM_PROGRAM=iTerm.app","CPPFLAGS= -I/Users/huchette/.julia/v0.4/CDDLib/deps/usr/include -I/Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src -I/Users/huchette/.julia/v0.4/CDDLib/deps/src/cddlib-d26c8f8a4c9443d886f95201e1356b74b9408ac5/lib-src-gmp","FONTCONFIG_PATH=/Applications/Julia-0.4.5.app/Contents/Resources/julia/etc/fonts","LDFLAGS= -L/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib -Wl,-rpath -Wl,/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib","TERM_SESSION_ID=w0t0p1:D20DBE3D-E1FA-44D9-AA6E-3AC57778D18C","PKG_CONFIG_PATH=/Users/huchette/.julia/v0.4/CDDLib/deps/usr/lib/pkgconfig","vcs_info_msg_1_=METADATA/git/metadata-v2 ","LS_COLORS=di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:","OPENBLAS_MAIN_FREE=1"]), ProcessExited(2)) [2]
while loading /Users/huchette/.julia/v0.4/CDDLib/deps/build.jl, in expression starting on line 60

================================================================================

===================================================[ BUILD ERRORS ]===================================================

WARNING: CDDLib had build errors.

 - packages with build errors remain installed in /Users/huchette/.julia/v0.4
 - build the package(s) and all dependencies with `Pkg.build("CDDLib")`
 - build a single package by running its `deps/build.jl` script

======================================================================================================================

@joehuchette
Copy link
Author

Looking over the repo, it appears that the issue is likely with a missing gmp header. However, I'm not sure how to track it down on OSX; AFAICT Homebrew doesn't have a dev version of gmp like pacman and friends.

@blegat
Copy link
Member

blegat commented May 4, 2016

Yes, Julia installs GMP libraries but not necessarily GMP headers :(
On Travis, both GMP headers and libraries were already there for Mac and for Linux I just had to add the libgmp-dev package.
Windows isn't supported yet and I thought all Mac would have the headers but apparently this is not the case :'(

@blegat
Copy link
Member

blegat commented May 4, 2016

Maybe I should just download GMP, unzip it and link to the headers like that. This sounds ugly since it may not be same version as the version of the libraries already installed by Julia but this could also work for Windows... Or maybe I should check how Julia handles the GMP installation and try to do something similar

@blegat
Copy link
Member

blegat commented May 4, 2016

It seems that what Julia does is either use GMP from a package manager of build GMP 6.1.0 from scratch (that might be the solution used for Windows).
If I can find a way to check whether the headers are available, I could just download GMP 6.1.0 if it is not the case.
Or maybe the easiest way would be to patch cddlib to let it handle it ^^ For instance GLPK.jl does not seem to worry to much about GMP in its deps/build.jl because I guess that glpk does all the job

@blegat
Copy link
Member

blegat commented May 10, 2016

I just looked more closely at your error. It seems that you have GMP and the issue is rather that you do not have -lgmp in the link commands that fail.
Which version of CDDLib.jl are you using ? Did you do Pkg.checkout("CDDLib") ?

@joehuchette
Copy link
Author

joehuchette commented May 10, 2016

Wow, I could've sworn I tried this before...it's working now (after checking out)! Thanks a bunch.

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

2 participants