williamljb / DifferentiableCloth

73 stars 16 forks source link

Compile Problem #3

Open jkk5454 opened 4 years ago

jkk5454 commented 4 years ago

When I try to make the project, there is an error:

/usr/bin/ld: ./arcsim/dependencies/lib/libtaucs.a(taucs_linsolve.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC ./arcsim/dependencies/lib/libtaucs.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status

I try to change the Makefile in /dependencies/ like

cd taucs &&./configure --cc="gcc -m6 -fPIC" --enable-shared module=!METIS && $(MAKE)

but it not works.

What should I do to solve the problem?

williamljb commented 4 years ago

Can you show me the error message after you added -fPIC? I searched for Google and it seems -fPIC does the work.

jkk5454 commented 4 years ago

I just change the makefile in ~/DifferentiableCloth/arcsim/dependencies/ like the picture 1. It can make success in the dependencies but when I make it in the whole project it comes with errors. And the error message is like in picture 2. [image: 1.png] [image: 2.png]

williamljb notifications@github.com 于2020年6月9日周二 上午10:06写道:

Can you show me the error message after you added -fPIC? I searched for Google and it seems -fPIC does the work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/williamljb/DifferentiableCloth/issues/3#issuecomment-640967362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6ECRICYDG6TCYEJAPJ7Q3RVWDJ5ANCNFSM4NYEJWMQ .

williamljb commented 4 years ago

Sorry, the images did not go through. Can you resend?

jkk5454 commented 4 years ago

Sorry, the images did not go through. Can you resend?

Sorry for that. I just change the makefile in ~/DifferentiableCloth/arcsim/dependencies/ 1

It can make success in the dependencies but when I make it in the whole project it comes with errors. 2

williamljb commented 4 years ago

It seems that TAUCS is still compiled without -fPIC. Try to change the following line in taucs/config/linux.mk (the last line that defines CFLAGS): CFLAGS = -O3 -Wall -std=c99 to: CFLAGS = -O3 -Wall -std=c99 -fPIC

jkk5454 commented 4 years ago

It seems that TAUCS is still compiled without -fPIC. Try to change the following line in taucs/config/linux.mk (the last line that defines CFLAGS): CFLAGS = -O3 -Wall -std=c99 to: CFLAGS = -O3 -Wall -std=c99 -fPIC

Thanks for your opinion. I compile the project successfully. But when I run the demo code, it told me there is a segmention fault. The error log is like

3 What should I do?

williamljb commented 4 years ago

Try adding: "stretching_mult":1e-3, "bending_mult":1e4, in the 'materials' part of the json file (see demo_throw.json for example). This experiment is done before the material estimation, so the material scales are not correctly set.

jkk5454 commented 4 years ago

Try adding: "stretching_mult":1e-3, "bending_mult":1e4, in the 'materials' part of the json file (see demo_throw.json for example). This experiment is done before the material estimation, so the material scales are not correctly set.

Sorry to bother you again. When I try to use it in another training PC, there comes an error like 1 I search the problem and google told me because it is a old version of pytorch. My cuda is 11.0 and my pytorchversion is 1.5 for cuda 10.2. What should I do to solve it?

williamljb commented 4 years ago

I used PyTorch c++ extension for this project. It has nothing to do with CUDA versions. Try installing the c++ distribution of PyTorch: https://pytorch.org/cppdocs/installing.html

jkk5454 commented 4 years ago

I used PyTorch c++ extension for this project. It has nothing to do with CUDA versions. Try installing the c++ distribution of PyTorch: https://pytorch.org/cppdocs/installing.html

Thank you for your help. I successfully compile the project and run the demo. But I do not find a window program to replay the result of the demo. What software do you use to replay the obj file of result? And when I try to run the demo_throw.py, it cannot be done but killed when the demo runs. 2 What happened in the demo?

williamljb commented 4 years ago

You can use the replay option in the original arcsim: http://graphics.berkeley.edu/resources/ARCSim/

It seems your simulation time is too much. It should be set to a reasonable value at the beginning of the optimization. I remembered I used 4251 in Line 68. The current parameters are only for final rendering.

zzheng90 commented 3 years ago

PyTorch c++ extension

Excuse me, how did you install the pytorch c++ extension? and where did you put it?