Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.54k stars 12.28k forks source link

Hdf5 build from source with alternate compiler (ifort) #21472

Closed ksorat closed 6 years ago

ksorat commented 6 years ago

Hello, I'm attempting to build the homebrew HDF5 from scratch with the Intel fortran compiler and I'm encountering various errors.

I had previously been able to do this (from homebrew/science/hdf5) with the command export FC="ifort" brew install hdf5 --with-fortran --with-fortran2003 and verify it worked correctly with />h5fc --version ifort (IFORT) 17.0.1 20161013 Copyright (C) 1985-2016 Intel Corporation. All rights reserved.

Using the most recent version, I'm attempting FC=ifort brew install --build-from-source hdf5

But getting the errors (pasted below), with the install failing. I can install from bottle but using the gfortran compiler, ie />h5fc --version GNU Fortran (Homebrew GCC 7.2.0) 7.2.0 Copyright (C) 2017 Free Software Foundation, Inc.

I'm not sure if there's something I'm doing incorrectly but any help would be greatly appreciated, thanks!

==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/hdf5/1.10.1_2 Last 15 lines from /Users/XXX/Library/Logs/Homebrew/hdf5/02.configure: checking size of int64... 0 checking size of float... 4 checking size of double... 8 checking size of long double... 16 checking size of float128... 0 checking size of _Quad... 0 checking quadmath.h usability... no checking quadmath.h presence... no checking for quadmath.h... no checking maximum decimal precision for C... 21 checking if Fortran interface enabled... yes checking whether we are using the GNU Fortran compiler... no checking whether ifort accepts -g... no checking for Fortran flag to compile .f90 files... unknown configure: error: Fortran could not compile .f90 files

Please always follow these steps:

To help us debug your issue please explain:

Formula additions or changes

To get formulae added or changed in Homebrew please file a Pull Request We will close issues requesting formulae changes.

fxcoudert commented 6 years ago

Hi @ksorat, we can try to help, but building Homebrew software with a Fortran compiler other than gfortran is not regularly tested, so expect it to be a rocky path.

Does hdf5 compile well with ifort outside of Homebrew? You would need to get that working first, so we can understand what is different in Homebrew that makes it fail.

ksorat commented 6 years ago

Thanks for your help. I'm happy to spend time hacking around with this.

Regarding your questions, I haven't had any problems compiling HDF5 with ifort directly. And I was also able to compile HDF5 with ifort in the earlier homebrew/science/hdf5 pretty seamlessly. I was looking at the error message and it seemed that brew wasn't able to get the correct info from ifort for some reason.


checking whether we are using the GNU Fortran compiler... no checking whether ifort accepts -g... no checking for Fortran flag to compile .f90 files... unknown configure: error: Fortran could not compile .f90 files

The intel compiler ifort does take -g as an option but brew gets that wrong, and it doesn't seem to know the flag to compile the .f90 files. I'm wondering if there's just some hiccup in terms of changing the configuration over to ifort?

Thanks again for your help, much appreciated!

ilovezfs commented 6 years ago

Sorry we don't support alternate compilers.