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

More 10.9 brew install issues for --HEAD #66

Closed
gibiansky opened this issue Feb 12, 2014 · 32 comments
Closed

More 10.9 brew install issues for --HEAD #66

gibiansky opened this issue Feb 12, 2014 · 32 comments

Comments

@gibiansky
Copy link

I am running the following command:

brew install --HEAD julia -v

This gives me an error about OpenBLAS and not knowing the target. I fix that by installing openblas-julia with --target=SANDYBRIDGE. I am on a new Mac 10.9, so I think that's what I want.

I rerun the previous command and get this error:

Error: julia did not build
Logs:
     /Users/silver/Library/Logs/Homebrew/julia/01.make
     /Users/silver/Library/Logs/Homebrew/julia/02.make

This is not very informative. The whole command output is a bunch of compilation messages (using clang) and then the following messages from make:

yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... 13 warnings generated.
yes
touch -c openlibm/libopenlibm.dylib
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if clang -stdlib=libc++ -mmacosx-version-min=10.7 supports -fno-rtti -fno-exceptions... yes
checking for clang -stdlib=libc++ -mmacosx-version-min=10.7 option to produce PIC... -fno-common -DPIC
checking if clang -stdlib=libc++ -mmacosx-version-min=10.7 PIC flag -fno-common -DPIC works... yes
checking if clang -stdlib=libc++ -mmacosx-version-min=10.7 static flag -static works... no
checking if clang -stdlib=libc++ -mmacosx-version-min=10.7 supports -c -o file.o... yes
checking if clang -stdlib=libc++ -mmacosx-version-min=10.7 supports -c -o file.o... (cached) yes
checking whether the clang -stdlib=libc++ -mmacosx-version-min=10.7 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin13.0.2 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for dlopen in -ldl... yes
checking for kstat_lookup in -lkstat... no
checking for kvm_open in -lkvm... no
checking for gethostbyname in -lnsl... no
checking for perfstat_cpu in -lperfstat... no
checking for pthread_mutex_init in -lpthread... yes
checking for clock_gettime in -lrt... no
checking for sendfile in -lsendfile... no
checking for socket in -lsocket... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for dtrace... dtrace
checking if dtrace works... yes
checking if dtrace should instrument object files... no
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
touch -c libuv/config.status
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2
==> Formula
Tap: staticfloat/julia
Path: /Users/silver/dev/homebrew/Library/Taps/staticfloat-julia/julia.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: a9077af885e0cc708b535203e7a39866473b2702
HOMEBREW_PREFIX: /Users/silver/dev/homebrew
CPU: 8-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
X11: 2.7.5 => /opt/X11
==> ENV
CFLAGS: -Os -w -pipe -march=native -mmacosx-version-min=10.9
CXXFLAGS: -Os -w -pipe -march=native -mmacosx-version-min=10.9
CPPFLAGS: -I/Users/silver/dev/homebrew/opt/suite-sparse-julia/include -I/Users/silver/dev/homebrew/opt/openblas-julia/include -I/Users/silver/dev/homebrew/opt/llvm/include -I/Users/silver/dev/homebrew/opt/readline/include -isystem/Users/silver/dev/homebrew/include -F/Users/silver/dev/homebrew/Frameworks
LDFLAGS: -L/Users/silver/dev/homebrew/opt/suite-sparse-julia/lib -L/Users/silver/dev/homebrew/opt/arpack-julia/lib -L/Users/silver/dev/homebrew/opt/openblas-julia/lib -L/Users/silver/dev/homebrew/opt/llvm/lib -L/Users/silver/dev/homebrew/opt/readline/lib -L/Users/silver/dev/homebrew/lib  -F/Users/silver/dev/homebrew/Frameworks -Wl,-headerpad_max_install_names -headerpad_max_install_names
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /Users/silver/dev/homebrew/opt/suite-sparse-julia:/Users/silver/dev/homebrew/opt/arpack-julia:/Users/silver/dev/homebrew/opt/openblas-julia:/Users/silver/dev/homebrew/opt/llvm:/Users/silver/dev/homebrew/opt/readline:/Users/silver/dev/homebrew
CMAKE_FRAMEWORK_PATH: /Users/silver/dev/homebrew/Frameworks
MACOSX_DEPLOYMENT_TARGET: 10.9
PKG_CONFIG_PATH: /Users/silver/dev/homebrew/opt/arpack-julia/lib/pkgconfig
PKG_CONFIG_LIBDIR: /Users/silver/dev/homebrew/lib/pkgconfig:/Users/silver/dev/homebrew/Library/ENV/pkgconfig/10.9:/usr/lib/pkgconfig
PATH: /Users/silver/dev/homebrew/opt/arpack-julia/bin:/Users/silver/dev/homebrew/opt/llvm/bin:.:/Users/silver/.vim/foreign/zsh/fasd:/Users/silver/.cabal/bin:/Users/silver/dev/ghc/bin:/Users/silver/dev/homebrew/bin:/Users/silver/dev/z3/bin:/usr/texbin:/Applications/MATLAB_R2013a.app/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/Users/silver/dev/homebrew/Library/Contributions/cmd
CPATH: /Users/silver/dev/homebrew/include

