Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Math::GSL on Windows 10, MSYS2 : undefined reference to `Perl_get_sv' #220

Closed
hakonhagland opened this issue Jul 27, 2020 · 1 comment · Fixed by #222
Closed

Comments

@hakonhagland
Copy link
Contributor

I am trying to install Math::GSL on Windows 10 with MSYS2. When running ./Build I get the following errors:

$ ./Build
Building Math-GSL
Processing 2.6 XS files, GSL 2.6 (via gsl-config) at /home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL
Compiler        = gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


ccflags         = -I/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/include -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong -Wall -Wno-sometimes-uninitialized -Wno-unused-function -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-gnu -g -fPIC -fno-omit-frame-pointer -I/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/include
ldflags         = -shared -L/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/lib -lgsl -lgslcblas -lm -fPIC -fno-omit-frame-pointer
PERL5LIB        =
LD_LIBRARY_PATH =
gcc -I/usr/lib/perl5/core_perl/CORE -c -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong -I/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/include -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong -Wall -Wno-sometimes-uninitialized -Wno-unused-function -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-gnu -g -fPIC -fno-omit-frame-pointer -I/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/include -o xs/Diff_wrap.2.6.o xs/Diff_wrap.2.6.c
gcc -o blib/arch/auto/Math/GSL/Diff/Diff.dll xs/Diff_wrap.2.6.o -shared -L/home/hakon/.cpanm/work/1595801186.15197/Alien-GSL-1.02/blib/lib/auto/share/dist/Alien-GSL/lib -lgsl -lgslcblas -lm -fPIC -fno-omit-frame-pointer
/usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld: xs/Diff_wrap.2.6.o: in function `SWIG_croak_null':
/home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1023: undefined reference to `Perl_get_sv'
/home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1023:(.text+0xfb): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Perl_get_sv'
/usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld: /home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1027: undefined reference to `Perl_sv_isobject'
/home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1027:(.text+0x111): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Perl_sv_isobject'
/usr/lib/gcc/x86_64-pc-msys/9.3.0/../../../../x86_64-pc-msys/bin/ld: /home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1030: undefined reference to `Perl_croak_nocontext'
/home/hakon/perl/github/math--gsl--devel/Math-GSL-0.42/xs/Diff_wrap.2.6.c:1030:(.text+0x137): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Perl_croak_nocontext'
[...]
@leto
Copy link
Owner

leto commented Jul 28, 2020

@hakonhagland seems like your Perl header files cannot be found or are not installed where it thinks they should be, and so compiling fails

hakonhagland added a commit to hakonhagland/math--gsl that referenced this issue Aug 3, 2020
It is not possible to leave a symbol in a PE DLL undefined at link time,
to be satisfied at runtime, as it is instead possible with most UNIX shared objects
So we need to link with libperl.dll.a on MSYS2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants