2

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.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157
Nox
  • 231
  • 1
  • 5
  • 16
  • 1
    By "MAC ubuntu terminal" do you mean the macOS Terminal application (which has nothing in particular to do with Ubuntu Linux)? – John Bollinger Feb 27 '21 at 14:19
  • 4
    I don't see the point of `prettymake`. For me it's just an overcomplicated form of `make 2>&1`. Just use `make`. – prog-fh Feb 27 '21 at 14:23
  • I would suggest to try and see if mkfifo works in WSL by running something like `mkfifo abcd; rm abcd`. If it gives some sort of error, than there is a problem with mkfifo in general. I think it should work. – Giovanni Zaccaria Feb 27 '21 at 14:25
  • @JohnBollinger Right, sorry, fixed in the question. – Nox Feb 27 '21 at 14:27
  • Concerning the lack of openmp support in macosx, this [this question](https://stackoverflow.com/q/43555410/11527076). – prog-fh Feb 27 '21 at 14:27
  • 1
    @GiovanniZaccaria Tested, in windows WSL it gives the same error, ```mkfifo: cannot create fifo 'abcd': Operation not supported```, in mac works. – Nox Feb 27 '21 at 14:29
  • Than there must be a problem with fifos. You could try to write your own simple mkfifo in C, but I don't think it would be useful at this point... I would listen the advice of [@prog-fh](https://stackoverflow.com/users/11527076/prog-fh) – Giovanni Zaccaria Feb 27 '21 at 14:31
  • @prog-fh About openmp in macos, in it now – Nox Feb 27 '21 at 14:31
  • 1
    Use WSL2, or set up a Linux VM. – Shawn Feb 27 '21 at 14:31
  • 1
    WSL's support for `mkfifo` is apparently a little rough. See https://github.com/microsoft/WSL/issues/3195, for example. I agree with @prog-fh that the `prettymake` script appears altogether pointless, and that a simple `make 2>&1` would be superior in pretty much every way (including not using `mkfifo`). Inasmuch as the package's `setup` script presumably runs `prettymake`, the easiest thing to do might be to replace the contents of the latter with the aforementioned `make 2>&1`. – John Bollinger Feb 27 '21 at 14:32
  • 1
    @Nox « About openmp in macos, in it now » maybe should you upgrade your compiler installation, because the error you report shows that your actual compiler is not aware of that. – prog-fh Feb 27 '21 at 14:35
  • @prog-fh Yeah, we are a group of persons and some of us have windows with wsl and others have macos, my first error was due to I have windows and no idea about mac :P, but the other members of the team are reading this too, thanks ;) – Nox Feb 27 '21 at 14:38
  • @JohnBollinger Going to try the ```make 2>&1``` this afternoon too and report back here, thanks ;) – Nox Feb 27 '21 at 14:39
  • 1
    It's done, just ignoring the prettymake and doing ```make 2>&1```. Then we installed gsl library and all work perfec. I'm not sure if I myself should answer the question, or some of you want to answer it, @prog-fh I suppose, since was the first who propose it. Anyway, thank you all. – Nox Feb 28 '21 at 13:31
  • @Nox Thanks for your invitation. I posted an answer. – prog-fh Feb 28 '21 at 14:00

1 Answers1

4

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.

prog-fh
  • 13,492
  • 1
  • 15
  • 30