Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on PPC: simd_vector_scalar.h: error: assignment of read-only location '* data' #166

Open
barracuda156 opened this issue Jan 7, 2023 · 2 comments

Comments

@barracuda156
Copy link

:info:build cd /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/build/tests/test_matmul && /opt/local/bin/g++-mp-12  -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/.. -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/test_matmul/../.. -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -std=gnu++14 -MD -MT tests/test_matmul/CMakeFiles/test_matmul.dir/test_matmul.cpp.o -MF CMakeFiles/test_matmul.dir/test_matmul.cpp.o.d -o CMakeFiles/test_matmul.dir/test_matmul.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/test_matmul/test_matmul.cpp
:info:build In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/simd_vector/SIMDVector.h:5,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/Fastor.h:17,
:info:build                  from /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/test_tensormap/test_tensormap.cpp:1:
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/simd_vector/simd_vector_scalar.h: In instantiation of 'void Fastor::SIMDVector<T, Fastor::simd_abi::scalar>::store(T*, bool) const [with T = const int]':
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/tensor/TensorAssignment.h:19:42:   required from 'void Fastor::trivial_assign(AbstractTensor<Derived, DIM>&, const AbstractTensor<Derived1, DIM1>&) [with Derived = Tensor<int, 3, 1>; long unsigned int DIM = 2; OtherDerived = BinaryAddOp<TensorMap<const int, 3, 1>, TensorMap<const int, 3, 1>, 2>; long unsigned int OtherDIM = 2]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/expressions/binary_ops/binary_arithmetic_assignment.h:107:1:   required from 'void Fastor::assign(AbstractTensor<Derived, DIM>&, const BinaryAddOp<TLhs, TRhs, OtherDIM>&) [with Derived = Tensor<int, 3, 1>; long unsigned int DIM = 2; TLhs = TensorMap<const int, 3, 1>; TRhs = TensorMap<const int, 3, 1>; long unsigned int OtherDIM = 2; typename std::enable_if<(((! is_primitive_v_<TLhs>) && (! is_primitive_v_<TRhs>)) && (!(requires_evaluation_v<TLhs> || requires_evaluation_v<TRhs>))), bool>::type <anonymous> = false]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/tensor/Tensor.h:108:15:   required from 'Fastor::Tensor<T, Rest>::Tensor(const Fastor::AbstractTensor<Derived, DIMS>&) [with Derived = Fastor::BinaryAddOp<Fastor::TensorMap<const int, 3, 1>, Fastor::TensorMap<const int, 3, 1>, 2>; long unsigned int DIMS = 2; typename std::enable_if<((((! has_tensor_view_v<Derived>) && (! has_tensor_fixed_view_2d_v<Derived>)) && (! has_tensor_fixed_view_nd_v<Derived>)) || (DIMS != sizeof... (Rest))), bool>::type <anonymous> = false; T = int; long unsigned int ...Rest = {3, 1}]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/tensor/AbstractTensorFunctions.h:20:35:   required from 'typename Derived::result_type Fastor::evaluate(const AbstractTensor<Derived, DIM>&) [with Derived = BinaryAddOp<TensorMap<const int, 3, 1>, TensorMap<const int, 3, 1>, 2>; long unsigned int DIMS = 2; typename Derived::result_type = Tensor<int, 3, 1>]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/test_tensormap/test_tensormap.cpp:115:35:   required from 'void run() [with T = int]'
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/test_tensormap/test_tensormap.cpp:143:13:   required from here
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_fastor/fastor/work/Fastor-6d7216f304d60d92b9b042566d4d6e94c65086a3/tests/../Fastor/simd_vector/simd_vector_scalar.h:26:74: error: assignment of read-only location '* data'
:info:build    26 |     FASTOR_INLINE void store(T *data, bool Aligned=true) const { data[0] = value; unused(Aligned); }
:info:build       |                                                                  ~~~~~~~~^~~~~~~
@barracuda156
Copy link
Author

fastor.txt

@barracuda156
Copy link
Author

In fact it will take quite a bit to fix this for PowerPC.

  1. SIMD should be disabled, to begin with, since there is no Altivec.
  2. -march flag is unsupported on PPC, -mtune should be used, optionally together with -mcpu (simple fix, but in numerous files).
  3. cpuid is Intel thing (in fact not supported with some compilers even on Intel).
  4. timeit.h needs a correct PPC implementation.

Perhaps more, this is just from a quick look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant