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

Compilation errors on windows: /usr/bin/sh: -c: line 0: syntax error near unexpected token `(' #66

Closed
csaund opened this issue Mar 20, 2020 · 2 comments

Comments

@csaund
Copy link

csaund commented Mar 20, 2020

Hello,

Background

My ultimate use case is getting to get this discourse parser to run. I am happy editing this third-party python to use the new python package, but I have the same compilation error as issue #48 and I am not sure how much retrofitting would be required to make it work anyway, so I would rather get the java version to compile and not touch this code.

The problem

I am trying to compile this on a windows machine using Cygwin, but upon make it quickly spits out the following:

carolyns@ugrpc /cygdrive/c/Program Files (x86)/Discourse_Parser_Dist/bllip-parser-master
$ make
C:/Program Files (x86)/GnuWin32/bin/make -C first-stage/PARSE parseIt
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/GnuWin32/bin/make -C first-stage/PARSE parseIt'
make: *** [PARSE] Error 1

this looks like a bash version issue to me, so my bash version is

carolyns@ugrpc /cygdrive/c/Program Files (x86)/Discourse_Parser_Dist/bllip-parser-master
$ bash --version
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

and make version is

carolyns@ugrpc /cygdrive/c/Program Files (x86)/Discourse_Parser_Dist/bllip-parser-master
$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

But I am not sure which version of bash to use as some other sources for similar issues suggest that V3 is the cause of this error.

Also wondering if there's anything I could try related to #46. I have never worked in java and don't suspect it would help as I need to use it in a python project.

since it says line 0, perhaps it thinks the script isn't closed off correctly? But again, since many people seem to use it just fine, I suspect this might just be a versioning issue? FWIW I've looked through parseIt.c and it appears fine.

I am sure it is a very small issue, but I am a bit at a loss as to how to fix it.

Any help resolving this would be greatly appreciated!

Other things I've tried

I have also tried compiling with MinGW (on the regular windows power shell) but had the far more ominous error of

PS C:\Program Files (x86)\Discourse_Parser_Dist\bllip-parser-master> make
C:/Program Files (x86)/GnuWin32/bin/make -C first-stage/PARSE parseIt
make[1]: Entering directory `C:/Program Files (x86)/Discourse_Parser_Dist/bllip-parser-master/first-stage/PARSE'
g++ -MMD -O3 -Wall -ffast-math -finline-functions -fomit-frame-pointer -fstrict-aliasing -fopenmp -march=pentium4 -mfpmath=sse -msse2 -mmmx -c extraMain.c
extraMain.c:17:10: fatal error: sys/resource.h: No such file or directory
   17 | #include <sys/resource.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [extraMain.o] Error 1
make[1]: Leaving directory `C:/Program Files (x86)/Discourse_Parser_Dist/bllip-parser-master/first-stage/PARSE'
make: *** [PARSE] Error 2

which the internet seemed to attribute to my development environment, and is why I started trying cygwin in the first place.

@csaund
Copy link
Author

csaund commented Mar 20, 2020

Update:
I have tried adding SHELL := /bin/bash to the top of the Makefile

although sh --version shows:

$ sh --version
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

so I was skeptical of that working anyway

@csaund
Copy link
Author

csaund commented Mar 20, 2020

Update, it didn't like where make lived (with Program Files (x86) in the path) so I moved make and forced it to use a different path. I get the ominous #include <sys/resource.h> error again, which the internet seems to advice "don't use windows" 🙃

@csaund csaund closed this as completed Mar 20, 2020
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

1 participant