ForCompile is a library to access the Compiler Explorer API.
Below is a test program that compiles the “Hello World” program:
use forcompile, only: compiler_explorer
type(compiler_explorer) :: ce
write(*,*) 'Hello World';&
end program hello&
call ce%options%set_compilerOptions(skipAsm=.false., executorRequest=.false.)
end program test_7
# Compilation provided by Compiler Explorer at https://godbolt.org/
.string "Hello World"
sub rsp, 536
mov rax, QWORD PTR .LC1[rip]
mov rdi, rsp
mov DWORD PTR [rsp+16], 1
mov QWORD PTR [rsp], rax
mov QWORD PTR [rsp+8], OFFSET FLAT:.LC0
mov rdi, rsp
mov edx, 11
mov esi, OFFSET FLAT:.LC2
mov rdi, rsp
add rsp, 536
sub rsp, 8
mov esi, OFFSET FLAT:options.1.0
mov edi, 7
xor eax, eax
add rsp, 8
# Execution result with exit code 0
# Standard out:
Please be careful with such programs. It’s easy to incur high costs for the provider of a service:
This post is open to all, not just my Patrons. Earlier this week - 22nd September - Compiler Explorer experienced a brief DDoS attack from an unknown assailant.
I have no real idea why this happened: I’ve not had anyone contact me about it. I wonder if it was someone showing off or briefly testing their newly-acquired botnet. If it was you, and it was a mistake…just, please be careful. We’re fortunate to be able to absorb a one off cost of this magnitude, but we couldn’t take more than this without bringing the service down.
I hope it’s a coincidence that ForCompile was launched on the same day Compiler Explorer had a DDoS attack.
Probably as Matt Godbolt says:
200 million junk requests hit godbolt.org. Over 5000 hosts participated in the attack.
and we are only 1242 registered users on the Discourse…
I think you’re merely pointing out a funny coincidence. However, it has occurred to me that this may not be obvious to everybody reading Fortran Discourse.
We’re all on the same page here that ForCompile has nothing to do with the attack on the Compiler Explorer. If anyone has a doubt about it, ask the service owner about the attackers’
User-Agent fields (these can be easily changed, of course). There are 100 easier ways to make HTTP requests to Compiler Explorer’s API than using ForCompile.
I look forward to ForCompiling next week when I get back from my vacation. Thanks, Ali.
Thanks for clarifying! Obviously, this tool wasn’t developed for that purpose.
I’m happy to see Fortran in the list of projects on Compiler Explorer’s documentation: https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md#implementations
Enjoy your vacation!