double hypotenuse (double val_x, double val_y);
####
#include "hypotenuse.h"
#include
double hypotenuse (double val_x, double val_y)
{
return sqrt (val_x*val_x + val_y*val_Y);
}
####
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "hypotenuse.h"
MODULE = Geometry PACKAGE = Geometry
PROTOTYPES: ENABLE
double
hypotenuse(val_x, val_y)
double val_x
double val_y
####
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Geometry.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Geometry') };
#is (Geometry::hypotenuse (3, 4), 5);
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
####
Checking if your kit is complete...
Looks good
Writing Makefile for Geometry
####
cp lib/Geometry.pm blib/lib/Geometry.pm
gcc -c -I. -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC "-I/usr/lib64/perl5/CORE" Geometry.c
Running Mkbootstrap for Geometry ()
chmod 644 Geometry.bs
rm -f blib/arch/auto/Geometry/Geometry.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic Geometry.o -o blib/arch/auto/Geometry/Geometry.so \
\
chmod 755 blib/arch/auto/Geometry/Geometry.so
cp Geometry.bs blib/arch/auto/Geometry/Geometry.bs
chmod 644 blib/arch/auto/Geometry/Geometry.bs
Manifying blib/man3/Geometry.3pm
####
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Geometry.t .. 1/1
# Failed test 'use Geometry;'
# at t/Geometry.t line 9.
# Tried to use 'Geometry'.
# Error: Can't load '/gpfs/haifa-p4/08/tm/team/hagaih/geometry/Geometry/blib/arch/auto/Geometry/Geometry.so' for module Geometry: /gpfs/haifa-p4/08/tm/team/hagaih/geometry/Geometry/blib/arch/auto/Geometry/Geometry.so: undefined symbol: hypotenuse at /usr/lib64/perl5/DynaLoader.pm line 200.
# at (eval 4) line 2
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
# Looks like you failed 1 test of 1.
t/Geometry.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
Test Summary Report
-------------------
t/Geometry.t (Wstat: 256 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.02 sys + 0.01 cusr 0.00 csys = 0.04 CPU)
Result: FAIL
Failed 1/1 test programs. 1/1 subtests failed.
make: *** [test_dynamic] Error 1
####
hagaih@lnx-tm2: geometry/Geometry/t 84 > ls /gpfs/haifa-p4/08/tm/team/hagaih/geometry/Geometry/blib/arch/auto/Geometry/Geometry.so
/gpfs/haifa-p4/08/tm/team/hagaih/geometry/Geometry/blib/arch/auto/Geometry/Geometry.so*