NGSolve / ngsolve

Netgen/NGSolve is a high performance multiphysics finite element software. It is widely used to analyze models from solid mechanics, fluid dynamics and electromagnetics. Due to its flexible Python interface new physical equations and solution algorithms can be implemented easily.
https://ngsolve.org/
GNU Lesser General Public License v2.1
429 stars 79 forks source link

Error when building on asahi linux (arm linux distribution for macbook air M1) #74

Open arthuradriaens-code opened 2 weeks ago

arthuradriaens-code commented 2 weeks ago

When building from source using make, the following error occurs:

[ 7%] Building CXX object basiclinalg/CMakeFiles/ngbla.dir/ngblas.cpp.o In file included from /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:1, from /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd.hpp:32, from /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/ngcore.hpp:16, from /home/aadriaens/Programs/ngsolve/ngsolve-src/ngstd/ngstd.hpp:33, from /home/aadriaens/Programs/ngsolve/ngsolve-src/basiclinalg/bla.hpp:5, from /home/aadriaens/Programs/ngsolve/ngsolve-src/basiclinalg/ngblas.cpp:3: /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h: In function ‘void ngcore::FMAComplex(SIMD<double, 2>, SIMD<double, 2>, SIMD<double, 2>&)’: /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27541:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_rot90_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27541 | vcmlaq_rot90_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:163:49: note: van hieruit opgeroepen 163 | c = vcmlaq_rot90_f64(tmp, a.Data(), b.Data()); // += i*aim * b | ^ /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27488:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27488 | vcmlaq_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:162:26: note: van hieruit opgeroepen 162 | auto tmp = vcmlaq_f64(c.Data(), a.Data(), b.Data()); // are * b | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27488:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27488 | vcmlaq_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:162:26: note: van hieruit opgeroepen 162 | auto tmp = vcmlaq_f64(c.Data(), a.Data(), b.Data()); // are * b | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27541:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_rot90_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27541 | vcmlaq_rot90_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:163:49: note: van hieruit opgeroepen 163 | c = vcmlaq_rot90_f64(tmp, a.Data(), b.Data()); // += i*aim * b | ^ /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27488:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27488 | vcmlaq_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:162:26: note: van hieruit opgeroepen 162 | auto tmp = vcmlaq_f64(c.Data(), a.Data(), b.Data()); // are * b | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/aarch64-redhat-linux/14/include/arm_neon.h:27541:1: fout: inlining failed in call to ‘always_inline’ ‘float64x2_t vcmlaq_rot90_f64(float64x2_t, float64x2_t, float64x2_t)’: target specific option mismatch 27541 | vcmlaq_rot90_f64 (float64x2_t __r, float64x2_t __a, float64x2_t __b) | ^~~~~~~~~~~~~~~~ /home/aadriaens/Programs/ngsolve/ngsolve-install/include/core/simd_arm64.hpp:163:49: note: van hieruit opgeroepen 163 | c = vcmlaq_rot90_f64(tmp, a.Data(), b.Data()); // += i*aim * b | ^ make[5]: *** [basiclinalg/CMakeFiles/ngbla.dir/build.make:216: basiclinalg/CMakeFiles/ngbla.dir/ngblas.cpp.o] Fout 1 make[4]: *** [CMakeFiles/Makefile2:567: basiclinalg/CMakeFiles/ngbla.dir/all] Fout 2 make[3]: *** [Makefile:146: all] Fout 2 make[2]: *** [CMakeFiles/ngsolve.dir/build.make:89: dependencies/src/ngsolve-stamp/ngsolve-build] Fout 2 make[1]: *** [CMakeFiles/Makefile2:225: CMakeFiles/ngsolve.dir/all] Fout 2 make: *** [Makefile:156: all] Fout 2

is this an issue with ngbla, my arm cpp compiler or my build flags (the only modification to the cmake command I did was to add -DBUILD_OCC=ON)? I'm quite lost on the error description.

Thanks in advance and kind regards

mhochsteger commented 2 weeks ago

Hm, seems some intrinsics in the simd functions cannot be inlined. Does it compile if you remove ((__always_inline__)) from lines 70-73 in ngsolve/external_dependencies/netgen/libsrc/core/ngcore_api.hpp?