Error: julia did not build
Logs:
     /Users/silver/Library/Logs/Homebrew/julia/01.make
     /Users/silver/Library/Logs/Homebrew/julia/02.make

These open issues may also help:
julia failed to build on 10.7.5 (https://github.com/Homebrew/homebrew/issues/17030)
`set_cpu_flags` causing errors when building julia (https://github.com/Homebrew/homebrew/issues/19921)

The log files are make0.1 and make.02.

What's going on?! I've looked around everywhere (including issues lists for this repo and julia) and cannot figure it out.

@gibiansky
Copy link
Author

The same thing happens without --HEAD, FYI.

@tapeinosyne
Copy link

This might not be the cause of your issue, but you are passing OpenBLAS the wrong target. According to the compilation log, you are on a Haswell machine: CPU: 8-core 64-bit haswell. Try compiling with --target=HASWELL.

@staticfloat
Copy link
Owner

It also looks like libosxunwind isn't compiling properly. (I got that from lines 25-27 of Make.02) What is the output of brew doctor and brew --config?

@gibiansky
Copy link
Author

@ndr-qef That's what I did at first, but I get this:

$ brew install --target=HASWELL openblas-julia 
==> Downloading http://github.com/xianyi/OpenBLAS/archive/v0.2.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/openblas-julia-0.2.8.tar.gz
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> make FC=/Users/silver/dev/homebrew/bin/gfortran TARGET=HASWELL
                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [getarch_2nd] Error 1
Makefile:129: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.

What's up with this...?

@gibiansky
Copy link
Author

@staticfloat

My brew setup is a bit unusual, so brew doctor complains about some things:

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /usr/local/bin/llvm-config
    /usr/local/bin/pcre-config

Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!

Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:

    brew install openblas-julia openssl

(Note that openblas-julia is broken b/c I just removed it so I could follow @ndr-qef's suggestion above... which fails... not sure why. openblas-julia existed before, though.)

brew --config outputs:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: a9077af885e0cc708b535203e7a39866473b2702
HOMEBREW_PREFIX: /Users/silver/dev/homebrew
HOMEBREW_CELLAR: /Users/silver/dev/homebrew/Cellar
CPU: 8-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
GCC-4.2: build 5666
Clang: 5.0 build 500
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

@staticfloat
Copy link
Owner

Please pass a -v flag to brew install so that we can see what's going
haywire with the openblas install. :)

On Wed, Feb 12, 2014 at 12:41 PM, Andrew Gibiansky <[email protected]

wrote:

@staticfloat https://github.com/staticfloat

My brew setup is a bit unusual, so brew doctor complains about some
things:

Warning: "config" scripts exist outside your system or Homebrew directories.
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

/usr/local/bin/llvm-config
/usr/local/bin/pcre-config

Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!

Warning: Some installed formula are missing dependencies.
You should brew install the missing dependencies:

brew install openblas-julia openssl

(Note that openblas-julia is broken b/c I just removed it so I could
follow @ndr-qef https://github.com/ndr-qef's suggestion above... which
fails... not sure why. openblas-julia existed before, though.)

brew --config outputs:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: a9077af
HOMEBREW_PREFIX: /Users/silver/dev/homebrew
HOMEBREW_CELLAR: /Users/silver/dev/homebrew/Cellar
CPU: 8-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
GCC-4.2: build 5666
Clang: 5.0 build 500
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

Reply to this email directly or view it on GitHubhttps://github.com//issues/66#issuecomment-34915001
.

@gibiansky
Copy link
Author

With -v to brew install and --target=HASWELL:

$ brew install --target=haswell openblas-julia -v
==> Downloading http://github.com/xianyi/OpenBLAS/archive/v0.2.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/openblas-julia-0.2.8.tar.gz
==> Verifying openblas-julia-0.2.8.tar.gz checksum
tar xf /Library/Caches/Homebrew/openblas-julia-0.2.8.tar.gz
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> make FC=/Users/silver/dev/homebrew/bin/gfortran TARGET=haswell
getarch_2nd.c:12:35: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_M'
    printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:13:35: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_N'
    printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
                                  ^
getarch_2nd.c:14:35: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_M'
    printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:15:35: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_N'
    printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
                                  ^
getarch_2nd.c:19:35: error: use of undeclared identifier 'CGEMM_DEFAULT_UNROLL_M'
    printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:20:35: error: use of undeclared identifier 'CGEMM_DEFAULT_UNROLL_N'
    printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N);
                                  ^
getarch_2nd.c:21:35: error: use of undeclared identifier 'ZGEMM_DEFAULT_UNROLL_M'
    printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:22:35: error: use of undeclared identifier 'ZGEMM_DEFAULT_UNROLL_N'
    printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N);
                                  ^
