mreineck / ducc

Fork of https://gitlab.mpcdf.mpg.de/mtr/ducc to simplify external contributions
GNU General Public License v2.0
13 stars 12 forks source link

Issues pip installing on powerpc #20

Open Sulla2012 opened 10 months ago

Sulla2012 commented 10 months ago

When pip installing ducc on a powerpc based system, the flag -march=native causes issues. Replacing that flag with -mcpu=native seems to work fine.

mreineck commented 10 months ago

Hmm ... which exact compiler is installed there? If it is gcc, can you please run gcc -v and report the output here?

I'm a bit reluctant to switch to -mcpu=native, since that allows only portable optimizations, as far as I understand.

Sulla2012 commented 10 months ago

Exact output:

10.3.0 --disable-multilib --enable-languages=c,c++,fortran,lto Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.3.0 (GCC)

To be clear I was just reporting what worked for me, not necessarily suggesting it as a fix.

mreineck commented 10 months ago

I'll try to find a way to compile cleanly on PowerPC. However, this won't make it into ducc 0.32, which I hope to release later today.

Sulla2012 commented 10 months ago

Thanks!

mreineck commented 9 months ago

I think you can achieve clean compilation without editing the files by setting two environment variables, like so:

DUCC0_OPTIMIZATION=portable-strip DUCC0_CFLAGS="-mcpu=native" pip install --user --no-binary=ducc0 ducc0

The first variable switches off -march=native, and with the second one you can supply any additional flags you'd like to use.

I admit it's not terribly comfortable, but I don't have a more convenient way at the moment.

mreineck commented 7 months ago

This is strange ... I got an email with a comment on this issue, but the comment doesn't seem to appear here.

Anyway, the problem mentioned was the error

      ********************************************************************************
      The following seems to be defined outside of `pyproject.toml`:

      `dependencies = ['numpy>=1.17.0']`

      According to the spec (see the link below), however, setuptools CANNOT
      consider this value unless `dependencies` is listed as `dynamic`.

      https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

      To prevent this problem, you can list `dependencies` under `dynamic` or alternatively
      remove the `[project]` table from your file and rely entirely on other means of
      configuration.
      ********************************************************************************

As far as I understand, this should be fixed on the ducc0 branch since Nov 21, 2023. So hopefully this will go away with the next release.

Sulla2012 commented 7 months ago

Sorry I was writing a comment, accidentally submitted it, and then deleted it. Anyway I tried the above an it raised the attached error.. I'll try again when the next release is out.

mreineck commented 7 months ago

I just released version 0.33. It has "dependencies" in the "dynamic" list in pyproject.toml, as the error message suggests.