Brl-cad with clojure

481 views
Skip to first unread message

Vikram Shaw

unread,
Jul 9, 2019, 4:35:13 AM7/9/19
to Clojure
I want to create a Brl-cad project using Clojure programming language in which I can create a database and some solid figure like sphere.
I have written the code using ``sh`` clojure function but getting error. The ``sh`` function is working fine as I have checked in repl.
This is the code I'm using:
(ns brl-cad.core
(:require [clojure.java.shell :refer [sh]]))

(defn example []
(println (:out (sh "-c" "./mged" "test.g"))))

I have added the mged path also: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:Applications/BRL-CAD\ \:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin:/opt/X11/bin

Error which I'm getting: Execution error (IOException) at java.lang.ProcessImpl/forkAndExec (ProcessImpl.java:-2).
error=2, No such file or directory

I am using Mac OSX.
I'm having problem with creating database and solid figure like sphere.

Thank You

Oleksandr Shulgin

unread,
Jul 9, 2019, 9:45:16 AM7/9/19
to clo...@googlegroups.com
Hi,

This doesn't seem to be a Clojure-specific question or a question about "creating a database and a solid figure".

You are trying to run mged binary, but it's not in the current directory of the process that runs your Clojure program apparently.

If it's on the PATH, then you should run it w/o prefixing the command with "./" (this instructs to look in the current directory and ignores the search paths).  If the mged binary is installed at "/Applications/BRL-CAD\ \:\ MGED\ 7.24.0.app/Contents/Resources/rel-7.24.0/bin" on your system, then you should make sure to include the leading forward slash in your PATH definition for it to be found.

I would recommend trying to make it work outside of your Clojure program first, before trying to run it with functions from clojure.java.shell namespace.

Cheers,
--
Alex

Reply all
Reply to author
Forward
0 new messages