Coder Social home page Coder Social logo

Comments (15)

camerondavison avatar camerondavison commented on April 20, 2024 1

I ran brew config and noticed that it said

Xcode: 8.3.2
CLT: N/A

So I installed CLT by running

xcode-select --install

Then I upgraded gcc from 5.3.0 to 7.1.0 using

brew upgrade gcc

and it I was then able to compile everything

from duckling.

niteria avatar niteria commented on April 20, 2024

Thanks for the report. I'm adding a note in the README.

from duckling.

almostimplemented avatar almostimplemented commented on April 20, 2024

Thanks -- and sorry: I hadn't seen #6 before raising the issue.

from duckling.

camerondavison avatar camerondavison commented on April 20, 2024

I am on mac 10.12.3 and ran brew install pcre and have pcre-8.40 installed, but it does not seem to have worked for me. Anything else that needs to be installed?

from duckling.

niteria avatar niteria commented on April 20, 2024

Hmm, interesting.

What does brew info pcre say?
What are the contents of /usr/local/Cellar/pcre/?
What does gcc -lpcre say?
Is the error message the same as above? If not, can you paste it?

from duckling.

schultz-is avatar schultz-is commented on April 20, 2024

i see the same issue. installing pcre from homebrew does install the development headers, but maybe not in the location the compiler is looking for

[10:36:52] schultz @ crux : ~/Repositories/duckling
% brew info pcre
pcre: stable 8.40 (bottled), HEAD
Perl compatible regular expressions library
http://www.pcre.org/
/usr/local/Cellar/pcre/8.40 (204 files, 5.4MB) *
  Built from source on 2017-05-09 at 10:34:10
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pcre.rb

[10:36:57] schultz @ crux : ~/Repositories/duckling
% ls /usr/local/Cellar/pcre
8.40

[10:37:03] schultz @ crux : ~/Repositories/duckling
% ls /usr/local/Cellar/pcre/8.40/include
pcre.h  pcre_scanner.h  pcre_stringpiece.h  pcrecpp.h  pcrecpparg.h  pcreposix.h

this is on macOS Sierra 10.12.4

from duckling.

niteria avatar niteria commented on April 20, 2024

@schultz-texas

What does gcc -lpcre return?
How about gcc --version?

from duckling.

schultz-is avatar schultz-is commented on April 20, 2024
[10:55:27] schultz @ crux : ~/Repositories/duckling
% gcc -lpcre
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

[10:55:30] schultz @ crux : ~/Repositories/duckling
% gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

i get the same result with actual gcc:

[10:56:24] schultz @ crux : ~/Repositories/duckling
% /usr/local/bin/gcc-7 -lpcre
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

from duckling.

niteria avatar niteria commented on April 20, 2024

That does look reasonable, are you compiling with stack?
Can you paste the compile error you get?

from duckling.

schultz-is avatar schultz-is commented on April 20, 2024

figured it out. the default pcre install doesn't seem to include development headers. submitted a pull request (#10) that includes updated documentation to pull source along with pcre homebrew package

from duckling.

camerondavison avatar camerondavison commented on April 20, 2024

I did

brew uninstall --ignore-dependencies pcre
HOMEBREW_BUILD_FROM_SOURCE=1 brew install pcre

then ran

stack build

and get

