OpenMDAO / build_pyoptsparse

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

ParOpt is failing to build for all test configurations #52

Closed swryan closed 1 year ago

swryan commented 1 year ago

Building with ParOpt (option -a) is failing on Ubuntu and MacOS baseline configurations as well as Ubuntu Latest:

----------------------- Building PAROPT from source code ----------------------
Cloning https://github.com/smdogroup/paropt.git...

Changed directory to /tmp/tmp_nnp492g

Installing Cython with pip...
Requirement already satisfied: Cython in /usr/share/miniconda/envs/test/lib/python3.10/site-packages (3.0.3)

Building...

gmake[1]: Entering directory '/tmp/tmp_nnp492g/src'
mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptOptions.cpp -o ParOptOptions.o

        --- Compiled ParOptOptions.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptInteriorPoint.cpp -o ParOptInteriorPoint.o

        --- Compiled ParOptInteriorPoint.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptVec.cpp -o ParOptVec.o

Traceback (most recent call last):
  File "/usr/share/miniconda/envs/test/bin/build_pyoptsparse", line 8, in <module>
    sys.exit(perform_install())
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line 1314, in perform_install
    install_pyoptsparse_from_src()
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line 900, in install_pyoptsparse_from_src
    install_paropt_from_src()
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line [707](https://github.com/swryan/build_pyoptsparse/actions/runs/6482776210/job/17602952498#step:9:708), in install_paropt_from_src
    pip_install(['./'], pkg_desc='paropt')
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line 491, in pip_install
    run_cmd(cmd_list)
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line 402, in run_cmd
    raise inst
  File "/usr/share/miniconda/envs/test/lib/python3.10/site-packages/build_pyoptsparse.py", line 399, in run_cmd
    result = subprocess.run(cmd_list, check=do_check, capture_output=True, text=True)
  File "/usr/share/miniconda/envs/test/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['python', '-m', 'pip', 'install', './']' returned non-zero exit status 1.
        --- Compiled ParOptVec.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptQuasiNewton.cpp -o ParOptQuasiNewton.o

        --- Compiled ParOptQuasiNewton.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptMMA.cpp -o ParOptMMA.o

        --- Compiled ParOptMMA.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptTrustRegion.cpp -o ParOptTrustRegion.o

        --- Compiled ParOptTrustRegion.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptProblem.cpp -o ParOptProblem.o

        --- Compiled ParOptProblem.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptOptimizer.cpp -o ParOptOptimizer.o

        --- Compiled ParOptOptimizer.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c ParOptCompactEigenvalueApprox.cpp -o ParOptCompactEigenvalueApprox.o

        --- Compiled ParOptCompactEigenvalueApprox.cpp successfully ---

mpicxx -fPIC -O3 -I/tmp/tmp_nnp492g/src -c CyParOptProblem.cpp -o CyParOptProblem.o

        --- Compiled CyParOptProblem.cpp successfully ---

/usr/share/miniconda/envs/test/bin/x86_64-conda-linux-gnu-ar rcs /tmp/tmp_nnp492g/lib/libparopt.a ParOptOptions.o ParOptInteriorPoint.o ParOptVec.o ParOptQuasiNewton.o ParOptMMA.o ParOptTrustRegion.o ParOptProblem.o ParOptOptimizer.o ParOptCompactEigenvalueApprox.o CyParOptProblem.o
gmake[1]: Leaving directory '/tmp/tmp_nnp492g/src'
mpicxx -fPIC -shared src/CyParOptProblem.o src/ParOptCompactEigenvalueApprox.o src/ParOptInteriorPoint.o src/ParOptMMA.o src/ParOptOptimizer.o src/ParOptOptions.o src/ParOptProblem.o src/ParOptQuasiNewton.o src/ParOptTrustRegion.o src/ParOptVec.o -L/usr/lib -llapack -lblas -o /tmp/tmp_nnp492g/lib/libparopt.so

Installing paropt with pip...
Error: Process completed with exit code 1.
timryanb commented 1 year ago

@gjkennedy This is probably related to the breaking cython 3.0.0 upgrade that we saw in tacs and funtofem. The fix was pinning against an older cython (0.29.36), see here.

timryanb commented 1 year ago

@swryan in the mean time, if you manually install cython 0.29.36 before pip installing paropt, the install should work

swryan commented 1 year ago

will do, thanks!

timryanb commented 1 year ago

Sorry @gjkennedy, @swryan I may have spoke too soon. It looks like @gjkennedy merged a PR a while ago that should have made paropt Cython 3.0 compatible. So there is likely something else going on

swryan commented 1 year ago

It looks like the script is configured to use v2.0.2 of ParOpt, so you have identified the issue correctly. I will update the version.

Thanks again for the tip!