So I am opening this new thread about how to build pyOptSparse and use it within the OpenMDAO framework. The OpenMDAO team released a scrip which should build pyOptSparse by integrating IPOPT as well: https://github.com/OpenMDAO/build_pyoptsparse
I followed their instructions on a Ubuntu virtual machine. Unfortunately, when it comes to run the scrip, something goes wrong and prevent pyOptSparse to be installed.
I don't know if I am forgetting something, but I am stuck. Does anyone know how to solve this problem ?
Many thanks in advance for your help. Here is the strange error message that I got this:
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['./configure', '--with-metis', '--with-metis-lflags=-L/root/pyoptsparse/lib -lcoinmetis', '--with-metis-cflags=-w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis', '--prefix=/root/pyoptsparse', 'CFLAGS=-w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis', 'FCFLAGS=-fallow-argument-mismatch -w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis']' returned non-zero exit status 1.
EDIT: So I ran build_pyoptsparse -v twice: the first time I got an error message which were telling me that the package LAPCK was missing. Therefore, I did an apt-get install libblas-dev liblapack-dev to install it. Then I ran again the pyoptsparse command and I got this:
...
checking for LAPACK... yes: generic module (lapack.pc blas.pc)
checking for function dgemmt_ in -llapack -lblas ... no
checking for function dgemmt in -llapack -lblas ... no
checking for function DGEMMT_ in -llapack -lblas ... no
checking for function DGEMMT in -llapack -lblas ... no
checking for function dgemmt__ in -llapack -lblas ... no
checking for function dgemmt_ in -llapack -lblas ... no
checking for function DGEMMT__ in -llapack -lblas ... no
checking for function DGEMMT_ in -llapack -lblas ... no
checking for library containing cos... -lm
checking for library Metis with combined link and compile check... no (link with header)
configure: Compiler flags were "-w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis". Use --with-metis-cflags to overwrite. Check config.log for details of failed compile attempt.
configure: Linker flags are "-L/root/pyoptsparse/lib -lcoinmetis". Use --with-metis-lflags to overwrite. Check config.log for details of failed link attempt.
configure: error: user-specified flags for Metis do not work.
Traceback (most recent call last):
File "/usr/local/bin/build_pyoptsparse", line 8, in <module>
sys.exit(perform_install())
File "/usr/local/lib/python3.9/site-packages/build_pyoptsparse.py", line 1118, in perform_install
install_with_mumps()
File "/usr/local/lib/python3.9/site-packages/build_pyoptsparse.py", line 642, in install_with_mumps
install_mumps_from_src()
File "/usr/local/lib/python3.9/site-packages/build_pyoptsparse.py", line 579, in install_mumps_from_src
run_cmd(cmd_list=cnf_cmd_list)
File "/usr/local/lib/python3.9/site-packages/build_pyoptsparse.py", line 335, in run_cmd
subprocess.run(cmd_list, check=do_check)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['./configure', '--with-metis', '--with-metis-lflags=-L/root/pyoptsparse/lib -lcoinmetis', '--with-metis-cflags=-w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis', '--prefix=/root/pyoptsparse', 'CFLAGS=-w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis', 'FCFLAGS=-fallow-argument-mismatch -w -I/root/pyoptsparse/include -I/root/pyoptsparse/include/coin-or -I/root/pyoptsparse/include/coin-or/metis']' returned non-zero exit status 1.

-v(aka--verbose) option to see what the error is...