public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Li, Yicheng" <yli137@vols.utk.edu>
To: David Malcolm <dmalcolm@redhat.com>
Cc: "jit@gcc.gnu.org" <jit@gcc.gnu.org>
Subject: Re: Libgccjit detection
Date: Wed, 9 Aug 2023 19:35:58 +0000	[thread overview]
Message-ID: <0BE9B9B7-656C-437A-8522-0297BEA33E61@vols.utk.edu> (raw)
In-Reply-To: <44725e8bb5e35c091f5be72ba72d689dcb7ab586.camel@redhat.com>

Hi,

Adding the macro is what I’ve done.

Thank you
Yicheng Li

> On Aug 9, 2023, at 3:31 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> 
> On Wed, 2023-08-09 at 17:45 +0000, Li, Yicheng via Jit wrote:
>> Hi,
>> 
>> Is there a way to detect libgccjit within C code?
> 
> I'm not sure what you mean here, sorry.
> 
> If you want the ability to compile a source file containing gcc_jit_*
> calls, but want to make having libgccjit.h optional at compile-time,
> then presumably you need your project to have some kind of configure
> test that determines if ligccjit is available, sets up a macro define,
> and to wrap your calls to gcc_jit_* in some kind of
>  #if HAVE_LIBGCCJIT 
> to use the macro.
> 
> For specific features within libgccjit.h, I've tried to add a 
> 
> #ifdef LIBGCCJIT_HAVE_name_of_feature
> 
> as I add them.  For example, there's a:
> 
> #ifdef LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks
> 
> which could be used to wrap calls to that specific function.
> 
>> I’m trying to compile the program without “-lgccjit”, but I load the
>> corresponding PATH and LD_LIBRARY_PATH.
> 
> Did the above answer your question, or did I misunderstand?
> 
> Dave
> 


      reply	other threads:[~2023-08-09 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 17:45 Li, Yicheng
2023-08-09 19:31 ` David Malcolm
2023-08-09 19:35   ` Li, Yicheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0BE9B9B7-656C-437A-8522-0297BEA33E61@vols.utk.edu \
    --to=yli137@vols.utk.edu \
    --cc=dmalcolm@redhat.com \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).