From 8bb0d2cf87ee8a8ec86e1d7fd891832f6171a15d Mon Sep 17 00:00:00 2001 From: Judah Jacobson Date: Tue, 16 May 2017 15:18:01 -0700 Subject: [PATCH] Add extra-lib-dirs back into .cabal for Mac builds. (#122) Also bump the version to 0.1.0.2. Originally we had `extra-lib-dirs: /usr/local/lib` in `stack.yaml`. I removed it because it wasn't necessary on my Mac. However, it turns out that it is necessary for machines with the default installation of XCode, which *doesn't* search that path by default. (On my machine, it wasn't necessary because I had run `xcode-select --install` which adds that path permanently to your search path. For more context, see https://github.com/Homebrew/brew/issues/556.) I'm adding the setting back to `tensorflow.cabal` as well as `stack.yaml` so that the Hackage release also contains this fix. Changing `stack.yaml` is still necessary in order to fix linkage in the `snappy` package (which `tensorflow-records` depends on). Hopefully that will go away once we remove the dependency (#118). --- stack.yaml | 8 ++++++++ tensorflow/tensorflow.cabal | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index e260231..210a331 100644 --- a/stack.yaml +++ b/stack.yaml @@ -16,3 +16,11 @@ packages: extra-deps: - snappy-framing-0.1.1 - snappy-0.2.0.2 + +# For Mac OS X, whose linker doesn't use this path by default +# unless you run `xcode-select --install`. +# TODO: remove this once we stop depending on `snappy`. +extra-lib-dirs: + - /usr/local/lib +extra-include-dirs: + - /usr/local/include diff --git a/tensorflow/tensorflow.cabal b/tensorflow/tensorflow.cabal index 2ce4bb1..8b3e3b2 100644 --- a/tensorflow/tensorflow.cabal +++ b/tensorflow/tensorflow.cabal @@ -1,5 +1,5 @@ name: tensorflow -version: 0.1.0.1 +version: 0.1.0.2 synopsis: TensorFlow bindings. description: This library provides an interface to the TensorFlow @@ -61,6 +61,12 @@ library extra-libraries: tensorflow default-language: Haskell2010 include-dirs: . + if os(darwin) { + -- The default XCode installation doesn't search this path, so add it + -- manually. Alternately, users can run `xcode-select --install` to add + -- it permanently to their search path. + extra-lib-dirs: /usr/local/lib + } Test-Suite FFITest default-language: Haskell2010