Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: External (extra) files when using Inline::CPP

by marioroy (Prior)
on Apr 16, 2024 at 21:03 UTC ( [id://11158902]=note: print w/replies, xml ) Need Help??


in reply to Re: External (extra) files when using Inline::CPP
in thread External (extra) files when using Inline::CPP

The MCE Sandbox project places the C and header files inside the src folder. There is just the one *.c file, everything else placed in *.h files.

.Inline/ Where Inline::C is configured to cache C object file +s. bin/ algorithm3.pl Practical sieve based on Algorithm3 from Xuedong Luo + [1]. src/ algorithm3.c Inline::C code for algorithm3.pl. bits.h Utility functions for byte array. output.h Fast printing of primes to a file descriptor. sandbox.h Header file, includes bits.h, output.h, sprintull.h. sprintull.h Fast base10 to string conversion. typemap Type-map file for Inline::C.

I pass -I${base_dir}/src for Inline C, inside algorithm3.pl

BEGIN { $ENV{PERL_INLINE_DIRECTORY} = "${base_dir}/.Inline"; mkdir "${base_dir}/.Inline" unless -d "${base_dir}/.Inline"; } use Inline 'C' => Config => CCFLAGSEX => "-I${base_dir}/src -O3 -fomit-frame-pointer", TYPEMAPS => "${base_dir}/src/typemap", clean_after_build => 0; use Inline 'C' => "${base_dir}/src/algorithm3.c";

Later editing a header file requires removing the cache .Inline folder. Inline C does not know to re-compile due to not checking the *.h time stamps.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11158902]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-06-25 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.