Giter Site home page Giter Site logo

Comments (5)

coltekin avatar coltekin commented on September 2, 2024

It seems to be a known issue with the Clang on MacOS. Using standard gcc preprocessor seems to be the easier solution. There are some discussion of how to solve the exact same issue here.

If installing/using standard gcc is not an option, please let me know. It should be posible to change the source to make sure it also compiles with Clang preprocessor.

from trmorph.

evanmiltenburg avatar evanmiltenburg commented on September 2, 2024

I also had issues on my mac, but I just compiled the fst file on a Linux computer and I can just use the fst file with foma on my mac. Maybe it's possible to have an "official" compiled fst file in this repository?

from trmorph.

keryil avatar keryil commented on September 2, 2024

I am writing this for future reference for people running into this issue, in case Cagri doesn't have time to fix this one. The workaround is quite simple, and only depends on Homebrew. People often use Homebrew to install foma on OS/X anyway.

The way I work around this issue is:

  1. Install GCC (through Homebrew i.e. brew install gcc).
  2. Discover the GCC binary. It is not /usr/bin/gcc, which is an alias for clang compiler on OS/X. It is often something along the lines of gcc-4.9 (depending on the version, of course). Confirm you got the right one by issuing the command gcc-4.9 -v. The output should tell you the details of the compiler. Look for words clang and homebrew to distinguish between the two, and make sure you get the one that contains homebrew.
  3. Modify the Makefile of the project (i.e. the file called Makefile in the TRmorph root). Find the lines that start with CPP=gcc... and MAKEDEP=gcc..., and replace gcc with the GCC binary you located in the previous step e.g. gcc-4.9.
  4. Make.

Hope this helps.

from trmorph.

snomos avatar snomos commented on September 2, 2024

Installing & using GCC is not an option for me. Could a solution be to replace all #'s with a reference to a new lexicon ENDLEX, and then define that lexicon as follows?

LEXICON ENDLEX # ;

That should hopefully resolve the issue, by "protecting" the hash mark using the preceding text.

from trmorph.

snomos avatar snomos commented on September 2, 2024

That pull request only solves the issue with #. Now I have a number of the following errors:

In file included from analyzer.lexc:43:
./lexicon/punctuation:8:17: error: invalid preprocessing directive
%:              Punc;
                ^
In file included from analyzer.lexc:51:
./lexicon/emoticon:37:4: error: invalid preprocessing directive
 %:-)           Interjection;
   ^
...

The problem seems to be the sequence %:. And in this case it is not easy to see how to change the code to make it pass the macOS C++ preprocessor, not without seriously garbling the lexc code. Suggestions welcome :-)

from trmorph.

Related Issues (17)

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.