OpenMDAO / build_pyoptsparse

python script to build/install pyoptsparse with IPOPT (and optionally SNOPT)
Apache License 2.0
9 stars 15 forks source link

HSL build fails on Linux and macOS #61

Closed harris-josh closed 9 months ago

harris-josh commented 9 months ago

The build_pyoptsparse script fails to determine the HSL version when parsing the output of the tar command on Ubuntu 22.04:

Traceback (most recent call last):
  File "/home/username/build_pyoptsparse/build_pyoptsparse.py", line 1345, in <module>
    perform_install()
  File "/home/username/build_pyoptsparse/build_pyoptsparse.py", line 1340, in perform_install
    install_with_hsl()
  File "/home/username/build_pyoptsparse/build_pyoptsparse.py", line 842, in install_with_hsl
    install_hsl_from_src()
  File "/home/username/build_pyoptsparse/build_pyoptsparse.py", line 819, in install_hsl_from_src
    hsl_dir_name = first_line.split()[8].replace('/','')
IndexError: list index out of range

It appears that the hard-coded index for the column does not match the output provided by my version of tar.

Additionally, there are other errors:

  1. The install_hsl_from_src function incorrectly specifies --with-mumps-cflags instead of --with-metis-cflags
  2. On Linux, the METIS LFLAGS do not link the math library. This was fixed for Mumps in #41 but not for the HSL libraries.
  3. On macOS with Apple Clang (aliased to gcc) the build fails due to including OpenMP.

Fixes for these issues are included in PR #62.