Stream: Google Code-in

Topic: Building rt^3


view this post on Zulip Mahdi (Dec 11 2017 at 01:39):

Anyone know what the embeddedlua errors are for? I keep getting things like "error: 'free' was not declared in this scope." When trying to run sudo make on the rt^3 makefile

view this post on Zulip Naseef (Dec 11 2017 at 02:23):

hmm... why run make as root?
and, is there any erros with cmake? you probably have to install BRL-CAD before buildin rt^3

view this post on Zulip Mahdi (Dec 11 2017 at 20:42):

My directory for the files was restricted to the root user. Do you know how I may resolve the issue? I also installed BRLCAD 2 weeks ago so it's odd for it not to work

view this post on Zulip Daniel Rossberg (Dec 11 2017 at 20:43):

chown -R <user>:<groop> *?

view this post on Zulip Mahdi (Dec 11 2017 at 20:45):

I've tried building it without a rooted directory and it still wouldn't work

view this post on Zulip Mahdi (Dec 11 2017 at 20:45):

The embeddedlua files seem to throw it off

view this post on Zulip Daniel Rossberg (Dec 11 2017 at 20:46):

I've never even tried to build it as root.

view this post on Zulip Mahdi (Dec 11 2017 at 20:48):

Do you have any ideas why it wont build properly?

view this post on Zulip Sean (Dec 11 2017 at 20:49):

you should never need to compile as root -- if you did, something else was wrong and compiling as root causes other problems

view this post on Zulip Sean (Dec 11 2017 at 20:50):

whenever I hear someone do that, my recommendation is to delete the directory and start over -- you made a mess and trying to figure out where the mess started is a bit of a waste of time... :)

view this post on Zulip Mahdi (Dec 11 2017 at 20:52):

I've tried to do it without root and it didn't work but I'll give it another shot.

view this post on Zulip Daniel Rossberg (Dec 11 2017 at 20:53):

Do you mean make or make install?

view this post on Zulip Mahdi (Dec 11 2017 at 20:56):

Reading the installation guide it says to use su -c "make install" but reports that no rule was made for "install."

view this post on Zulip Mahdi (Dec 11 2017 at 20:57):

I've tried setting the install path and base dir in the cmake

view this post on Zulip Mahdi (Dec 11 2017 at 20:57):

No luck

view this post on Zulip Mahdi (Dec 11 2017 at 21:00):

Is that a common error?

view this post on Zulip Daniel Rossberg (Dec 11 2017 at 21:12):

No. My point was that the standard installation directory can only be created by root. But, if you changed the install path in CMake to something in your home directory ...

view this post on Zulip Mahdi (Dec 11 2017 at 21:16):

(deleted)

view this post on Zulip Sean (Dec 11 2017 at 22:11):

@Mahdi try compiling (i.e., "make" on Linux or Compile in MSVC on Windows) and report whether that succeeds or not

view this post on Zulip Sean (Dec 11 2017 at 22:11):

you might not even need to install

view this post on Zulip Mahdi (Dec 11 2017 at 23:32):

So I create a makefile in /build and run make on it, right? I've done that before without success as it always fails with the lua

view this post on Zulip Sean (Dec 11 2017 at 23:38):

saying it fails doesn't tell anyone anything that could possibly be helpful :)

view this post on Zulip Sean (Dec 11 2017 at 23:38):

what platform are you on?

view this post on Zulip Mahdi (Dec 11 2017 at 23:46):

My apologies, I was just about to send the error information:

view this post on Zulip Daniel Rossberg (Dec 12 2017 at 08:01):

@Mahdi You should install BRL-CAD before and add the bin directory of the installation to your path environment variable.

view this post on Zulip caleb parks (Dec 19 2017 at 18:39):

I have been trying to build rt^3 but I have been getting errors.
the error I have been getting is:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: [lib/libge.dylib] Error 1
make[1]:
[src/libge/CMakeFiles/ge.dir/all] Error 2
make: *** [all] Error 2
I am building this on mac

view this post on Zulip Sean (Dec 19 2017 at 18:41):

caleb can you run "make VERBOSE=1" and post all the output?

view this post on Zulip caleb parks (Dec 19 2017 at 18:44):

here is the output https://gist.github.com/sunkink29/057534fb413f1d5be8c084f7869d1c69

view this post on Zulip Sean (Dec 19 2017 at 18:50):

