BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
582 stars 161 forks source link

Fix #427: Added missing lpthread flag in Makefile #428

Closed daneshvar-amrollahi closed 1 year ago

daneshvar-amrollahi commented 1 year ago

There was a -lpthread flag missing in the Makefile for the Haskell parser that lead to a linking error. I added it.

daneshvar-amrollahi commented 1 year ago

I am still puzzled why this option is necessary on your system. Would you be able to do more research on this / give me pointers?

It seems to be MUST on Linux as the pthread.h is not included in libc.so and hence has to be linked separately. Here are some sources:

https://askubuntu.com/questions/420722/how-to-compile-a-c-program-that-uses-pthread-h https://stackoverflow.com/questions/9331863/lpthread-option-of-gcc?rq=1

andreasabel commented 1 year ago

It seems to be MUST on Linux as the pthread.h is not included in libc.so and hence has to be linked separately.

Yes, but somehow I expect GHC, who invokes the C compiler and linker, to take care of that without an explicit -lpthread flag. Maybe you can get GHC to print the call to gcc, using verbosity -v4. Atm, I do not have good access to Ubuntu machines, otherwise I could try an investigate this more.

andreasabel commented 1 year ago

Closing for inactivity.