yuanming-hu / taichi_mpm

High-performance moving least squares material point method (MLS-MPM) solver. (ACM Transactions on Graphics, SIGGRAPH 2018)
MIT License
2.34k stars 317 forks source link

Installation Issues #42

Open 1234shel opened 4 years ago

1234shel commented 4 years ago

Hi, I am trying to run the examples for mpm but I keep getting this error: Traceback (most recent call last): File "/taichi_mpm-master/scripts/mls-cpic/banana.py", line 8, in mpm = tc.dynamics.MPM( AttributeError: module 'taichi' has no attribute 'dynamics' I installed taichi using 'pip install'. Then I got the above error. I tried uninstalling and re-installing using the legacy link given but the install file keeps giving compile error. I have seen other people post about this as well under the "issues" section on github but no response. I hope you can help us out.

yuanming-hu commented 4 years ago

Hi @1234shel,

Sorry about that. The legacy version can only be installed by building the legacy branch of Taichi from source. What kind of compilation errors are you getting?

1234shel commented 4 years ago

Hi @yuanming-hu,

Thanks for your response. I downloaded the legacy files from here: https://github.com/yuanming-hu/taichi/tree/legacy.

Once I run the command python3 install.py it starts building the library. It stops at around 65% with a bunch of different errors:

taichi-legacy/include/taichi/math/math.h:58:12: error: no match for call to ‘(const taichi::MatrixND<3, double, taichi::InstSetExt::AVX2>) (int)’ 58 | ret = t(0);

taichi-legacy/include/taichi/math/math.h:44:14: error: cannot convert ‘const taichi::VectorND<4, float, taichi::InstSetExt::AVX2>’ to ‘float’ in argument passing 44 | ret = f(t);

taichi-legacy/include/taichi/math/math.h:31:23: error: ‘dim’ is not a member of ‘std::decay_t<const float&>’ {aka ‘float’} 31 | for (int i = 0; i < std::decay_t<decltype(t)>::dim; i++) {

taichi-legacy/include/taichi/common/meta.h:79:8: error: ‘void taichi::STATICIF::statement::else(const F&) [with F = taichi::math::sum(const T&) [with T = taichi::VectorND<4, float, taichi::InstSetExt::AVX2>; taichi::type::element = float]::<lambda(const auto:16&)>; bool Cond = true]’, declared using local type ‘const taichi::math::sum(const T&) [with T = taichi::VectorND<4, float, taichi::InstSetExt::AVX2>; taichi::type::element = float]::<lambda(const auto:16&)>’, is used but never defined [-fpermissive] 79 | void else_(const F &) {

taichi-legacy/include/taichi/common/meta.h:90:8: error: ‘void taichi::STATICIF::statement::else(const F&) [with F = taichi::math::maximum(const T&) [with T = taichi::MatrixND<2, float, taichi::InstSetExt::AVX2>; taichi::type::element = float]::<lambda(const auto:8&)>]’, declared using local type ‘const taichi::math::maximum(const T&) [with T = taichi::MatrixND<2, float, taichi::InstSetExt::AVX2>; taichi::type::element = float]::<lambda(const auto:8&)>’, is used but never defined [-fpermissive] 90 | void else_(const F &f) {

This is not an exhaustive list but nearly all errors have something to do with math.h and meta.h.

yuanming-hu commented 4 years ago

Hi @1234shel Could you try on a machine with AVX2 support (i.e. Intel Haswell generation, released 2013)?

1234shel commented 4 years ago

I am running this on a parallels VM with Ubuntu. My machine is a Apple Macbook Pro which runs on AMD Radeon Pro 5500M . I think AMD Radeon should support AVX2 but I am not sure. This is the only machine I have access to for the moment.

yuanming-hu commented 4 years ago

I see. Many users have reported that using virtual machines leads to this problem....

1234shel commented 4 years ago

I tried running on the Mac itself (outside the VM) and got the following error:

[100%] Built target taichi_core Traceback (most recent call last): File "", line 1, in File "Downloads/taichi-legacy/python/taichi/init.py", line 1, in from taichi.main import main File "/Downloads/taichi-legacy/python/taichi/main.py", line 6, in from taichi.tools.video import make_video, interpolate_frames File "/Downloads/taichi-legacy/python/taichi/tools/video.py", line 3, in import taichi.core as core File "/Downloads/taichi-legacy/python/taichi/core/init.py", line 1, in from .util import tc_core, build, format, update, install_package, load_module, start_memory_monitoring File "/Downloads/taichi-legacy/python/taichi/core/util.py", line 228, in import taichi_core as tc_core ImportError: dlopen(/Downloads/taichi-legacy/build/taichi_core.so, 2): no suitable image found. Did find: /Downloads/taichi-legacy/build/taichi_core.so: mmap() errno=5 at address=0x11DFE8000, size=0x0040D000 segment=__TEXT in Segment::map() mapping /Downloads/taichi-legacy/build/taichi_core.so Error: installation failed.

It did much better this time and reached 100% build but then crashed due to the above error. Do you have a fix for this?

1234shel commented 4 years ago

@yuanming-hu do you have a solution for the above error?