@caleb parks try this: edit src/libge/CMakeLists.txt, find the ge_SRCS section, and add ../coreInterface/BagOfTriangles.cpp to the list

view this post on Zulip Sean (Dec 19 2017 at 18:52):

in that same file, also edit the bottom TARGET_LINK_LIBRARIES line and put nmg into the list e.g., TARGET_LINK_LIBRARIES(ge nmg ${BRLCAD_BU_LIBRARY} ...

view this post on Zulip caleb parks (Dec 19 2017 at 19:01):

that worked to get past that part but it threw another error
here is the log: https://gist.github.com/sunkink29/057534fb413f1d5be8c084f7869d1c69

view this post on Zulip Sean (Dec 19 2017 at 19:03):

it didn't get past it, it just fixed one set of symbols -- there' s a handful in there missing

view this post on Zulip Sean (Dec 19 2017 at 19:03):

actually doesn't look different...

view this post on Zulip caleb parks (Dec 19 2017 at 19:04):

sorry that was the same one. I updated it now

view this post on Zulip Sean (Dec 19 2017 at 19:05):

ahh, that's definitely different ;)

view this post on Zulip Sean (Dec 19 2017 at 19:06):

do you have BRL-CAD installed?

view this post on Zulip Sean (Dec 19 2017 at 19:07):

okay, I see that you installed it into /usr/local/brlcad

view this post on Zulip Sean (Dec 19 2017 at 19:07):

run this: ls -la /usr/local/brlcad/lib/libnmg.dylib

view this post on Zulip caleb parks (Dec 19 2017 at 19:09):

this is what I get back
-rwxr-xr-x 1 root wheel 951324 Dec 18 22:01 /usr/local/brlcad/lib/libnmg.dylib

view this post on Zulip Sean (Dec 19 2017 at 19:09):

okay, so it's just a build burp that you can work around temporarily...

view this post on Zulip Sean (Dec 19 2017 at 19:10):

run this: cd "/Users/RPS/Documents/BRL-CAD/rt^3/.build/src/libge"

view this post on Zulip Sean (Dec 19 2017 at 19:10):

then:

view this post on Zulip Sean (Dec 19 2017 at 19:11):

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -g -dynamiclib -Wl,-headerpad_max_install_names -o ../../lib/libge.dylib -install_name "/Users/RPS/Documents/BRL-CAD/rt^3/.build/lib/"libge.dylib CMakeFiles/ge.dir/GeometryEngine.o CMakeFiles/ge.dir/MinimalDatabase.o CMakeFiles/ge.dir/MinimalObject.o CMakeFiles/ge.dir/__/coreInterface/Arb8.o CMakeFiles/ge.dir/__/coreInterface/BagOfTriangles.o CMakeFiles/ge.dir/__/coreInterface/Combination.o CMakeFiles/ge.dir/__/coreInterface/Cone.o CMakeFiles/ge.dir/__/coreInterface/ConstDatabase.o CMakeFiles/ge.dir/__/coreInterface/Database.o CMakeFiles/ge.dir/__/coreInterface/Ellipsoid.o CMakeFiles/ge.dir/__/coreInterface/EllipticalTorus.o CMakeFiles/ge.dir/__/coreInterface/FileDatabase.o CMakeFiles/ge.dir/__/coreInterface/globals.o CMakeFiles/ge.dir/__/coreInterface/Halfspace.o CMakeFiles/ge.dir/__/coreInterface/HyperbolicCylinder.o CMakeFiles/ge.dir/__/coreInterface/Hyperboloid.o CMakeFiles/ge.dir/__/coreInterface/MemoryDatabase.o CMakeFiles/ge.dir/__/coreInterface/NonManifoldGeometry.o CMakeFiles/ge.dir/__/coreInterface/Object.o CMakeFiles/ge.dir/__/coreInterface/ParabolicCylinder.o CMakeFiles/ge.dir/__/coreInterface/Paraboloid.o CMakeFiles/ge.dir/__/coreInterface/Particle.o CMakeFiles/ge.dir/__/coreInterface/Pipe.o CMakeFiles/ge.dir/__/coreInterface/Torus.o CMakeFiles/ge.dir/__/coreInterface/Unknown.o /usr/local/brlcad/lib/libnmg.dylib /usr/local/brlcad/lib/libbu.dylib /usr/local/brlcad/lib/libbn.dylib /usr/local/brlcad/lib/librt.dylib /usr/local/brlcad/lib/libwdb.dylib

view this post on Zulip caleb parks (Dec 19 2017 at 19:14):

got this error back:
Undefined symbols for architecture x86_64:
"BRLCAD::Sphere::ClassName()", referenced from:
BRLCAD::Database::Add(BRLCAD::Object const&) in Database.o
"BRLCAD::Sphere::Sphere(resource, directory, rt_db_internal, db_i)", referenced from:
BRLCAD::ConstDatabase::Get(char const*, BRLCAD::ConstDatabase::ObjectCallback&) const in ConstDatabase.o
"BRLCAD::Sphere::~Sphere()", referenced from:
BRLCAD::ConstDatabase::Get(char const*, BRLCAD::ConstDatabase::ObjectCallback&) const in ConstDatabase.o
"BRLCAD::Sphere::Internal() const", referenced from:
BRLCAD::Database::Add(BRLCAD::Object const&) in Database.o
"typeinfo for BRLCAD::Sphere", referenced from:
BRLCAD::Database::Add(BRLCAD::Object const&) in Database.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

view this post on Zulip Sean (Dec 19 2017 at 19:34):

okay cool, so just a couple more lines missing from that CMakeLists.txt file that you edited

view this post on Zulip Sean (Dec 19 2017 at 19:40):

@caleb parks I assume you have an svn checkout, yes? try "svn up" in the top source directory. you should see a couple files update with changes I just made

view this post on Zulip caleb parks (Dec 19 2017 at 19:50):

I now have this error:
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:35: warning:
missing terminating '"' character [-Winvalid-pp-token]
const char* const TheLuaScript = R"ESCSEQ(
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:34: error: use of
undeclared identifier 'R'
const char* const TheLuaScript = R"ESCSEQ(
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:35: error:
expected ';' after top level declarator
const char* const TheLuaScript = R"ESCSEQ(
^
;
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:42:8: warning:
missing terminating '"' character [-Winvalid-pp-token]
)ESCSEQ";
^
2 warnings and 2 errors generated.
make[2]: [tests/embeddedLua/CMakeFiles/hellobrlcad.dir/hellobrlcad.o] Error 1
make[1]:
[tests/embeddedLua/CMakeFiles/hellobrlcad.dir/all] Error 2

