unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67711: Org Babel gives incomplete result when writing multi-thread code
@ 2023-12-08 14:31 . shynur
       [not found] ` <handler.67711.B.170204622920669.ack@debbugs.gnu.org>
  2023-12-08 14:47 ` bug#67711: Org Babel gives incomplete result when writing multi-thread code Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: . shynur @ 2023-12-08 14:31 UTC (permalink / raw)
  To: 67711

(I use Emacs v29.1.90 for MS-Windows; gcc 10.3.0)
Here's an Org file:

    #+BEGIN_SRC C
    #include <stdio.h>
    #include <omp.h>
    int main() {
    #pragma omp parallel num_threads(3)
        printf("0"), printf("1");
    }
    #+END_SRC

    # Local Variables:
    # eval: (require 'ob-C)
    # org-babel-C-compiler: "gcc.exe  \
    #                         -std=c17 -Wall -O0  \
    #                         -fopenmp "
    # org-confirm-babel-evaluate: nil
    # End:

Executing the C code block usually outputs:

    #+RESULTS:
    : 10101

    #+RESULTS:
    : 1101

This output was unexpected, so I personally ran the temporary EXE file generated by Org-Babel:

    Windows Terminal
    PS D:/Tmp/babel-Xyz123> ./C-bin-Xyz123.exe
    010101

As you can see, this program should output 6 characters.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-08 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 14:31 bug#67711: Org Babel gives incomplete result when writing multi-thread code . shynur
     [not found] ` <handler.67711.B.170204622920669.ack@debbugs.gnu.org>
2023-12-08 14:45   ` bug#67711: Org Babel gives incomplete result . shynur
2023-12-08 14:48     ` Eli Zaretskii
2023-12-08 14:47 ` bug#67711: Org Babel gives incomplete result when writing multi-thread code Eli Zaretskii
2023-12-08 14:56   ` bug#67711: . shynur
2023-12-08 16:23     ` bug#67711: Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).