Stream: Google Summer of Code

Topic: python wrapper


view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:34):

Hey @Sean , I'm assuming this (https://pastebin.com/RKkKSzFV) is the exhaustive list of primitives that need to be wrapped. I've got a little confusion about some of the names here, (e.g., Does hlf mean half?).

I've written a 'd' beside the primitives that been wrapped and added a bracket () around the one's that I have a doubt.

I'm writing the core of the proposal (the timeline) and wanted to just narrow down on the list of things I'd need to do.

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:34):

The one's without a 'd' by them have not been wrapped. This is an extract from the 'table.cpp' file in the primitives folder.

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:35):

Also, regarding the patch. Would you recommend a dummy wrapper around one of the primitives or solving some other task from the to-do list?

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:35):

@Shubham Rathore Any insights here? :)

view this post on Zulip Sean (Mar 24 2018 at 05:36):

if you look in src/librt/primitives/* you will find sources to all of them, and descriptions for what the shorthand names (like hlf) means in the top comment of the main file

view this post on Zulip Sean (Mar 24 2018 at 05:36):

note also that a few primitives are deprecated/obsolete (see CHANGES)

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:36):

Great!

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:36):

Oh alright

view this post on Zulip Sean (Mar 24 2018 at 05:37):

e.g., don't care about pg, nurb, hf, and cline

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:38):

Alright! Just out of curiosity, what is the librt/primitives/xxx directory?

view this post on Zulip Sean (Mar 24 2018 at 05:38):

template for creating a new primitive

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:38):

Ah, sweet

view this post on Zulip Sean (Mar 24 2018 at 05:39):

for a patch, I would suggest doing something productively useful that demonstrates your abilities

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:41):

@Sean , I'm trying to setup python BRL-CAD on my system (OS-X) but I keep running into this issue constantly : https://pastebin.com/PqKQ2Sfm

Would you have any solution to this?

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:41):

Uh-huh. I'll figure out a patch task and get back to you soon

view this post on Zulip Sean (Mar 24 2018 at 05:42):

I don't have a solution for that -- haven't worked with that code in years so it'd take some time to refamiliarize

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:42):

Ah okay! I'll figure something out

view this post on Zulip Sean (Mar 24 2018 at 05:42):

but at a glance, looks like something is wrong in the search logic it's using

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:43):

Uh, it requires me to : export BRLCAD_PATH=/usr/brlcad

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:43):

And when it tries to look for BRL-CAD there, it doesn't find a valid installation

view this post on Zulip Sean (Mar 24 2018 at 05:43):

also, just changed the subject @Jaipal Singh .. try not to hijack other people's discussions ;)

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:44):

Oh crap! Sorry :P

view this post on Zulip Sean (Mar 24 2018 at 05:44):

no biggie

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:45):

So, the BRL_CAD path should redirect to the source code?

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:45):

*BRLCAD_PATH

view this post on Zulip Sean (Mar 24 2018 at 05:45):

like I said, something is wrong in the search logic (or testing) that it's using ... or your setting is wrong

view this post on Zulip Sean (Mar 24 2018 at 05:46):

don't know, would have to read the source code just like you can ;)

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:46):

On it!

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:47):

One last thing, would you know how I could get in touch with https://github.com/ncsaba ?

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:47):

AFAIK, he started the initial work on python BRLCAD

view this post on Zulip Sean (Mar 24 2018 at 05:48):

you could try asking on the brlcad-devel mailing list

view this post on Zulip Sean (Mar 24 2018 at 05:48):

or e-mailing him

view this post on Zulip Sean (Mar 24 2018 at 05:49):

raj reddy also worked on it (under gsoc)

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:49):

Yea!

view this post on Zulip Sean (Mar 24 2018 at 05:50):

bryan definitely had a hand too

view this post on Zulip Sean (Mar 24 2018 at 05:50):

I think he did most of it actually iirc, at least most of the initial setup

view this post on Zulip Sean (Mar 24 2018 at 05:51):

could be mis-remembering though .. that was about 5 years ago

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:52):

Haha! Nah, the commit history says the same, Bryan was a major contributor along with ncsaba.

view this post on Zulip Sean (Mar 24 2018 at 05:55):

if you can get ahold of one of them, ask them if they're willing to mentor you on the project too ...

view this post on Zulip Jaipal Singh (Mar 24 2018 at 05:55):

Including that in the email rn

view this post on Zulip Jaipal Singh (Mar 25 2018 at 05:52):

@Sean Bryan responded to the mail, I'm going to bounce off all my doubts regarding the project and the GSoC proposal and submit a draft in the next couple of hours.

Regarding the mentorship, he said he wasn't sure about it, but I'll try and see if he can do like a co-mentor thing of sorts.

view this post on Zulip Jaipal Singh (Mar 25 2018 at 05:56):

@Sean Regarding the tasks to be done during SoC, I was thinking something on the lines of (chronologically)

Fixing the current project : Proper installation scripts, support for python3.x (Probably during community bonding)
Wrapping the primitives : Wrapping the remaining primitives and writing tests for the same.
Extending support to OS-X : This could be post SoC task as well, I'm still not sure about this.
Documentation : I think this is really crucial and this would span across the entire length of the project.

What do you think?

view this post on Zulip Jaipal Singh (Mar 25 2018 at 05:57):

Also, I'm not sure how much time each primitive is going to take, so would it make sense to build the timeline in the proposal at a coarse-grained (maybe weekly or fortnightly) level?

view this post on Zulip Aditya Gulati (Mar 25 2018 at 11:27):

@Jaipal Singh Hey, I too was wishing to work on the same project and considering that the project is very large, how about we divide the work, that is you handle extending the support for OS-X and fixing the current project, while I would start wrapping rest of the primitives. And along with that the documentation can go on simultaneously. And by the end of the project, say last 2 weeks we can write tests for the same. @Sean What do you think, would something like this be feasible?

view this post on Zulip Shubham Rathore (Mar 25 2018 at 11:36):

Hi @Jaipal Singh , one can only be sure about the time after you are done with everything. A rough tentative is good enough, and its better to divide the tasks into small time periods so that the progress can be monitored rather than keeping the windows too large and ending up with nothing :)

view this post on Zulip Jaipal Singh (Mar 25 2018 at 15:43):

Hey @Aditya Gulati. I would love to collaborate but I think I'll be able to do justice to the project and complete most of it (probably all of it) in the given time frame. :)

view this post on Zulip Jaipal Singh (Mar 25 2018 at 15:44):

You could always be an active contributor to the python BRL-CAD though, it's great to have people working on a project they're interested in.

view this post on Zulip Aditya Gulati (Mar 25 2018 at 16:14):

@Jaipal Singh Thanks. Would look some other project this year.

view this post on Zulip Sean (Mar 25 2018 at 17:43):

@Jaipal Singh sounds like a reasonable approach, good work

view this post on Zulip Sean (Mar 25 2018 at 17:43):

proposals should at least try to account for each week of gsoc

view this post on Zulip Sean (Mar 25 2018 at 17:50):

@Aditya Gulati it's possible, so long as the tasks don't depend on each other

view this post on Zulip Jaipal Singh (Apr 04 2018 at 06:13):

Hey @Sean , what does $BRLCAD_PREFIX play a role in?

view this post on Zulip Sean (Apr 04 2018 at 12:22):

@Jaipal Singh in what context?

view this post on Zulip Naseef (Apr 04 2018 at 15:47):

I think it's a CMAKE variable.

view this post on Zulip Naseef (Apr 04 2018 at 15:50):

Found this on CMake file, I think it will be helpful for you @Jaipal Singh

# (Note:  CMAKE_INSTALL_PREFIX must be checked in the case where someone
# sets it on the command line prior to CMake being run.  BRLCAD_PREFIX
# preserves the CMAKE_INSTALL_PREFIX setting from the previous CMake run.
# CMAKE_INSTALL_PREFIX does not seem to be immediately set in this context
# when CMake is re-run unless specified explicitly on the command line.
# To ensure the previous (and internally set) CMAKE_INSTALL_PREFIX value
# is available, BRLCAD_PREFIX is used to store the value in the cache.)

view this post on Zulip Sean (Apr 04 2018 at 16:53):

@Jaipal Singh you found the docs that explain it right there... I'm not sure what you're wanting to know beyond that (or more importantly why you would even care). It's not a variable you should need to know about or use.

view this post on Zulip Jaipal Singh (Apr 05 2018 at 04:50):

Thanks @Naseef !

view this post on Zulip Jaipal Singh (Apr 05 2018 at 04:50):

@Sean , I am working on a patch to fix python BRL-CAD and getting it to smoothly install on OS-X and the code there uses $BRLCAD_PREFIX,, hence wanted to know about it.

view this post on Zulip Jaipal Singh (Apr 05 2018 at 05:04):

Turning out to be a little challenging, I'm still trying to figure out the existing code base and there's no documentation to go with it

view this post on Zulip Jaipal Singh (Apr 06 2018 at 05:56):

Hey @Sean, I'm working on the patch and have asked Kanzure and nmz787 for help on their IRC.Fixing the installation process for pyBRLCAD might take a little while. The post_install script there might be broken (nmz787 tried to set it up from the source code and it keeps breaking). While I'm working on it, I'll also start working on a parallel patch (maybe something from the ToDo list).

view this post on Zulip Jaipal Singh (Apr 06 2018 at 14:08):

So, I've narrowed it down to implementing the centroid function for one of the primitives. Now, from what I'm gathering it's not possible to have a centroid for every primitive.
@Shubham Rathore @Sean Would you recommend any particular primitive that is in priority for having a centroid function implemented?

view this post on Zulip Jaipal Singh (Apr 06 2018 at 14:11):

Also, this is what kanzure and nmz787 had to say about the issues with current python BRLCAD : https://pastebin.com/2hAvmF2B

view this post on Zulip Jaipal Singh (Apr 13 2018 at 06:19):

Hey, python brlcad requires libbu.so or libbu.dll to work with. I've found the libbu folder in the src but am not able to find these files.
Are they to be compiled separately or am I missing out something here?

view this post on Zulip Jaipal Singh (Apr 13 2018 at 06:20):

I'm working on OSX.

view this post on Zulip Cezar (Apr 13 2018 at 09:57):

that's a shared library, which is built when you compile brlcad. you can find it in your build folder, inside lib

view this post on Zulip Jaipal Singh (Apr 13 2018 at 10:13):

My build/lib doesn't have libbu

view this post on Zulip Jaipal Singh (Apr 13 2018 at 10:15):

I mean, not a .dll or a .so
It has : libbu.20.0.1.dylib libbu.20.dylib libbu.a libbu.dylib

view this post on Zulip Cezar (Apr 13 2018 at 10:49):

on macos, that's libbu.dylib

view this post on Zulip Cezar (Apr 13 2018 at 10:57):

assuming you're using kanzure/python-brlcad, it seems like it doesn't support macos (yet), so to begin getting it to work, you will have to make it use .dylibs besides .dlls and .sos

view this post on Zulip Cezar (Apr 13 2018 at 10:58):

that's what's generating your error, and the message you're getting is about libbu because that's the first library it's looking for

view this post on Zulip Cezar (Apr 13 2018 at 10:59):

you could try adding .dylib to the list on line 226 and see what breaks then, and try to fix the new errors

view this post on Zulip Cezar (Apr 13 2018 at 14:21):

uh, it's a bit messy, but i got it to run examples/hilbert_2d.py on mac

view this post on Zulip Cezar (Apr 13 2018 at 14:22):

Screen-Shot-2018-04-13-at-17.21.14.png

view this post on Zulip Sean (Apr 13 2018 at 21:59):

cool! anything tricky in the setup?

view this post on Zulip Cezar (Apr 13 2018 at 22:04):

not really, running the setup shows a lot of errors from the c preprocessor, for things like not finding the definition for FILE, but compilation finishes correctly

view this post on Zulip Cezar (Apr 13 2018 at 22:05):

other than that, rtgeom.h was changed to rt/*.h and *_annotation_* was shortened to *_annot_*, and this needs to be reflected in the bindings, but these were small changes

view this post on Zulip Cezar (Apr 13 2018 at 22:07):

i actually wanted to submit a pull request, but i forget why i didn't do it. i could send it if you want me to

view this post on Zulip Sean (Apr 13 2018 at 22:29):

can't hurt if you already did the work

view this post on Zulip Sean (Apr 13 2018 at 22:29):

will save the next guy some time

view this post on Zulip Sean (Apr 13 2018 at 22:29):

:)

view this post on Zulip Cezar (Apr 13 2018 at 22:49):

i submitted a pull request. until it's merged, my changes are available here https://github.com/cezarelnazli/python-brlcad

view this post on Zulip Jaipal Singh (Apr 14 2018 at 06:55):

Thanks @Cezar ! BRLCAD python, now installs for OSX. There still seem to be some issues though. The path readers and splitters are a little cranky here so just fixing them now. :) (Ive hardcoded certain paths to get it to install for now)
Also, when I run the examples, none of them run :p_button:
This is the error that pop up on running : /examples/wdb_example.py
https://pastebin.com/SY4wzJrH

view this post on Zulip Jaipal Singh (Apr 14 2018 at 06:56):

Now, I tried looking for OP_UNION in librt but couldn't find it anywhere. Is the function deprecated or am I again missing out on something I dont know :/

view this post on Zulip Cezar (Apr 14 2018 at 07:21):

regarding your error, i think you're still using the old code (i.e., not the one with my changes)

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:23):

Oh shoot! I didn't see your latest commit! I'm sorry!
I'll work with them now. I had just changed the libraries to be read as .dylib.

Thanks and sorry :P

view this post on Zulip Cezar (Apr 14 2018 at 07:23):

ahh, it's fine

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:28):

@Cezar , does this install right out the box for you or have you made some changes to the setup.py too (uncommited)?

view this post on Zulip Cezar (Apr 14 2018 at 07:28):

it should work out of the bo

view this post on Zulip Cezar (Apr 14 2018 at 07:28):

box*

view this post on Zulip Cezar (Apr 14 2018 at 07:28):

are you having difficulties?

view this post on Zulip Cezar (Apr 14 2018 at 07:28):

if it starts printing a lot of errors about C code, you can ignore them for now

view this post on Zulip Cezar (Apr 14 2018 at 07:29):

the installation should still work

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:30):

Nah, it's not C code errors : It's
File "/Users/Troller/Documents/GSoC/18/OSX/python-brlcad/brlcad/install/options.py", line 352, in load_ctypesgen_options
raise SetupException("Couldn't find a matching brlcad installation !")
SetupException: Couldn't find a matching brlcad installation !

view this post on Zulip Cezar (Apr 14 2018 at 07:30):

uh, that's because you're not pointing it to a valid installation

view this post on Zulip Cezar (Apr 14 2018 at 07:30):

i run it as BRLCAD_PREFIX=path_to_build python setup.py install

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:30):

Yea, so I had manually fixed it then by :
# (HACKFIX : TEMP) Application Directory seems to be manually included when working with OSX
if(sys.platform == "darwin"):
valid_paths.append("/Applications/BRL-CAD : MGED 7.24.0.app/Contents/Resources/brlcad/src")

view this post on Zulip Cezar (Apr 14 2018 at 07:31):

you're pointing it at the source directory, but it needs the installation directory

view this post on Zulip Cezar (Apr 14 2018 at 07:31):

i think it should be safe if you're removing "/src" from the path you're appending

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:32):

Nah, still same error even if I remove /src
Let me try your way of installing.

view this post on Zulip Cezar (Apr 14 2018 at 07:33):

i don't know what's inside the app, i build brlcad from source

view this post on Zulip Cezar (Apr 14 2018 at 07:33):

let me download it and look for the path in there

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:35):

I've build from the source too,
When I run : sudo BRLCAD_PREFIX=/Users/Troller/Documents/GSoC/18/brlcad-svn-trunk/build python setup.py install
Error :
File "/Users/Troller/Documents/GSoC/18/OSX/python-brlcad/brlcad/install/options.py", line 322, in match_brlcad_version
for brlcad_info in brlcad_installations:
TypeError: 'NoneType' object is not iterable

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:35):

*built

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:36):

Could it have something to do with version description of python-config.cfg?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:36):

Sorry, python-brlcad.cfg

view this post on Zulip Cezar (Apr 14 2018 at 07:36):

no, the path there needs to be CMAKE_PREFIX set when you ran CMake

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:37):

To be fair, I'm really confused about the path vars, I don't know what mean what yet :(

view this post on Zulip Cezar (Apr 14 2018 at 07:37):

in other words, it needs the path where the files are going after running make install

view this post on Zulip Cezar (Apr 14 2018 at 07:37):

did you run make install?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:38):

Yup, I did

view this post on Zulip Cezar (Apr 14 2018 at 07:38):

did you modify the prefix when running cmake?

view this post on Zulip Cezar (Apr 14 2018 at 07:38):

if not, look for a brlcad installation inside /usr/local or so

view this post on Zulip Cezar (Apr 14 2018 at 07:40):

regarding running it against the downloaded binary, it seems the binaries still have the rtgeom.h header

view this post on Zulip Cezar (Apr 14 2018 at 07:40):

you could try using the old version of python-brlcad.cfg

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:40):

Nah, I didn't. I've found /usr/local/brlcad

view this post on Zulip Cezar (Apr 14 2018 at 07:40):

ok, then use that as the BRLCAD_PREFIX

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:42):

2018-04-14 13:11:50,557 - brlcad_post_install - DEBUG - Failed running brlcad-config: '/usr/local/brlcad/dev-7.27.0/bin/brlcad-config'

view this post on Zulip Cezar (Apr 14 2018 at 07:44):

try running that command manually on your cmd line, see if it works, and what errors come up

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:45):

Doesn't give an error

view this post on Zulip Cezar (Apr 14 2018 at 07:48):

is there anything else after that line?

view this post on Zulip Cezar (Apr 14 2018 at 07:48):

that should just be informative, doesn't really mean that the installation failed

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:48):

https://pastebin.com/ga49hF9r

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:49):

Nah, it does fail, but that's where I think the issue is
options.py isn't able to find a valid installation.

view this post on Zulip Cezar (Apr 14 2018 at 07:49):

ye, but we should figure out why

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:50):

I modified the python-brlcad.cfg to :
min-brlcad-version: 7.27.0
max-brlcad-version: 7.27.0

view this post on Zulip Cezar (Apr 14 2018 at 07:51):

does it work now, or did you do that before the errors?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:51):

Did that before the errors :/

view this post on Zulip Cezar (Apr 14 2018 at 07:52):

anyway, i would say try running BRLCAD_PREFIX=/usr/local/brlcad/dev-7.27.0 python setup.py install

view this post on Zulip Cezar (Apr 14 2018 at 07:52):

i think it's trying to figure out paths itself, but failing

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:54):

That's what I've been running.
So, if you look at line 348 : brlcad_installations = find_brlcad_installations(config, logger)
brlcad_installation = none

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:55):

def check_brlcad_installation(brlcad_prefix, bin_subdir, logger):
is unable to find a valid installation..

view this post on Zulip Cezar (Apr 14 2018 at 07:55):

i know that, but to get it to work, we need to figure out why

view this post on Zulip Jaipal Singh (Apr 14 2018 at 07:57):

Yea, i'm working on it as we speak

view this post on Zulip Cezar (Apr 14 2018 at 07:57):

in options.py, inside get_brlcad_param, try to print the list in the check_output call

view this post on Zulip Cezar (Apr 14 2018 at 07:57):

[brlcad_config, "--" + param_name]

view this post on Zulip Cezar (Apr 14 2018 at 07:57):

this one

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:00):

That's weird.. , result is : "/usr/brlcad/dev-7.27.0"

view this post on Zulip Cezar (Apr 14 2018 at 08:01):

printing the list? or the result of the call to brlcad-config?

view this post on Zulip Cezar (Apr 14 2018 at 08:03):

hmm... you talked earlier about getting around the SIP on mac

view this post on Zulip Cezar (Apr 14 2018 at 08:03):

did you just move the folder from /usr/brlcad to /usr/local/brlcad?

view this post on Zulip Cezar (Apr 14 2018 at 08:03):

or did you rerun cmake a second time, with /usr/locla/brlcad?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:04):

I ran a cmake again

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:06):

Running all the brlcad-config commands manually doesn't seem to be giving any error

view this post on Zulip Cezar (Apr 14 2018 at 08:06):

but what output do they give?

view this post on Zulip Cezar (Apr 14 2018 at 08:07):

if you run it using brlcad-config --includedir

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:09):

Ok, I think I figured the error

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:10):

So running brlcad-config --include dir gives : /usr/brlcad/dev-7.27.0/include

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:11):

option.py : line66
elif param_name in ["libdir", "includedir", "prefix"]:
# these are dirs: check if they exist, raise exception if not
if not os.access(result, os.R_OK):
raise SetupException("Directory for <{0}> not found: {1}".format(param_name, result))

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:11):

This is where the issue is coming: if not os.access(result, os.R_OK):

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:12):

Ran this interactively :

os.access("/usr/brlcad/dev-7.27.0/include", os.R_OK)
False

view this post on Zulip Cezar (Apr 14 2018 at 08:13):

does /usr/brlcad/dev-7.27.0 even exist?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:13):

AAHHH!! :(

view this post on Zulip Cezar (Apr 14 2018 at 08:13):

anyway, that brlcad-config is not sane

view this post on Zulip Cezar (Apr 14 2018 at 08:14):

it should give the path it's running from, not the /usr/brlcad one

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:14):

it should be /use/local/brlcad

view this post on Zulip Cezar (Apr 14 2018 at 08:14):

yep

view this post on Zulip Cezar (Apr 14 2018 at 08:15):

i looked at the binary distribution, and i see that it still has the old rtgeom.h header

view this post on Zulip Cezar (Apr 14 2018 at 08:16):

so maybe try replacing python-brlcad.cfg with the old version (not mine), and rerunning python setup.py install

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:17):

I still don't understand one thing

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:18):

Macbook:python-brlcad $ /usr/local/brlcad/dev-7.27.0/bin/brlcad-config --prefix
/usr/brlcad/dev-7.27.0

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:18):

shouldn't it return /usr/local/brlcad/dev-7.27.0 ?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:19):

Or did I mess up somewhere in the installation and setting my prefix there?

view this post on Zulip Cezar (Apr 14 2018 at 08:19):

ye, you probably messed the setup

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:20):

Aw man! :/

view this post on Zulip Cezar (Apr 14 2018 at 08:20):

you could nuke the build dir and rerun it

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:20):

Yea, I think that's the best thing to do right now?
Also, why were you recommending using the old python-brlcad.cfg?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:21):

To reinstall I'll have to delete : /usr/local/brlcad and the build folder?

view this post on Zulip Cezar (Apr 14 2018 at 08:22):

the old one was using the rtgeom.h header instead of rt/*.h. the newer versions, such as the ones built from svn, use rt/*.h, which is why i made the changes. but the one you have in /Applications/ uses the old rtgeom.h

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:22):

Ah! I see

view this post on Zulip Cezar (Apr 14 2018 at 08:22):

as for reinstallation, yes, those are the folders you'll want to delete

view this post on Zulip Cezar (Apr 14 2018 at 08:23):

i do cmake .. -DCMAKE_INSTALL_PREFIX=path_to_build -DBRLCAD_EXTRADOCS=OFF

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:23):

Cool! I'll do that

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:23):

Right away :P

view this post on Zulip Cezar (Apr 14 2018 at 08:23):

CMAKE_INSTALL_PREFIX is set to the directory you're in when building, because i don't like to clutter my path with dev stuff

view this post on Zulip Cezar (Apr 14 2018 at 08:24):

additionally, if you have ninja (or if you don't, and you have homebrew, you can brew install ninja), you can add a -G Ninja, it seems to build stuff faster

view this post on Zulip Cezar (Apr 14 2018 at 08:24):

and properly displays errors when building on multiple threads, as opposed to make

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:25):

Wait, CMAKE_INSTALL_PREFIX shouldn't be /usr/local ?

view this post on Zulip Cezar (Apr 14 2018 at 08:25):

if you want brlcad to be installed to /usr/local/, then you can set it to /usr/local. like i said, i don't want it there for myself, but you can put it there if you want to

view this post on Zulip Cezar (Apr 14 2018 at 08:26):

shouldn't matter

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:26):

Uh-huh. Yea yea. Makes sense.

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:29):

It's doing it's magic and installing now. I hope nothing breaks!
I've got class now for 90 minutes so will be AFK for a while.
Thanks a ton @Cezar today cleared up a lot of things for me!

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:30):

Also, I'm building in the build folder itself

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:32):

camke failed, errors! Ugh, I'll fix these in ASAP

view this post on Zulip Jaipal Singh (Apr 14 2018 at 08:32):

Compile libpng ........................: OFF
Compile libregex ......................: OFF
Compile zlib ..........................: OFF
Compile termlib .......................: OFF

view this post on Zulip Cezar (Apr 14 2018 at 08:34):

how is that an error?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 11:29):

Sorry, was sharing something else. Was rushing to class and ended up posting this

I installed again with : cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/
Yet, the output for :
Macbook:build $ /usr/local/brlcad/dev-7.27.0/bin/brlcad-config --prefix

/usr/brlcad/dev-7.27.0

view this post on Zulip Cezar (Apr 14 2018 at 11:34):

how about /usr/local/bin/brlcad-config --prefix?

view this post on Zulip Jaipal Singh (Apr 14 2018 at 11:49):

Nah, there's nothing there

view this post on Zulip Jaipal Singh (Apr 14 2018 at 11:50):

Just give me a couple of minutes, I'm going to try something :P

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:25):

Hey @Cezar the installation works now! I'm getting a ton of C errors but I'm not sure if they're going to impact in any way

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:26):

The errors are on the lines of : https://pastebin.com/HZ8xKvXH

view this post on Zulip Cezar (Apr 15 2018 at 13:27):

it's fine

view this post on Zulip Cezar (Apr 15 2018 at 13:29):

those errors are generated by the C preprocessor because it's processing header files "alone" and some definitions are not found. for example, if you do #include <stdio.h> #include "rt.h", and use the FILE type inside rt.h, it's fine. but if you don't include stdio.h inside rt.h, when you're running the preprocessor on rt.h alone, it won't have stdio.h and complain and throw all those errors. but compilation in pyhton-brlcad works

view this post on Zulip Cezar (Apr 15 2018 at 13:30):

sorry if what i said is badly written and doesn't make a lot of sense

view this post on Zulip Cezar (Apr 15 2018 at 13:30):

by the way, how did you solve the previous problem?

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:35):

Ah! Yea that makes sense

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:40):

So essentially, I reinstalled BRLCAD.
Commented out some parts of this function : https://pastebin.com/XML8jqfq
And cleaned the string returned from : result = subprocess.check_output([brlcad_config, "--" + param_name]). It was having trailing newline characters for some reason

view this post on Zulip Cezar (Apr 15 2018 at 13:42):

hmm... i think you had messed with it in your previous experimentations

view this post on Zulip Cezar (Apr 15 2018 at 13:43):

the clean version has a .strip() at the end, which strips any whitespace (including newline)

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:44):

Yea I suppose so
:/

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:46):

Though I'm really glad this finally worked!

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:48):

@Cezar I'm planning to take up this project and work with it during this summer as a part of GSoC. As of for now, I'm required to submit a patch of any sorts improving the current project. What would recommend would be a good patch? Any ideas off the top of your head.

view this post on Zulip Cezar (Apr 15 2018 at 13:49):

i'm a student as well, and i don't know anything about this project, sorry

view this post on Zulip Jaipal Singh (Apr 15 2018 at 13:49):

Aye! Thanks a ton for all the help though :)

view this post on Zulip Jaipal Singh (Apr 16 2018 at 15:45):

Hey @Sean , I've sent you an email with the patch. I've managed to get python BRLCAD working on OSX and am working on building a primitive right now.

view this post on Zulip Jaipal Singh (Apr 16 2018 at 15:48):

I had messed up the initial installation and that's why there was a lag.

view this post on Zulip Sean (Apr 16 2018 at 16:09):

thanks @Jaipal Singh - please submit it to the patch tracker or pull request for feedback

view this post on Zulip Jaipal Singh (Apr 16 2018 at 16:18):

Sure thing @Sean :)

view this post on Zulip Jaipal Singh (Apr 27 2018 at 10:40):

Hey @Shubham Rathore , I've updated my project details on http://brlcad.org/wiki/Google_Summer_of_Code/2018

view this post on Zulip Jaipal Singh (Apr 27 2018 at 10:42):

Hey @Sean, what part of http://brlcad.org/wiki/Summer_of_Code/Acceptance do we need to submit in writing?

view this post on Zulip Sean (Apr 27 2018 at 12:58):

You need to submit an email saying whether or not you accept the participation requirements in full.

view this post on Zulip Jaipal Singh (Apr 27 2018 at 14:47):

Ah okay!

view this post on Zulip Jaipal Singh (May 04 2018 at 10:17):

Hey @Shubham Rathore , a quick update on the project. I'm going through nmz787's python bindings for primitives. I personally feel that they are a great alternative to the initial project by kanzure and seem to be rather simple and straight forward to use. What're your views for the same?
How it works is, It creates a tcl file, then sends it to mged which then creates and populates a .g file database, the .g file is then converted with g-stl to produce an STL file.
I'm going through the code to have a clearer picture of how it works (shouldn't take very long though).
https://github.com/nmz787/python-brlcad-tcl

view this post on Zulip Shubham Rathore (May 05 2018 at 20:24):

Hi, Jaipal. First of all, can I get the link to your local repo where you've done the work mentioned previously. Or did you get it committed to the original kanzure repo. In that case I'd suggest to make a local copy and work on it. Plus updation on the readme for the macOs support should be a must.

view this post on Zulip Shubham Rathore (May 05 2018 at 20:42):

That's close to what we are trying to accomplish. I'll give you a formal definition of what need to do. First of all, just focus on binding the relevant primitives( not all primitives are required) . This shouldn't take much time. Once this is done, what we were thinking was of having a script primitive itself where you can implement the primitive in python. Kindly read about the Procedural geometry objects (line 1823) in TODO. This will give you an overview.


Last updated: Oct 09 2024 at 00:44 UTC