oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.25k stars 1.62k forks source link

cannot install scipy with graalpy-23.1.2-macos-aarch64.tar.gz #8216

Open moderncodr opened 8 months ago

moderncodr commented 8 months ago

hi there,

I tried to install scipy with graalpy 23.1.2 and also tried with 23..1.0, but always got the error: `graalpy -m ginstall install scipy package: 'scipy' not found in known packages, installing with pip

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.`

I tried to execute cc -Wl,--version

and got the same error: cc -Wl,--version ld: unknown options: --version clang: error: linker command failed with exit code 1 (use -v to see invocation)

but it worked with: cc -Wl --version Apple clang version 15.0.0 (clang-1500.1.0.2.5) Target: arm64-apple-darwin23.2.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

looks like some typo in the code/patch? can anyone help? thanks!

cheers HL

timfel commented 8 months ago

A couple of things.

  1. You should not be using ginstall, just pip install scipy
  2. You are going to need gcc, since SciPy builds only with GFortran which is installed with homebrew's gcc.

If you want a reproducible build, you can fork the graalpython repository and manually execute the github workflow build-macos-aarch64-wheels. In the Github UI for running the workflow, put in "scipy" to only build that and some of its dependencies:

image

I just now started a build of scipy with github actions running on my M1 mac mini

~ % system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: Mac mini
      Model Identifier: Macmini9,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)
      Memory: 16 GB

So you see it's not the fastest Arm mac, and the build took about 15 minutes: https://github.com/timfel/graalpython/actions/runs/7608494191/job/20717803415

moderncodr commented 8 months ago

A couple of things.

1. You should not be using ginstall, just `pip install scipy`

2. You are going to need gcc, since SciPy builds only with GFortran which is installed with homebrew's gcc.

If you want a reproducible build, you can fork the graalpython repository and manually execute the github workflow build-macos-aarch64-wheels. In the Github UI for running the workflow, put in "scipy" to only build that and some of its dependencies:

image

I just now started a build of scipy with github actions running on my M1 mac mini

~ % system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: Mac mini
      Model Identifier: Macmini9,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)
      Memory: 16 GB

So you see it's not the fastest Arm mac, and the build took about 15 minutes: https://github.com/timfel/graalpython/actions/runs/7608494191/job/20717803415

Hi, thanks for your reply! actually I have already tried it with pip, it had the same error. GCC has been installed already, I also tried to install again with homebrew.

still facing the same error. I have M2 chip and macOS 14.2.1. not sure if you need any further information.

cheers

mikehearn commented 8 months ago

I think this might be

https://github.com/mesonbuild/meson/issues/12419

So it depends on the version of macOS used. Apple rewrote their linker and Meson wants to do a lot of sniffing using flags and the like.

the linker doesn't report 'unknown option:' it reports 'unknown options:' in your case.

Outstanding!

The following command worked for me, albeit it took 50 minutes with a load average of 35 throughout (an Intel mac)

FFLAGS=-fallow-argument-mismatch LDFLAGS='-Wl,-ld_classic' CC=gcc python -m pip install scipy==1.10.1

moderncodr commented 7 months ago

I think this might be

mesonbuild/meson#12419

So it depends on the version of macOS used. Apple rewrote their linker and Meson wants to do a lot of sniffing using flags and the like.

the linker doesn't report 'unknown option:' it reports 'unknown options:' in your case.

Outstanding!

The following command worked for me, albeit it took 50 minutes with a load average of 35 throughout (an Intel mac)

FFLAGS=-fallow-argument-mismatch LDFLAGS='-Wl,-ld_classic' CC=gcc python -m pip install scipy==1.10.1

Hey Mike, that works!!! thanks a lot! I finally managed to build/install scipy under graalpy. I am facing some issue with installing matplotlib now, but it is different issue, still checking it.

Have a great day ahead! cheers HL

alina-yur commented 7 months ago

@moderncodr seems like this is resolved, right?

mikehearn commented 7 months ago

@alina-yur Probably worth keeping it open until installing scipy just works.