getarch_2nd.c:29:37: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_M'
    printf("CGEMM3M_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
                                    ^
getarch_2nd.c:35:37: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_N'
    printf("CGEMM3M_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
                                    ^
getarch_2nd.c:41:37: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_M'
    printf("ZGEMM3M_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
                                    ^
getarch_2nd.c:47:37: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_N'
    printf("ZGEMM3M_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
                                    ^
getarch_2nd.c:67:50: error: use of undeclared identifier 'SGEMM_DEFAULT_Q'
    printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 *  sizeof(float)));
                                                 ^
getarch_2nd.c:67:68: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_N'
    printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 *  sizeof(float)));
                                                                   ^
getarch_2nd.c:68:50: error: use of undeclared identifier 'DGEMM_DEFAULT_Q'
    printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 *  sizeof(double)));
                                                 ^
getarch_2nd.c:68:68: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_N'
    printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 *  sizeof(double)));
                                                                   ^
getarch_2nd.c:69:50: error: use of undeclared identifier 'CGEMM_DEFAULT_Q'
    printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 *  sizeof(float)));
                                                 ^
getarch_2nd.c:69:68: error: use of undeclared identifier 'CGEMM_DEFAULT_UNROLL_N'
    printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 *  sizeof(float)));
                                                                   ^
getarch_2nd.c:70:50: error: use of undeclared identifier 'ZGEMM_DEFAULT_Q'
    printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 *  sizeof(double)));
                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [getarch_2nd] Error 1
