Giter Club home page Giter Club logo

Comments (13)

mame avatar mame commented on June 12, 2024

Looks a bug of f2c, tcc, or a combination of them, because QR.f outputs a broken QR.f90.
Did you update f2c recently? I guess this is a trigger. Can you try an old f2c?

from quine-relay.

mame avatar mame commented on June 12, 2024

I've built and tried AUR's f2c source tarball in Ubuntu.
It compiles QR.f successfully, but the executable writes the output to stderr instead of stdout.
I don't read the discussion of AUR, but I doubt if we can trust the tarball.

from quine-relay.

Jesin avatar Jesin commented on June 12, 2024

I'm the maintainer of the AUR package for f2c. On my system, the F77 -> F90 step segfaults when I use the default tcc for that step. However, the entire quine-relay runs all the way through with no errors at any step if I use gcc or clang instead. The programs that gcc and clang produce from the f2c'd source do not write anything to stderr, either.

Do you two still have problems if you use gcc or clang? If so, I'll look into them as potential bugs in the f2c package.

from quine-relay.

xyproto avatar xyproto commented on June 12, 2024

The quine-relay-git package installs and runs fine now, using gcc instead of tcc. tcc has not changed lately.

from quine-relay.

mame avatar mame commented on June 12, 2024

Hmm, then, f2c is innocent and the recent change of f2c may hit tcc's bug?

I wonder if we should use gcc instead of tcc. The reason why it uses tcc is because gcc (gfortran) seems to require huge memory to compile QR.f on some platforms. (#2)

from quine-relay.

xyproto avatar xyproto commented on June 12, 2024

Sounds like the recent change of f2c hit tcc's bug, yes.

Perhaps clang uses less memory than gcc and resolves both #2 and this? Would need to be tested.

from quine-relay.

Jesin avatar Jesin commented on June 12, 2024

Another option is to simply use $(CC) (which I believe defaults to cc if it's not defined by the environment, at least using GNU make), and let whoever's running it choose their own compiler using environment variables. Similarly you can use $(CXX) for the C++ compiler.

from quine-relay.

mame avatar mame commented on June 12, 2024

Unfortunately clang seems not to work so well.

$ /usr/bin/time -f "%M KB" gcc -o QR QR.c /usr/lib/libf2c.a 
702572 KB
$ /usr/bin/time -f "%M KB" clang -o QR QR.c /usr/lib/libf2c.a 
525980 KB
$ /usr/bin/time -f "%M KB" tcc -o QR QR.c /usr/lib/libf2c.a 
43872 KB

I guess it is a good idea to use $(CC) and to add to the document something like "try make CC=tcc if you have no enough memory."
But I have to check if $(CC) does not affect other compilation processes. In particular, gcc was very very slow to compile INTERCAL code, if I recall. I will do later.

from quine-relay.

xyproto avatar xyproto commented on June 12, 2024

Thanks for testing, the memory usage information is interesting.

from quine-relay.

Jesin avatar Jesin commented on June 12, 2024

It appears that passing -bfO to the intercal compiler (ick) causes it to "optimize" the C code it produces, in such a way that GCC takes less time to compile it. I haven't tested this rigorously yet.

from quine-relay.

xyproto avatar xyproto commented on June 12, 2024

Using -bfO and gcc is slightly faster than tcc without -bfO here, while gcc without -bfO is almost three times as slow.

Confirmed that gcc + -bfO is a viable alternative to tcc.

from quine-relay.

mame avatar mame commented on June 12, 2024

I think this is already fixed by #38. Closing.
Please let me know if I misunderstand. Thank you.

from quine-relay.

xyproto avatar xyproto commented on June 12, 2024

Sounds right! Thanks.

from quine-relay.

Related Issues (20)

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.