Stream: brlcad

Topic: compiling rt-cubed


view this post on Zulip Sumagna Das (Mar 06 2021 at 11:00):

hey
i tried following the instructions in INSTALL and README

view this post on Zulip Sumagna Das (Mar 06 2021 at 11:00):

but none of it is working

view this post on Zulip Sumagna Das (Mar 06 2021 at 11:24):

hey
the instructions in INSTALL is outdated i think

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:13):

Yea, it is. The main reason is probable that rt-cubed (the old rt^3) is more of a collection of ideas, small project, than a project site of its own. I.e., nobody feels responsible to update these files :rolling_eyes:

Here is the description from the 209th GCi task:

The rt^3 module contains new, experimental features as e.g. a C++ geometry engine interface and Lua bindings.
The goal of this task is to compile this module from a source code checkout.
This is a prerequisite for all coding tasks in the rt^3 module.

After compiling and Installing BRL-CAD from latest source code (there is an own task for it which you should have completed before)

Now, with rt-cubed and github, of course.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:17):

oh

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:17):

so it doesnt have all the functionalities of brl-cad?
and if thats so.....what are the functionalities that are available right now in rt-cubed?

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:19):

It uses the functionality of main BRL-CAD. You have to install it first.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:19):

thats not what i meant to ask

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:20):

what functionalities from the main installation does it use right now? as it doesnt seem to have all of the features..

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:28):

What do you mean with "it". I haven't looked at every project there. My main emphasis is on the C++ API and programs/libraries build on it.

The C++ API covers well the creation and manipulation of database objects and the ray-trace with different types of databases (non-modifiable file, file, in-memory), but it may miss features necessary for a GUI. https://github.com/BRL-CAD/arbalest is a prototype of a new GUI build on top of BRL-CAD's C++ core interface.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:28):

Daniel Rossberg said:

What do you mean with "it". I haven't looked at every project there. My main emphasis is on the C++ API and programs/libraries build on it.

The C++ API covers well the creation and manipulation of database objects and the ray-trace with different types of databases (non-modifiable file, file, in-memory), but it may miss features necessary for a GUI. https://github.com/BRL-CAD/arbalest is a prototype of a new GUI build on top of BRL-CAD's C++ core interface.

by "it", i mean the rt-cubed project

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:29):

Daniel Rossberg said:

What do you mean with "it". I haven't looked at every project there. My main emphasis is on the C++ API and programs/libraries build on it.

The C++ API covers well the creation and manipulation of database objects and the ray-trace with different types of databases (non-modifiable file, file, in-memory), but it may miss features necessary for a GUI. https://github.com/BRL-CAD/arbalest is a prototype of a new GUI build on top of BRL-CAD's C++ core interface.

so all of the things that can be done by code in C is doable with rt-cubed in c++?

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:32):

As I already wrote, rt-cubed is a repository containing a loose collection of projects related to BRL-CAD. Some of them may be sketches only, others can be used in production.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:34):

ohk
I was thinking about trying to do bindings with this C++ API as C API hasnt worked that well because of the macros

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:37):

Sumagna Das said:

so all of the things that can be done by code in C is doable with rt-cubed in c++?

Let's say many, not all. The C++ core interface (this is one of the many projects contained in the rt-cubed repository, in src/coreInterface) is a thin layer on BRL-CAD's basic C functions. See include/brlcad for the C++ classes declarations. See tests/coreInterface for some example progams. PrintTitle is a nice one, because it's very basic and short. You may also want to have a look at https://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:37):

Sumagna Das said:

ohk
I was thinking about trying to do bindings with this C++ API as C API hasnt worked that well because of the macros

Good idea :grinning_face_with_smiling_eyes:

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:39):

i thought of C++ because i found a bindings generator which is up-to-date right now

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:39):

With Visual Studio on Windows, you can use a precompiled library: https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Runtime%20Libraries/7.32.0/

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:40):

Sumagna Das said:

i thought of C++ because i found a bindings generator which is up-to-date right now

so if i find a problem, they might be able to help me fix that....

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:40):

Daniel Rossberg said:

With Visual Studio on Windows, you can use a precompiled library: https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Runtime%20Libraries/7.32.0/

i am on linux so dont think i will have to do that right now

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:47):

The version in rt-cubed is kind of concept work. A real product would be more like this: https://github.com/drossberg/MOOSE