Makefile:129: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
==> Formula
Tap: staticfloat/julia
Path: /Users/silver/dev/homebrew/Library/Taps/staticfloat-julia/openblas-julia.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: a9077af885e0cc708b535203e7a39866473b2702
HOMEBREW_PREFIX: /Users/silver/dev/homebrew
CPU: 8-core 64-bit haswell
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
X11: 2.7.5 => /opt/X11
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
CFLAGS: 
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /Users/silver/dev/homebrew
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/Users/silver/dev/homebrew/Library/ENV/pkgconfig/10.9
HOMEBREW_VERBOSE: 1
ACLOCAL_PATH: /Users/silver/dev/homebrew/share/aclocal
PATH: /Users/silver/dev/homebrew/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin```

@tapeinosyne
Copy link

You seem to be encountering OpenMathLib/OpenBLAS#320. I can confirm that it happens on my Haswell machine as well.

The most immediate solution is simply to compile OpenBLAS from --HEAD, where the issue is fixed.

@gibiansky
Copy link
Author

@ndr-qef Thanks. Using it with --HEAD seems to have made it succeed.

brew install julia -v (or brew install --HEAD julia -v) fails with the same error.

@staticfloat
Copy link
Owner

@gibiansky Do you know what the llvm-config script is doing there in your /usr/local/bin/? That can possibly screw things up.

Have you tried downloading Julia and compiling directly? (That is, run: git clone https://github.com/JuliaLang/julia.git; cd julia; make) That might be a good thing to do just to make certain that your toolchain isn't somehow screwed up. I've never seen libosxunwind just fail to compile like that, so something is funky with your environment, we just need to track down what. :)

@gibiansky
Copy link
Author

Nope! No idea what's up with that llvm-config. I compiled Julia from source earlier, and it didn't screw up on libosxunwind. I had it compiling just fine (essentially) though with some kerfuffles about OpenBlas (it compiled, but then running the Julia executable gave me some issues with 64/32 bit BLAS, etc). I'm going to re-do it right now to see if I can reproduce any issues, but I was definitely not seeing this libosxunwind issue.

@gibiansky
Copy link
Author

Though at some point it could not find llc. Then at some point later I did brew install llvm and then brew link llvm, found that that wasn't helpful, and did brew unlinke llvm. Maybe brew left some stuff somewhere? That would be strange, imho.

@gibiansky
Copy link
Author

Hmm. If I compile Julia I get this error.

@staticfloat
Copy link
Owner

Now that that llvm-config script is gone, are you able to compile this properly?

@gibiansky
Copy link
Author

Working on it. Uninstalled openblas-julia, reinstalling with

brew install --HEAD --target=HASWELL openblas-julia

(to make sure I have that set up properly).

Will then run brew install --HEAD julia and see what happens.

@gibiansky
Copy link
Author

The command to install openblas-julia succeeds without error. The installation of julia breaks as before (I think it's exactly the same? not sure) with these logs.

@gibiansky
Copy link
Author

Looks like a strange issue with

#include <new>

I'm not very good with C++, but could this have anything to do with Mavericks shipping with "clang" named "gcc"? (I don't know how to specify a different compiler, but I have gcc-4.8 installed and could somehow use that?)

@staticfloat
Copy link
Owner

Can you run:

$ brew install -vi --HEAD julia

This will drop you into a shell with the environment that Homebrew uses to install packages, with Julia unpacked and ready to build. Run:

$ BUILD_OPTS="prefix=/usr/local/Cellar/julia/HEAD USE_BLAS64=0 USECLANG=1 LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas USE_SYSTEM_ZLIB=1 USE_SYSTEM_FFTW=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_GLPK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_LLVM=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_LAPACK=1"

So that we can just slap $BUILD_OPTS on to the end of our make incantations and don't have to worry about typing all that in every time. Next, run:

$ make -C contrib -f repackage_system_suitesparse4.make $BUILD_OPTS

When that finishes just fine, let's immediately try to build libosxunwind:

$ mkdir -p usr/include
$ make -C deps install-osxunwind

@gibiansky
Copy link
Author

-vi is the coolest thing! I didn't know about that.

...and... no errors? I think? Here's the full output (not including the downloading messages):

...more stuff above...
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9.1) https://gist.github.com/staticfloat/3806093/raw/cb34c7262b9130f0e9e07641a66fccaa0d08b5d2/deps.Makefile.diff -o 000-homebrew.diff
######################################################################## 100.0%
==> Patching
/usr/bin/patch -g 0 -f -p1 -i 000-homebrew.diff
patching file deps/Makefile
Hunk #1 succeeded at 1333 (offset 679 lines).
==> Entering interactive mode
Type `exit' to return and finalize the installation
Install to this prefix: /Users/silver/dev/homebrew/Cellar/julia/HEAD
E_SYSTEM_READLINE=1 USE_SYSTEM_GLPK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_LLVM=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_LAPACK=1"

