alecjacobson / FAST

Fast Automatic Skinning Transformations
Mozilla Public License 2.0
66 stars 11 forks source link

Library problem under Linux #2

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi Alec, here is Cat again :)

After we got the libigl examples to run, I now try your FAST program. And again, I have problems to compile it. Maybe you can help me again:

I already fixed some issues in the makefile.conf, I think:

  1. the Eigen include line needs a space between the two includes

-I$(LIBIGL)/external/nanogui/ext/eigen/ -I$(LIBIGL)/external/nanogui/ext/eigen/unsupported

  1. I added the Anttweakbar includes and libs like in the non-linux version:
ANT_INC=-I$(LIBIGL)/external/AntTweakBar/include
ANT_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar 
  1. I added a -pthread parameter to CFLAGS to get rid of some pthread errors

Now it compiles but I get an error when I try to run it:

./skinning ogre/
./skinning: error while loading shared libraries: libAntTweakBar.so.1: cannot open shared object file: No such file or directory

the file is in the AntTweakBar/lib directory but the program can't find it...

Thanks in advance Cat

alecjacobson commented 7 years ago

Thanks for the 3 changes. I've committed them.

Your dynamic linker is probably not finding the libAntTweakBar.so because its directory is not in your dynamic linking path. Dynamic libraries are a pain, so I recommend building AntTweakbar as a static library (aka archive) using libigl/external/AntTweakBar/src/Makefile.static

ghost commented 7 years ago

Unfortunately there is no Makefile.static in the path you're suggesting. Can you explain how to do the build as a static library? What do I have to change in the original makefile?

alecjacobson commented 7 years ago

Oh, true. If you use the plain Makefile, what files appear in the libigl/external/AntTweakBar/lib directory? I think it is building both the shared(dynamic) library and the static library, but the compiler is opting to link to the shared one. It might be as simple as deleting the shared library or explicitly linking to the static library when building FAST.

ghost commented 7 years ago

In libigl/external/AntTweakBar/lib I have: AntTweakBar64.dll AntTweakBar.dll libAntTweakBar.a libAntTweakBar.so libAntTweakBar.so.1 AntTweakBar64.lib AntTweakBar.lib Readme.txt

I tried to delete the .so and .so.1 and compiled FAST again with the following error: make -B

/usr/bin/ld: ../libigl//external/AntTweakBar/lib/libAntTweakBar.a(TwMgr.o): undefined reference to symbol 'XCreateBitmapFromData'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

the .a lib is the static one, isn't it? The Compiler seems to find it (referring to the error output)... What else do I have to change?

alecjacobson commented 7 years ago

This is progress. But now it seems that it's not finding some of the X11 libraries that AntTweakBar is using. See if you can compile and run the AntTweakBar examples.

On Fri, Dec 9, 2016 at 3:14 AM, Catrexis notifications@github.com wrote:

In libigl/external/AntTweakBar/lib I have: AntTweakBar64.dll AntTweakBar.dll libAntTweakBar.a libAntTweakBar.so libAntTweakBar.so.1 AntTweakBar64.lib AntTweakBar.lib Readme.txt

I tried to delete the .so and .so.1 and compiled FAST again with the following error: make -B

/usr/bin/ld: ../libigl//external/AntTweakBar/lib/libAntTweakBar.a(TwMgr.o): undefined reference to symbol 'XCreateBitmapFromData' //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

the .a lib is the static one, isn't it? The Compiler seems to find it (referring to the error output)... What else do I have to change?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alecjacobson/FAST/issues/2#issuecomment-265958049, or mute the thread https://github.com/notifications/unsubscribe-auth/ACI0marSdpufmahpOEkjFVlrQQcaRPPTks5rGQ3ygaJpZM4LH108 .

ghost commented 7 years ago

I added

-L/usr/lib/x86_64-linux-gnu/ -lX11

in the ANT_LIB section of Makefile.conf. Now the error disappears and the project compiles.