The functionality is basically the same, but MOOSE uses more C++11 and builds (and installs) a brlcad library (libbrlcad.so, brlcad.dll, ...) containing all necessary functions. In addition, other bindings could be added there. At the moment, it contains a raw Lua interface.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:50):

Daniel Rossberg said:

The version in rt-cubed is kind of concept work. A real product would be more like this: https://github.com/drossberg/MOOSE

The functionality is basically the same, but MOOSE uses more C++11 and builds (and installs) a brlcad library (libbrlcad.so, brlcad.dll, ...) containing all necessary functions. In addition, other bindings could be added there. At the moment, it contains a raw Lua interface.

rt-cubed == MOOSE but much stable and independent of brlcad libraries?

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 16:58):

MOOSE = rt-cubed/src/coreInterface with slightly improved API (directory structure, C++11, but not more stable) and optimized build (which creates one library containing everything needed).

Regarding stability: If I find a flow in MOOSE, I'll fix it in rt-cubed too, and vice versa.

view this post on Zulip Sumagna Das (Mar 06 2021 at 16:59):

so MOOSE doesnt need main brlcal installation unlike rt-cubed?

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 17:00):

It needs it for building. But, if once installed, the main BRL-CAD isn't needed any more.

view this post on Zulip Sumagna Das (Mar 06 2021 at 17:02):

isnt rt-cubed like that or does it require them even when it is installed?

view this post on Zulip Daniel Rossberg (Mar 06 2021 at 17:04):

The rt-cubed version uses the BRL-CAD libraries from the main installation during runtime too. MOOSE compiles everything in a big binary (e.g. libbrlcad.so on Linux), such that the libraries from the main installation aren't necessary any more.

view this post on Zulip Sumagna Das (Mar 06 2021 at 17:14):

Makes sense

view this post on Zulip Sean (Mar 06 2021 at 18:25):

@Sumagna Das what macro problem were you referring to?

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:25):

the other binding generators couldnt read the macros defined in vmath.h

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:26):

and nobody was there who was updating the repo

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:26):

so that was a problem

view this post on Zulip Sean (Mar 06 2021 at 18:26):

hm, I missing some context I think ... nobody was updating what repo?

view this post on Zulip Sean (Mar 06 2021 at 18:27):

and what are you doing with a binding generator, sounds interesting

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:27):

Sean said:

hm, I missing some context I think ... nobody was updating what repo?

sorry for that.....i was talking about the repos of the binding generators.

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:28):

Sean said:

and what are you doing with a binding generator, sounds interesting

I was trying something out....if it works , then thats a good news

view this post on Zulip Sean (Mar 06 2021 at 18:30):

just a note, much of what's in vmath is just helpers that are macros for performance reasons. they could be all turned into functions really easily (some already are), probably in an hour or two.

view this post on Zulip Sean (Mar 06 2021 at 18:30):

you can't bind to a macro, of course, because they don't exist from a compiler's perspective

view this post on Zulip Sean (Mar 06 2021 at 18:30):

the preprocessor basically inlines them

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:31):

Sean said:

you can't bind to a macro, of course, because they don't exist from a compiler's perspective

that was the problem i guess then

view this post on Zulip Sumagna Das (Mar 06 2021 at 18:31):

Sean said:

just a note, much of what's in vmath is just helpers that are macros for performance reasons. they could be all turned into functions really easily (some already are), probably in an hour or two.

might have had to do that

view this post on Zulip Sean (Mar 06 2021 at 18:32):

when you compile a file, one of the first things is the "cpp" preprocessor. it replaces all the #includes and #define and basically processes all the # lines in the code, replacing them completely so that the compiler is fed something that looks quite different.

view this post on Zulip Sean (Mar 06 2021 at 18:37):

you can actually see the intermediate states by compiling a file with -E and save that to a file, or by adding --save-temps to gcc to keep the intermediates around (you'll end up with file.c.i files).

view this post on Zulip Sumagna Das (Mar 08 2021 at 17:47):

Sean said:

and what are you doing with a binding generator, sounds interesting

i was using a python binding generator before for the C code

view this post on Zulip Sumagna Das (Mar 08 2021 at 17:48):

but most of the generators were not up to date

view this post on Zulip Sumagna Das (Mar 08 2021 at 17:51):

but recently i found a generator which is up to date, but it was for C++

view this post on Zulip Sumagna Das (Mar 08 2021 at 17:51):

not for C

view this post on Zulip Sumagna Das (Mar 08 2021 at 18:01):

so tried out for rt-cubed


Last updated: Oct 09 2024 at 00:44 UTC