From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MGQEJpX+MWNGEgEAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 21:33:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +DEAJpX+MWPrtAAA9RJhRA (envelope-from ) for ; Mon, 26 Sep 2022 21:33:41 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AAD01D648 for ; Mon, 26 Sep 2022 21:33:40 +0200 (CEST) Received: from localhost ([::1]:57594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1octrH-00034f-IU for larch@yhetil.org; Mon, 26 Sep 2022 15:33:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1octoG-0002yX-Tc for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 15:30:34 -0400 Received: from esa01.ucs.mun.ca ([134.153.136.21]:3681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1octoE-0002ki-7X for emacs-orgmode@gnu.org; Mon, 26 Sep 2022 15:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mun.ca; s=mu20220027.s0; h=from:to:subject:date:message-id:mime-version; bh=zFxXxyHSPbXn0XyCe+99VL86UKqdI4CXyCtyGtoe0Uc=; b=X7VjHEg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LEEi3GrN94uBvvURX5O1PucgcvZGPpCfHfp5s0iA7IJjqIOIvpsbUZ9dw6q g1mTRTSZJ1K3abnL43hoTj6b8uE//Akjmcdv207pF6N4AJjf5KCbIe181Xd5vsoBN/HEAXb5 SdcwJTOtr1m4XSxeMqlHrtl8FaBuavtDdEgqQMxd3Xc32nxoCT+It04DM9WfR8wa5lslcDVj L/76VIMtMQ70IqCd6h4bpiqQ88jx6ztfekJpdiKBuejo/FZKme6wc2ZTRPKgD60yBh0y8nS+ /6zKK6RMJrTMow/pBLeegvX+eZDKvwWrY8Lea3G8g== IronPort-HdrOrdr: A9a23:SE22maFfzg2XlAwRpLqE9ceALOsnbusQ8zAXPiFKKSC9Hfb2qy nDpp4mPHzP6Qr5OktPpTnoAsDpfZq2z/JICOcqUIuKYBProy+hIo1k8OLZqAHdJw== X-IronPort-AV: E=Sophos;i="5.93,346,1654569000"; d="scan'208";a="13347240" Received: from cpe00fc8db7a323-cm00fc8db7a320.cpe.net.cable.rogers.com (HELO pyrope) ([174.117.202.255]) by smtp01.ucs.mun.ca with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 17:00:25 -0330 User-agent: mu4e 1.6.6; emacs 27.2 From: Roger Mason To: orgmode Subject: Compiling a C++ source block Date: Mon, 26 Sep 2022 16:43:55 -0230 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=134.153.136.21; envelope-from=rmason@mun.ca; helo=esa01.ucs.mun.ca X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664220821; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zFxXxyHSPbXn0XyCe+99VL86UKqdI4CXyCtyGtoe0Uc=; b=BlbkVTSPJxXDWjL2y/0My7xZUJhxTs9Sm1g4Kr5wt9ZBmVpu1PC+ZXUwPStXgk3rbykCva IHyqvxHko/ora6Vz/X/TYBu2syKYXBQZIpBFu2waXbn8wSdebE8j5im7zYBVszjYLJ7vZC +URaxq1Zy46TopJhFNRipMC9gvzvgdWKOuupBWmf1xHMWF2zINV8Y9d2dIAX37IYIKoFg8 BNGCjn210C9WF9GJpEywsseTt1Wz6Nd4HLsg+Roq5QM0FGcInH1qHRAQUhot2H6d7PzWV1 AOm46A5vdQT6A9fNaoEWJNTG6N+SMrGOxG2rGRV9VVOUj91hy8PWOhh/JU7GqQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664220821; a=rsa-sha256; cv=none; b=TpJLMZX5KHoJQ43qF5M5KilGgae6DUl7HM81rkbBcybF0KMPJL2HBHnaqJp8e3fO+mq3Mb iRXDK1Oxdb3Q5X5pquxzTr/CQH+RCGTdxEQIruDlCUrlL7aAfMXr7YKkzH1FDHVxwa8moe PB9Hys8BZQHQNRmlWCmKjRCakQX6i701cOVUePabN/jBCIsbnLW+R3Y/lXRgqndHeLTMX1 OsDbKjaMJxja1VpgVhCClOU5OeXYn1hpya7GsLHaFxXx4VwG7EitkPREMmBR9qITcSDl7O 8qtBAdsY/XYqwoiAhcuuGaylX1LPWUyduj68e7JzXBDWPUm7/ZKpacWO+Qhm3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mun.ca header.s=mu20220027.s0 header.b=X7VjHEgv; dmarc=pass (policy=none) header.from=mun.ca; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mun.ca header.s=mu20220027.s0 header.b=X7VjHEgv; dmarc=pass (policy=none) header.from=mun.ca; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AAD01D648 X-Spam-Score: -5.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: fBaLk2DT13wO Hello, I wish to compile & run this source block in org-mode: #+name: gnc_cav #+header: :includes #+header: :libs -L/usr/local/lib -lginac -lcln #+header: :flags -std=c++17 #+header: :namespaces std GiNaC # #+header: :var table= #+header: :var job="vectors" :var vol=113.13115406160385926 :var r=1.0995524816924328312 #+header: :var a=4.916 :var c=5.4054 #+header: :main no #+begin_src C++ ex vol(symbol a, symbol c) { ex v = a*a * c * sin(60*Pi/180); return v; } ex coa(symbol a, symbol c) { ex covera = c/a; return covera; } ex scl(symbol a, symbol c, double ad, double cd) { // symbol v("v"); // symbol r("r"); ex v = vol(a,c); ex r = coa(a,c); numeric three(3); // ex s = power(v.subs(lst{a==ad,c==cd})),1/three)/(power(sin(60*Pi/180),1/three) * power(r.subs(lst{a==ad,c==cd}),1/three)); ex s = power(v.subs(lst{a==ad,c==cd}),1/three)/(power(sin(60*Pi/180),1/three) * power(r.subs(lst{a==ad,c==cd}),1/three)); return s; } ex scl(double vd, double rd) { numeric three(3); ex s = power(vd,1/three)/(power(sin(60*Pi/180),1/three) * power(rd,1/three)); return s; } int main () { if ( strncmp(job, "volume", 6) == 0) { // ./v volume a c, calculate volume symbol as("as"); symbol cs("cs"); ex v = vol(as, cs); cout << "Volume = " << v.subs(lst{as == a, cs == c}).evalf() << "\n"; ex r = coa(as, cs); cout << "c/a = " << r.subs(lst{as == a, cs == c}).evalf() << "\n"; ex a_calc = scl(as, cs, a, c); cout << "a_calc = " << a_calc.evalf() << "\n"; cout << "c_calc = " << a_calc.evalf() * r.subs(lst{as == a, cs == c}).evalf() << "\n"; } else if ( job,"vectors",5) == 0 ) { // ./v vectors vol c/a //double vd = stod(argv[2]); //double rd = stod(argv[3]); ex a_calc = scl(v,r); cout << "a_calc = " << a_calc.evalf() << "\n"; cout << "c_calc = " << a_calc.evalf() * rd << "\n"; //double a_scale = a; } // vectors } // main #+end_src When I attempt compilation using 'C-c C-c' I get: /tmp/babel-eqG2i0/C-src-3zG2ec.cpp:16:1: error: unknown type name 'ex' ex vol(symbol a, symbol c) and lots of similar errors. I infer this is because ginac.h is not found. I have tried specifying in ':includes' to no avail. I have tried specifying the full path to ginac.h: and specifying -I/usr/local/lib/ginac/ as part of ':includes', but the error persists. Maybe the C++ support is not set up to handle this use case, but perhaps I am missing something. Any help will be much appreciated. Thanks, Roger