view this post on Zulip Sean (Dec 19 2017 at 19:52):

@caleb parks try editing tests/embeddedLua/hellobrlcad.cpp and change the print("Hello ", database:Title(), "!") line to:

view this post on Zulip Sean (Dec 19 2017 at 19:52):

print(\"Hello \", database:Title(), \"!\")

view this post on Zulip Sean (Dec 19 2017 at 19:53):

i.e., put a slash before all of the double quote characters just on that line

view this post on Zulip caleb parks (Dec 19 2017 at 20:02):

I get even more errors:
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:35: warning:
missing terminating '"' character [-Winvalid-pp-token]
const char* const TheLuaScript = R"ESCSEQ(
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:34: error: use of
undeclared identifier 'R'
const char* const TheLuaScript = R"ESCSEQ(
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:40:35: error:
expected ';' after top level declarator
const char* const TheLuaScript = R"ESCSEQ(
^
;
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:41:8: error:
non-ASCII characters are not allowed outside of literals and identifiers
print(\”Hello \”, database:Title(), \”!\”)
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:41:18: error:
non-ASCII characters are not allowed outside of literals and identifiers
print(\”Hello \”, database:Title(), \”!\”)
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:41:42: error:
non-ASCII characters are not allowed outside of literals and identifiers
print(\”Hello \”, database:Title(), \”!\”)
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:41:47: error:
non-ASCII characters are not allowed outside of literals and identifiers
print(\”Hello \”, database:Title(), \”!\”)
^
/Users/RPS/Documents/BRL-CAD/rt^3/tests/embeddedLua/hellobrlcad.cpp:42:8: warning:
missing terminating '"' character [-Winvalid-pp-token]
)ESCSEQ";
^
2 warnings and 6 errors generated.
make[2]: [tests/embeddedLua/CMakeFiles/hellobrlcad.dir/hellobrlcad.o] Error 1
make[1]:
[tests/embeddedLua/CMakeFiles/hellobrlcad.dir/all] Error 2

