Error trying to compile C file: mkfifo: cannot create fifo 'stderr': Operation not supported

Viewed 1776

We are trying to compile this by following instructions in the readme. I must say that we are not specialists with C at all, we are students of a web development bootcamp and trying to do our last project.

It's a command line tool to calculate ephemerides of multiple celestial bodies, and as you can read in the setup in the readme file, it need to download certain data from the internet, and then compile. All is done through the setup.sh script.

So, we have tried:

  • In Windows 10 ubuntu WSL terminal

If we type $./setup or $./prettymake, after download the data, gives the error:

$mkfifo: cannot create fifo 'stderr': Operation not supported
$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /mnt/d/reboot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\"  -D DATE=\"09/06/2019\"  -D PATHLINK=\"/\"  -D SRCDIR=\"/mnt/d/reboot/ephemeris-compute-de430/src/\" src/ephemCalc/constellations.c -o obj/ephemCalc/constellations.o

If we do it with $sudo ./setup, the error printed is:

$mkfifo: cannot create fifo 'stderr': Operation not supported
$cat: stderr: No such file or directory
$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /mnt/d/reboot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\"  -D DATE=\"09/06/2019\"  -D PATHLINK=\"/\"  -D SRCDIR=\"/mnt/d/reboot/ephemeris-compute-de430/src/\" src/ephemCalc/constellations.c -o obj/ephemCalc/constellations.o
  • In macOS terminal

If we type $./prettymake, gives the error:

$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /Users/rominaelorrietalopez/Documents/Descargas2/ephemeris-compute-de430-master/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\"  -D DATE=\"09/06/2019\"  -D PATHLINK=\"/\"  -D SRCDIR=\"/Users/rominaelorrietalopez/Documents/Descargas2/ephemeris-compute-de430-master/src/\" src/argparse/argparse.c -o obj/argparse/argparse.o
$clang: error: unsupported option '-fopenmp'
$make: *** [obj/argparse/argparse.o] Error 1

We have tried certain things to no avail, like granting permissions and what not, but have no idea what to do next.

It seems that it have something to do with the prettymake file:

mkfifo stderr
cat stderr | sed 's/\(.*\)/\1/' &
make $@ 2>stderr | sed 's/\(.*\)/\1/'
rm stderr

It's like its trying to create a pipe to save the errors of the compilation but somehow it fails. Also possibly worth of mention, it have a Makefile associated.

Since the github project does not have Issues, we've contacted the creator via email, but well, we thought maybe someone could help us here too.

Any kind of help would be honestly appreciated, thanks.

1 Answers

A comment from the OP invites me to answer; here it is.

The prettymake script creates a named fifo in order to receive the messages produced by make on its standard error. A background process (cat) consumes the data from this fifo and sends them to a sed command (see right after) in order to transform these data before writing to standard output. (note that cat is useless here since sed could have directly read from the named fifo thanks to <)

However, the two sed commands as shown in the question don't do anything since they just capture each line of text (\(.*\)) and repeat them unchanged (\1), thus they could have been omitted. In this case, the script could just contain make $@ 2>&1, it would have produced the same effect. On a system where creating the named fifo is problematic (old version of WSL apparently), this change in the script should produce the same effect as expected.

Looking at the link provided in the question, we can see that the original prettymake script actually contains transformations in the sed commands in order to display standard output and standard error of the make command with different colours.

Related