[10436] [!!!] 14:32:12 silver@vortex /pr/tmp/julia-BM6O (master...) ⇒   make -C contrib -f repackage_system_suitesparse4.make $BUILD_OPTS 

mkdir -p /private/tmp/julia-BM6O/usr/lib
mkdir -p /private/tmp/julia-BM6O/deps/SuiteSparse-SYSTEM/lib
cd /private/tmp/julia-BM6O/deps/SuiteSparse-SYSTEM/lib && \
    rm -f /private/tmp/julia-BM6O/usr/lib/lib{amd,cholmod,colamd,spqr,umfpack}.dylib && \
    clang -stdlib=libc++ -mmacosx-version-min=10.7 -shared -Xlinker -all_load /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libamd.a  -o /private/tmp/julia-BM6O/usr/lib/libamd.dylib && \
    install_name_tool -id @rpath/libamd.dylib /private/tmp/julia-BM6O/usr/lib/libamd.dylib && \
    clang -stdlib=libc++ -mmacosx-version-min=10.7 -shared -Xlinker -all_load /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libcolamd.a   -o /private/tmp/julia-BM6O/usr/lib/libcolamd.dylib && \
    install_name_tool -id @rpath/libcolamd.dylib /private/tmp/julia-BM6O/usr/lib/libcolamd.dylib && \
    clang++ -stdlib=libc++ -mmacosx-version-min=10.7 -shared -Xlinker -all_load /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libsuitesparseconfig.a /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libcholmod.a   -o /private/tmp/julia-BM6O/usr/lib/libcholmod.dylib -L/private/tmp/julia-BM6O/usr/lib -L/Users/silver/dev/homebrew/opt/suite-sparse-julia/lib -L/Users/silver/dev/homebrew/opt/arpack-julia/lib -L/Users/silver/dev/homebrew/opt/openblas-julia/lib -L/Users/silver/dev/homebrew/opt/llvm/lib -L/Users/silver/dev/homebrew/opt/readline/lib -L/Users/silver/dev/homebrew/lib  -F/Users/silver/dev/homebrew/Frameworks -Wl,-headerpad_max_install_names -lcolamd -lccolamd -lcamd -lamd -L/private/tmp/julia-BM6O/usr/lib -lopenblas  && \
    install_name_tool -id @rpath/libcholmod.dylib /private/tmp/julia-BM6O/usr/lib/libcholmod.dylib && \
    clang++ -stdlib=libc++ -mmacosx-version-min=10.7 -shared -Xlinker -all_load /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libsuitesparseconfig.a /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libumfpack.a   -o /private/tmp/julia-BM6O/usr/lib/libumfpack.dylib -L/private/tmp/julia-BM6O/usr/lib -L/Users/silver/dev/homebrew/opt/suite-sparse-julia/lib -L/Users/silver/dev/homebrew/opt/arpack-julia/lib -L/Users/silver/dev/homebrew/opt/openblas-julia/lib -L/Users/silver/dev/homebrew/opt/llvm/lib -L/Users/silver/dev/homebrew/opt/readline/lib -L/Users/silver/dev/homebrew/lib  -F/Users/silver/dev/homebrew/Frameworks -Wl,-headerpad_max_install_names -lcholmod -lcolamd -lamd -L/private/tmp/julia-BM6O/usr/lib -lopenblas  && \
    install_name_tool -id @rpath/libumfpack.dylib /private/tmp/julia-BM6O/usr/lib/libumfpack.dylib && \
    clang++ -stdlib=libc++ -mmacosx-version-min=10.7 -shared -Xlinker -all_load /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libsuitesparseconfig.a /Users/silver/dev/homebrew/opt/suite-sparse-julia/lib/libspqr.a   -o /private/tmp/julia-BM6O/usr/lib/libspqr.dylib -L/private/tmp/julia-BM6O/usr/lib -L/Users/silver/dev/homebrew/opt/suite-sparse-julia/lib -L/Users/silver/dev/homebrew/opt/arpack-julia/lib -L/Users/silver/dev/homebrew/opt/openblas-julia/lib -L/Users/silver/dev/homebrew/opt/llvm/lib -L/Users/silver/dev/homebrew/opt/readline/lib -L/Users/silver/dev/homebrew/lib  -F/Users/silver/dev/homebrew/Frameworks -Wl,-headerpad_max_install_names -lcholmod -lcolamd -lamd -L/private/tmp/julia-BM6O/usr/lib -lopenblas  && \
    install_name_tool -id @rpath/libspqr.dylib /private/tmp/julia-BM6O/usr/lib/libspqr.dylib