view this post on Zulip Sean (Dec 19 2017 at 20:03):

okay, no worries, that was just a guess -- let me see what's going on there

view this post on Zulip Sean (Dec 19 2017 at 20:07):

ahhh, it's a c++11 thing

view this post on Zulip Sean (Dec 19 2017 at 20:09):

@caleb parks try this instead: const char* const TheLuaScript = "print(\"Hello \", database:Title(), \"!\")";

view this post on Zulip Sean (Dec 19 2017 at 20:10):

actually: const char* const TheLuaScript = "print(\"Hello \", database:Title(), \"!\")\n";

view this post on Zulip caleb parks (Dec 19 2017 at 20:16):

it compiled correctly after that change

view this post on Zulip Jeff Sieu (Dec 22 2017 at 17:48):

I'm having trouble trying to build rt^3. I have installed CMake, pkg-config and OGRE.
I built BRL-CAD from source, but haven't make install, only make.

I've tried setting the relevant paths in CMakeLists.txt in the root folder of rt3 like so (/home/jeff/Documents/brlcad is the location of the folder containing brlcad):

SET(BRLCAD_BASE_DIR /home/jeff/Documents/brlcad)
SET(BRLCAD_HEADERS_DIR /home/jeff/Documents/brlcad/src)
SET(BRLCAD_OPENNURBS_HEADERS_DIR /home/jeff/Documents/brlcad/src/other/openNURBS)
SET(TCL_INCLUDE_PATH /home/jeff/Documents/brlcad/src/other/tcl)

Then I tried building by doing:

cd rt3
mkdir build
cd build
cmake ...

which looked fine (no errors from cmake), but executing

make

returned a bunch of not declared in this scopes.

Also tried:

cd src/other
sudo make install

but this returns
file INSTALL cannot find "/include/embeddedlua.h

view this post on Zulip Daniel Rossberg (Dec 22 2017 at 19:55):

@Jeff Sieu Please try again after an svn update. There seem to be differences between the gcc versions (maybe in connection with the standard C++ compliance).

view this post on Zulip Jeff Sieu (Dec 23 2017 at 05:00):

Now I get this when I try to build in rt3/build and the same file INSTALL cannot find "/include/embeddedlua.h running make install in src/other.

view this post on Zulip Daniel Rossberg (Dec 23 2017 at 10:44):

@Jeff Sieu Please, do a svn update again.

view this post on Zulip Jeff Sieu (Dec 23 2017 at 16:05):

I got it to build! I had to install brlcad release via make install first.

view this post on Zulip Daniel Rossberg (Dec 23 2017 at 16:14):

:tada:
Installing BRL-CAD before helps (and is part of the task description ;) It's possible to set all the paths by hand, but it's not easy.

view this post on Zulip Naseef (Jan 11 2018 at 09:24):

/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.9.1: undefined reference to `png_set_interlace_handling@PNG16_0'

view this post on Zulip Naseef (Jan 11 2018 at 09:24):

Some missing libs?

view this post on Zulip Sean (Jan 12 2018 at 16:57):

that's usually version incompatibility. you have a system-installed libQt5Gui library that uses libpng, but the libpng it found didn't have a function it needs (png_set_interface_handling())

view this post on Zulip Sean (Jan 12 2018 at 16:57):

the fix can be tricky, can be simple

view this post on Zulip Naseef (Jan 12 2018 at 16:58):

Using my own libpng?

view this post on Zulip Naseef (Jan 12 2018 at 16:58):

Is the libpng in brl-cad older?

view this post on Zulip Sean (Jan 12 2018 at 17:13):

no, brl-cad includes a very new version (which can cause that problem too)

view this post on Zulip Sean (Jan 12 2018 at 17:13):

it would be newer than whatever qt5 used

view this post on Zulip Naseef (Jan 12 2018 at 17:19):

Well, Can I put older version of libpng(the version Qt5 use) in a different location and link Qt with that version instead of the one in BRL-CAD?

view this post on Zulip Sean (Jan 12 2018 at 19:15):

that should be possible -- you'll probably need to rebuild BRL-CAD and make sure libpng compilation is turned off (you may need to point it at the one Qt used)

view this post on Zulip Naseef (Jan 12 2018 at 19:51):

I'll try ...


Last updated: Oct 09 2024 at 00:44 UTC