in reply to Devel::NYTProf: "undefined symbol: PL_stack_sp" error

The module loading path, most likely $ENV{PERL5LIB}, shows the path to one Perl version while you are running a different Perl version. Set up $ENV{PERL5LIB} to only contain paths for the Perl version you're actually running.

Replies are listed 'Best First'.
Re^2: Devel::NYTProf: "undefined symbol: PL_stack_sp" error
by Special_K (Pilgrim) on Aug 26, 2021 at 20:02 UTC

    If I include the following in factorial_recurse.pl:

    printf("perl5lib = $ENV{PERL5LIB}");

    It prints:

    perl5lib = /home/user/perl_modules/lib/perl5/x86_64-linux/

    and nothing else. I don't see a path to either perl version referenced in my previous post (/tool/bin/perl

    or

    /usr/bin/perl

    ). Is that a problem?

      The issue is that the libraries under that path are compiled for one of your perls, but not the other.

      You need to have a separate directory for each perl version, each of which has a version of the libraries you are using. This is what Corion was recommending in 11136089.

      A slightly more involved, but well tested and used, way to achieve this is to use local::lib to handle the different directories.

        How do module directories get associated with specific installation locations of perl? When I install a module, I just do the following (as an example):

        cd /home/user/perl_modules cpanm -L$PWD Devel::NYTProf