cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

When I try to install Parallel::ForkManager on Windoze 10 it fails:
Test Summary Report ------------------- t/start_child.t (Wstat: 1280 Tests: 0 Failed: 0) Non-zero exit status: 5 Parse errors: Bad plan. You planned 2 tests but ran 0. t/waitpid-conflict.t (Wstat: 0 Tests: 2 Failed: 0) TODO passed: 1-2 t/waitpid-waitonechild.t (Wstat: 0 Tests: 3 Failed: 0) TODO passed: 2-3 Files=12, Tests=26, 74 wallclock secs ( 0.05 usr + 0.02 sys = 0.06 C +PU) Result: FAIL Failed 1/12 test programs. 0/26 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' -> FAIL Installing Parallel::ForkManager failed. See C:\Users\boss\.cp +anm\work\1712513913.232104\build.log for details. Retry with --force +to force install it. Expiring 2 work directories.
The docs list no test results of the current version on Windoze. Is there anything I can do to fix this?

Replies are listed 'Best First'.
Re: Parallel::ForkManager install fails
by choroba (Cardinal) on Apr 07, 2024 at 21:36 UTC
    The first step would be to read the mentioned log file and post the relevant parts here.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      That's what I did above
        > See C:\Users\boss\.cpanm\work\1712513913.232104\build.log for details.

        Did you? Where's the contents of the log file, then?

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: Parallel::ForkManager install fails
by ikegami (Patriarch) on Apr 08, 2024 at 00:29 UTC

    P::FM doesn't make much sense in Windows, which doesn't have the ability to fork.[1] Perl emulates it using threads. So why not just use threads directly?


    1. Not entirely impossible. Cygwin and MSYS use some internals to achieve it, or at least something closer than using threads.
Re: Parallel::ForkManager install fails
by swl (Prior) on Apr 07, 2024 at 21:49 UTC

    The logs you provide report dmake, which suggests an older version of Strawberry perl. As choroba noted in 11158744, Can you provide more details so others can try to reproduce?

    In saying that, it works fine for me when using Strawberry Perl 5.38.2.2 (gmake) and 5.20.3.3 (dmake).

Re: Parallel::ForkManager install fails
by eyepopslikeamosquito (Archbishop) on Apr 08, 2024 at 23:12 UTC

    Like the others, I advise you to stay away from Perl's fork emulation on Windows, too many surprises and general weirdness.

    If you provide more detail on the specific problem you are trying to solve, we will be able to better advise you.

    You might be interested in:

    • MCE by marioroy : Many-Core Engine for Perl providing parallel processing capabilities - can be configured to use processes or threads (via use_threads parameter), by default MCE spawns child processes on UNIX platforms and threads on Windows

    Update: this reply by marioroy to the OP two weeks ago contains examples, including one using MCE::Child with Parallel::ForkManager similarities.

    👁️🍾👍🦟
      Or, use the cygwin version of perl on Windows, which does support fork.
Re: Parallel::ForkManager install fails
by stevieb (Canon) on Apr 08, 2024 at 09:37 UTC
    The docs list no test results of the current version on Windoze. Is there anything I can do to fix this?

    It's "Windows", for what it's worth.

    As ikegami stated, fork() does not work within the Windows OS, so it isn't surprising that a) there are no test results for the distribution and b) unit tests fail on a Windows system.

    Use an OS that inherently uses fork to create separate processes, or use threading.