[10437] [!!!] 14:32:25 silver@vortex /pr/tmp/julia-BM6O (master...) ⇒ mkdir -p usr/include

[10438] [!!!] 14:32:32 silver@vortex /pr/tmp/julia-BM6O (master...) ⇒ make -C deps install-osxunwind 

/private/tmp/julia-BM6O/deps/jldownload libosxunwind-0.0.1-rc3.tar.gz https://github.com/JuliaLang/libosxunwind/archive/v0.0.1-rc3.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0    276      0 --:--:-- --:--:-- --:--:--   276
100 84226  100 84226    0     0  48560      0  0:00:01  0:00:01 --:--:--  143k
`which gtar 2>/dev/null || which tar 2>/dev/null` xfz libosxunwind-0.0.1-rc3.tar.gz
touch -c libosxunwind-0.0.1-rc3/Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C libosxunwind-0.0.1-rc3 ARCH="x86_64" CC="clang -stdlib=libc++ -mmacosx-version-min=10.7" FC="gfortran -mmacosx-version-min=10.7" AR="ar" OS="Darwin" USECLANG=1 USEGCC=0 CFLAGS="-ggdb3 -O0" CXXFLAGS="-ggdb3 -O0" SFLAGS="-ggdb3" LDFLAGS="-Wl,-macosx_version_min,10.7"
clang -stdlib=libc++ -mmacosx-version-min=10.7 -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/src -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/include -DNDEBUG -I/Users/silver/dev/homebrew/opt/suite-sparse-julia/include -I/Users/silver/dev/homebrew/opt/openblas-julia/include -I/Users/silver/dev/homebrew/opt/llvm/include -I/Users/silver/dev/homebrew/opt/readline/include -isystem/Users/silver/dev/homebrew/include -F/Users/silver/dev/homebrew/Frameworks -std=c99 -Wall -O3  -ggdb3 -O0 -c src/Unwind-sjlj.c -o src/Unwind-sjlj.c.o
clang -stdlib=libc++ -mmacosx-version-min=10.7 -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/src -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/include -DNDEBUG -I/Users/silver/dev/homebrew/opt/suite-sparse-julia/include -I/Users/silver/dev/homebrew/opt/openblas-julia/include -I/Users/silver/dev/homebrew/opt/llvm/include -I/Users/silver/dev/homebrew/opt/readline/include -isystem/Users/silver/dev/homebrew/include -F/Users/silver/dev/homebrew/Frameworks -std=c99 -Wall -O3  -ggdb3 -O0 -c src/UnwindLevel1-gcc-ext.c -o src/UnwindLevel1-gcc-ext.c.o
clang -stdlib=libc++ -mmacosx-version-min=10.7 -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/src -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/include -DNDEBUG -I/Users/silver/dev/homebrew/opt/suite-sparse-julia/include -I/Users/silver/dev/homebrew/opt/openblas-julia/include -I/Users/silver/dev/homebrew/opt/llvm/include -I/Users/silver/dev/homebrew/opt/readline/include -isystem/Users/silver/dev/homebrew/include -F/Users/silver/dev/homebrew/Frameworks -std=c99 -Wall -O3  -ggdb3 -O0 -c src/UnwindLevel1.c -o src/UnwindLevel1.c.o
make[1]: Circular src/libuwind.cxx <- src/libuwind.cxx.o dependency dropped.
clang -stdlib=libc++ -mmacosx-version-min=10.7 -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/src -I/private/tmp/julia-BM6O/deps/libosxunwind-0.0.1-rc3/include -DNDEBUG -I/Users/silver/dev/homebrew/opt/suite-sparse-julia/include -I/Users/silver/dev/homebrew/opt/openblas-julia/include -I/Users/silver/dev/homebrew/opt/llvm/include -I/Users/silver/dev/homebrew/opt/readline/include -isystem/Users/silver/dev/homebrew/include -F/Users/silver/dev/homebrew/Frameworks -std=c++11 -Wall -O3  -ggdb3 -O0 -c src/libuwind.cxx -o src/libuwind.cxx.o
clang -stdlib=libc++ -mmacosx-version-min=10.7 -ggdb3  -c src/unw_getcontext.s -o src/unw_getcontext.s.o
clang -stdlib=libc++ -mmacosx-version-min=10.7 -ggdb3  -c src/Registers.s -o src/Registers.s.o
ar -rcs libosxunwind.a src/Unwind-sjlj.c.o src/UnwindLevel1-gcc-ext.c.o src/UnwindLevel1.c.o src/libuwind.cxx.o src/unw_getcontext.s.o src/Registers.s.o
clang -stdlib=libc++ -mmacosx-version-min=10.7 -shared -nodefaultlibs -Wl,-upward-lSystem -Wl,-umbrella,System -lstdc++ src/Unwind-sjlj.c.o src/UnwindLevel1-gcc-ext.c.o src/UnwindLevel1.c.o src/libuwind.cxx.o src/unw_getcontext.s.o src/Registers.s.o -Wl,-macosx_version_min,10.7 -o libosxunwind.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libosxunwind.a(Unwind-sjlj.c.o) has no symbols
touch -c libosxunwind-0.0.1-rc3/libosxunwind.dylib
cp libosxunwind-0.0.1-rc3/libosxunwind.a /private/tmp/julia-BM6O/usr/lib/libosxunwind.a
cp libosxunwind-0.0.1-rc3/libosxunwind.dylib /private/tmp/julia-BM6O/usr/lib/libosxunwind.dylib
cp -R libosxunwind-0.0.1-rc3/include/* /private/tmp/julia-BM6O/usr/include
install_name_tool -id @rpath/libosxunwind.dylib /private/tmp/julia-BM6O/usr/lib/libosxunwind.dylib

Should I run something next?

@staticfloat
Copy link
Owner

Go ahead and go for the gold:

$ make $BUILD_OPTS

Let's see what it dies on. And yes, brew has a lot of hidden gems like that. :)

@gibiansky
Copy link
Author

It dies, but I'm not sure on what. Here are the last several lines of the output:

Making all in m4
libtool: link: clang -stdlib=libc++ -mmacosx-version-min=10.7 -D_THREAD_SAFE -Os -w -pipe -march=native -mmacosx-version-min=10.9 -F/Users/silver/dev/homebrew/Frameworks -Wl,-headerpad_max_install_names -o .libs/fftw-wisdom fftw_wisdom-fftw-wisdom.o ../tests/bench-bench.o ../tests/bench-fftw-bench.o  -L/Users/silver/dev/homebrew/opt/suite-sparse-julia/lib -L/Users/silver/dev/homebrew/opt/arpack-julia/lib -L/Users/silver/dev/homebrew/opt/openblas-julia/lib -L/Users/silver/dev/homebrew/opt/llvm/lib -L/Users/silver/dev/homebrew/opt/readline/lib -L/Users/silver/dev/homebrew/lib ../threads/.libs/libfftw3_threads.dylib /private/tmp/julia-BM6O/deps/fftw-3.3.3-double/.libs/libfftw3.dylib ../.libs/libfftw3.dylib ../libbench2/libbench2.a -lm
Making all in m4
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2

Given that there's probably several thousand lines of output total, I'm not sure where to look...

@staticfloat
Copy link
Owner

Run make $BUILD_OPTS again. It will try to rebuild the ones that failed first.

@gibiansky
Copy link
Author

So, interestingly enough, it seems to be proceeding past a bunch of errors:

Making check in sse2
getarch_2nd.c:12:35: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_M'
    printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:13:35: error: use of undeclared identifier 'SGEMM_DEFAULT_UNROLL_N'
    printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
                                  ^
getarch_2nd.c:14:35: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_M'
    printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
                                  ^
getarch_2nd.c:15:35: error: use of undeclared identifier 'DGEMM_DEFAULT_UNROLL_N'
    printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
                                  ^

These are the usual OpenBlas errors. What's going on? I have openblas-julia installed. And adding OPENBLAS_TARGET=HASWELL does nothing. Do I somehow need to tell it to use develop branch of OpenBlas? I'm confused.

@gibiansky
Copy link
Author

Perhaps I should just edit deps/Versions.make again, as it looks like it uses 0.2.8, not develop. Trying that.

@staticfloat
Copy link
Owner

USE_SYSTEM_BLAS=1 should be disabling Julia from building OpenBLAS at all..... What does echo make $BUILD_OPTS show? (You did pass $BUILD_OPTS to make right? When I first submitted my comment it only said make, so if you're reading from email you may not have realized that you need to pass $BUILD_OPTS to make every time)

@gibiansky
Copy link
Author

Nope, I'm passing $BUILD_OPTS to make every time. It all looks right to me:

⇒ echo $BUILD_OPTS                             
prefix=/usr/local/Cellar/julia/HEAD USE_BLAS64=0 USECLANG=1 LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas USE_SYSTEM_ZLIB=1 USE_SYSTEM_FFTW=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_GLPK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_LLVM=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_LAPACK=1

@staticfloat
Copy link
Owner

Well this is really weird, because if Julia's make is getting USE_SYSTEM_BLAS=1, it shouldn't even be trying to compile OpenBLAS.

@staticfloat
Copy link
Owner

It should die later, when it can't find OpenBLAS, (That's why the Julia formula automatically copies in the OpenBLAS .dylib files, along with other Formula that need that to happen, but the errors you've been seeing are much earlier on in the build process than those)

@gibiansky
Copy link
Author

Trying to reproduce this cleanly. Will give you full output of everything soon... want to make sure I'm doing everything right.

@gibiansky
Copy link
Author

Here are full logs.

The commands that were run were:

$ history
10453  make distclean
10454  BUILD_OPTS="prefix=/usr/local/Cellar/julia/HEAD USE_BLAS64=0 USECLANG=1 LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas USE_SYSTEM_ZLIB=1 USE_SYSTEM_FFTW=1 USE_SYSTEM_READLINE=1 USE_SYSTEM_GLPK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_LLVM=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_SUITESPARSE=1 USE_SYSTEM_ARPACK=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_LAPACK=1"
10455  make -C contrib -f repackage_system_suitesparse4.make $BUILD_OPTS
10456  mkdir -p usr/include
10457  make -C deps install-osxunwind
10458  make $BUILD_OPTS &> ~/log
10459  cat log | pbcopy

@staticfloat
Copy link
Owner

Do you have a custom make version or something? I cannot figure out why passing arguments to make isn't working for you.... Also, I've updated a fair number of things in the Julia formula recently, brew update might help things a little bit.

@staticfloat
Copy link
Owner

Closing this for now, if oyu still have problems please open a new issue.

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

3 participants