Missing header for sched_yield()

Issue #91 resolved
Paul Hargrove created an issue

On a Cygwin system:

/usr/local/gcc-7.2.0/bin/g++ -std=c++11 -D_GNU_SOURCE=1 -I/home/Paul/upcxx/.nobs/art/4cfa7255d9f35634e37fc548518449715371d3fc -DUPCXX_BACKEND=gasnet1_seq -D_GNU_SOURCE=1 -DGASNET_SEQ -I/home/Paul/upcxx-inst/gasnet.debug/include -I/home/Paul/upcxx-inst/gasnet.debug/include/smp-conduit -O0 -g -Wall -g3 -Wno-unused -Wno-unused-parameter -Wno-address -c /home/Paul/upcxx/src/diagnostic.cpp -o /home/Paul/upcxx/.nobs/art/a14682eda579a78edb59fba9e8d793ddf4a20241.diagnostic.cpp.o

/home/Paul/upcxx/src/diagnostic.cpp: In function 'void upcxx::dbgbrk()':
/home/Paul/upcxx/src/diagnostic.cpp:44:7: error: 'sched_yield' was not declared in this scope
       sched_yield();
       ^~~~~~~~~~~
UPC++ Installation failed. Please report the entire log above to: upcxx@googlegroups.com

Manpage for sched_yield() says one must #include <sched.h>.
However, the only instance of such an include is within dl_malloc.c.

Comments (4)

  1. Dan Bonachea

    Or you could just #include <gasnet.h> (or gasnet_tools.h) and call gasnett_sched_yield() and let us worry about it.

  2. john bachan

    Fixed issue 91. Now includes <sched.h> for sched_yield().

    UPCXX_ASSERT macro is now only enabled if ASSERT=1 is in the environment during nobs build. run-tests enables this by default. install script enables for debug build, disables for O3.

    → <<cset 7125939f2758>>

  3. Log in to comment