When I type ./skinning ogre/ the viewer appears, but it seems that it can't load the mesh.off from the ogre example:

./skinning ogre/
getcwd(): /homes/mkomaritzan/research/FAST/FAST/skinning
cd .
getcwd(): /homes/mkomaritzan/research/FAST/FAST/skinning
Loading mesh from file /var/tmp/.skinning_temp/mesh.obj...succeeded
Loading mesh from file /var/tmp/.skinning_temp/mesh.off...IOError: /var/tmp/.skinning_temp/mesh.off could not be opened...
failed
IOError: /var/tmp/.skinning_temp/mesh.mesh could not be opened...Loading mesh from file /var/tmp/.skinning_temp/mesh.mesh...failed
Loading weights... succeeded
Clearing bone roots...
Loading bone roots... bones.size(): 0
Bones match... Just loading data into existing bones...
Error: initialize_transformations() WI empty
loaded bone roots...
BoneBoneCopyMap constructed...
pushed back...
while...
next_name: /var/tmp/.skinning_temp/bone_roots-1.bf
loaded bone roots animation...
succeeded
IOError: ogre//mesh.obj could not be opened...
Loading mesh from file ogre//mesh.obj...failed
Loading mesh from file ogre//mesh.off...IOError: ogre//mesh.off could not be opened...
failed
IOError: ogre//mesh.mesh could not be opened...Loading mesh from file ogre//mesh.mesh...failed
IOError: readDMAT() could not open ogre//weights.dmat...
Loading weights... failed
Clearing bone roots...
Loading bone roots... IOError: read_BF could not open ogre//bone_roots.bfBones match... Just loading data into existing bones...
Error: initialize_transformations() WI empty
loaded bone roots...
BoneBoneCopyMap constructed...
pushed back...
while...
next_name: ogre//bone_roots-1.bf
loaded bone roots animation...
succeeded
ERROR: not able to open ogre//rebar.rbr for reading...
  successfully loaded shader from GLSL/lbs.frag
  successfully loaded shader from ./GLSL/directionalperpixel.frag
  successfully loaded shader from ./GLSL/directionalperpixelcolor.frag
  successfully loaded shader from ./GLSL/weightcolors.frag
  successfully loaded shader from ./GLSL/scalar.frag
  successfully loaded shader from ./GLSL/lbsOptimized.frag
Link info
---------
error: the locations of a builtin vertex attribute (named gl_MultiTexCoord0) and a bound generic vertex attribute (named weights0) collided; assign the generic attribute to a different location via glBindAttribLocationARB

  successfully loaded shader from ./GLSL/lbsTextured.frag
GL_MAX_VERTEX_ATTRIBS: 16
GL_MAX_VERTEX_UNIFORM_COMPONENTS: 4096
GL_VERSION: 4.5.0 NVIDIA 367.44
GL_SHADING_LANGUAGE_VERSION: 4.50 NVIDIA
GL_RENDERER: GeForce GTX 980/PCIe/SSE2
ERROR: send_transformations() num_handles == 0
Directory /var/tmp/.skinning_temp already exists
Saving ReantTweakBar...succeeded
Saving Mesh...succeeded
Saving weights...succeeded
Saving bone forest...succeeded

What is this var/tmp directory? Shouldn't it be ../examples/ogre/ or sth like that?

alecjacobson commented 7 years ago

Seems like it simple can't find those files. Check the paths.

On Mon, 12 Dec 2016 at 07:35, Catrexis notifications@github.com wrote:

I added

-L/usr/lib/x86_64-linux-gnu/ -lX11

in the ANT_LIB section of Makefile.conf. Now the error disappears and the project compiles.

When I type ./skinning ogre/ the viewer appears but it seems that he can't load the mesh.off from the ogre example:

./skinning ogre/ getcwd(): /homes/mkomaritzan/research/FAST/FAST/skinning cd . getcwd(): /homes/mkomaritzan/research/FAST/FAST/skinning Loading mesh from file /var/tmp/.skinning_temp/mesh.obj...succeeded Loading mesh from file /var/tmp/.skinning_temp/mesh.off...IOError: /var/tmp/.skinning_temp/mesh.off could not be opened... failed IOError: /var/tmp/.skinning_temp/mesh.mesh could not be opened...Loading mesh from file /var/tmp/.skinning_temp/mesh.mesh...failed Loading weights... succeeded Clearing bone roots... Loading bone roots... bones.size(): 0 Bones match... Just loading data into existing bones... Error: initialize_transformations() WI empty loaded bone roots... BoneBoneCopyMap constructed... pushed back... while... next_name: /var/tmp/.skinning_temp/bone_roots-1.bf loaded bone roots animation... succeeded IOError: ogre//mesh.obj could not be opened... Loading mesh from file ogre//mesh.obj...failed Loading mesh from file ogre//mesh.off...IOError: ogre//mesh.off could not be opened... failed IOError: ogre//mesh.mesh could not be opened...Loading mesh from file ogre//mesh.mesh...failed IOError: readDMAT() could not open ogre//weights.dmat... Loading weights... failed Clearing bone roots... Loading bone roots... IOError: read_BF could not open ogre//bone_roots.bfBones match... Just loading data into existing bones... Error: initialize_transformations() WI empty loaded bone roots... BoneBoneCopyMap constructed... pushed back... while... next_name: ogre//bone_roots-1.bf loaded bone roots animation... succeeded ERROR: not able to open ogre//rebar.rbr for reading... successfully loaded shader from GLSL/lbs.frag successfully loaded shader from ./GLSL/directionalperpixel.frag successfully loaded shader from ./GLSL/directionalperpixelcolor.frag successfully loaded shader from ./GLSL/weightcolors.frag successfully loaded shader from ./GLSL/scalar.frag successfully loaded shader from ./GLSL/lbsOptimized.frag Link info

error: the locations of a builtin vertex attribute (named gl_MultiTexCoord0) and a bound generic vertex attribute (named weights0) collided; assign the generic attribute to a different location via glBindAttribLocationARB

successfully loaded shader from ./GLSL/lbsTextured.frag GL_MAX_VERTEX_ATTRIBS: 16 GL_MAX_VERTEX_UNIFORM_COMPONENTS: 4096 GL_VERSION: 4.5.0 NVIDIA 367.44 GL_SHADING_LANGUAGE_VERSION: 4.50 NVIDIA GL_RENDERER: GeForce GTX 980/PCIe/SSE2 ERROR: send_transformations() num_handles == 0 Directory /var/tmp/.skinning_temp already exists Saving ReantTweakBar...succeeded Saving Mesh...succeeded Saving weights...succeeded Saving bone forest...succeeded

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/alecjacobson/FAST/issues/2#issuecomment-266421056, or mute the thread https://github.com/notifications/unsubscribe-auth/ACI0me5nNkpz0jNJm5N4c6-R7lLLOTfQks5rHT-qgaJpZM4LH108 .

ghost commented 7 years ago

Okay I copied the examples in the skinning directory and now it works. =) Thanks for your help.

As soon as I add extra weights and turn on Auto DOF, the skin becomes jagged. In which configuration do the extra weights enhance the skinning result?

alecjacobson commented 7 years ago

Hard to say what's going on. It's been a long time since I looked at the extra weights code. It might be adding too many extra weights or doing a poor job deciding which ones to use (the LBS shader will use only a small number of weights).

On Tue, Dec 13, 2016 at 3:17 AM, Catrexis notifications@github.com wrote:

Okay i copied the examples in the skinning directory and now it works. =) Thanks for your help.

As soon as I add extra weights and turn on Auto DOF, the skin becomes jagged. In which configuration do the extra weights enhance the skinning result?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alecjacobson/FAST/issues/2#issuecomment-266674406, or mute the thread https://github.com/notifications/unsubscribe-auth/ACI0mTPOml9kDf46vIMO1VNu88it7C00ks5rHlSCgaJpZM4LH108 .