regex-pcre-0.94.4: configure
transformers-compat-0.5.1.4: download
timezone-series-0.1.6.1: download
haskell-src-exts-1.18.2: download
regex-pcre-0.94.4: build
timezone-series-0.1.6.1: configure
timezone-series-0.1.6.1: build
transformers-compat-0.5.1.4: configure
transformers-compat-0.5.1.4: build
haskell-src-exts-1.18.2: configure
haskell-src-exts-1.18.2: build
timezone-series-0.1.6.1: copy/register
transformers-compat-0.5.1.4: copy/register
haskell-src-exts-1.18.2: copy/register
Progress: 4/28
--  While building package regex-pcre-0.94.4 using:
      /Users/cameron/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/cameron/Code/duckling/.stack-work/logs/regex-pcre-0.94.4.log

    Configuring regex-pcre-0.94.4...
    Building regex-pcre-0.94.4...
    Preprocessing library regex-pcre-0.94.4...
    Wrap.hsc:148:10: fatal error: 'pcre.h' file not found    #include <pcre.h>
             ^
    1 error generated.
    compiling .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Text/Regex/PCRE/Wrap_hsc_make.c failed (exit code 1)
    command was: /usr/bin/gcc -c .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Text/Regex/PCRE/Wrap_hsc_make.c -o .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Text/Regex/PCRE/Wrap_hsc_make.o -m64 -fno-stack-protector -m64 -fno-stack-protector -m64 -D__GLASGOW_HASKELL__=800 -Ddarwin_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Ddarwin_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -DHAVE_PCRE_H -DSPLIT_BASE=1 -I.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen -include .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen/cabal_macros.h -I/Users/cameron/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1/include -I/Users/cameron/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/base-4.9.1.0/include -I/Users/cameron/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1/include -I/Users/cameron/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/include -I/Users/cameron/.stack/programs/x86_64-osx/ghc-8.0.2/lib/ghc-8.0.2/include/
$ brew info pcre
pcre: stable 8.40 (bottled), HEAD
Perl compatible regular expressions library
http://www.pcre.org/
/usr/local/Cellar/pcre/8.40 (204 files, 5.3MB) *
  Built from source on 2017-05-09 at 14:25:15
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pcre.rb
/usr/local/Cellar/pcre/
└── 8.40
    ├── AUTHORS
    ├── COPYING
    ├── ChangeLog
    ├── INSTALL_RECEIPT.json
    ├── LICENCE
    ├── NEWS
    ├── README
    ├── bin
    │   ├── pcre-config
    │   ├── pcregrep
    │   └── pcretest
    ├── include
    │   ├── pcre.h
    │   ├── pcre_scanner.h
    │   ├── pcre_stringpiece.h
    │   ├── pcrecpp.h
    │   ├── pcrecpparg.h
    │   └── pcreposix.h
    ├── lib
    │   ├── libpcre.1.dylib
    │   ├── libpcre.a
    │   ├── libpcre.dylib -> libpcre.1.dylib
    │   ├── libpcre16.0.dylib
    │   ├── libpcre16.a
    │   ├── libpcre16.dylib -> libpcre16.0.dylib
    │   ├── libpcre32.0.dylib
    │   ├── libpcre32.a
    │   ├── libpcre32.dylib -> libpcre32.0.dylib
    │   ├── libpcrecpp.0.dylib
    │   ├── libpcrecpp.a
    │   ├── libpcrecpp.dylib -> libpcrecpp.0.dylib
    │   ├── libpcreposix.0.dylib
    │   ├── libpcreposix.a
    │   ├── libpcreposix.dylib -> libpcreposix.0.dylib
    │   └── pkgconfig
    │       ├── libpcre.pc
    │       ├── libpcre16.pc
    │       ├── libpcre32.pc
    │       ├── libpcrecpp.pc
    │       └── libpcreposix.pc

... clipped out share/docs/man

$ gcc -lpcre
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

from duckling.

schultz-is avatar schultz-is commented on April 20, 2024

well dang. i'll run back through my terminal history and see if there is some other intermediate step or path that caused it to work for me

from duckling.

niteria avatar niteria commented on April 20, 2024

Ok, I checked on my system and gcc finds pcre.h in /usr/local/include/.
I've checked that it's brew that installs it there.

I'd suggest running brew doctor and fix the issues that it detects.
I expect it to find the issue described here: http://stackoverflow.com/questions/14527521/brew-doctor-says-warning-usr-local-include-isnt-writable

It may be that you'll have to reinstall pcre after you make /usr/local/include writable.

from duckling.

schultz-is avatar schultz-is commented on April 20, 2024

yeah, it's strange. seems to work fine on other machines for me. i can only imagine the reinstall of pcre i did fixed the issue for me. went ahead and closed out the pull request i opened since it now seems unrelated

from duckling.

mickume avatar mickume commented on April 20, 2024

The above worked for me as well, compiling is now OK after I installed gcc from brew.

from duckling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.