Argonne-National-Laboratory / PIPS

Parallel solvers for optimization problems
Other
73 stars 21 forks source link

PIPS-NLP: Linking libparpipsnlp.so fails due to libmetis.a #67

Open tso-martin opened 10 months ago

tso-martin commented 10 months ago

Building PIPS-NLP does not succeed completely in my case:

[ 79%] Linking CXX shared library libparpipsnlp.so
../../ThirdPartyLibs/MA57/src/lib/libhsl_ma57.a: member ../../ThirdPartyLibs/MA57/src/lib/libhsl_ma57.a(libmetis.a) in archive is not an object

There seems to be a problem with METIS. I built and installed it using ThirdPartyLibs/METIS/wgetMETIS.sh and ran ThirdPartyLibs/MA57/installMa57.sh. During building MA57 there occurs a an error in install-includeHEADERS:

make install-includeHEADERS
 /usr/bin/mkdir -p '/xx/PIPS/ThirdPartyLibs/MA57/src/include'
 /usr/bin/install -c -m 644 include/hsl_ma57s.h include/hsl_ma57d.h '/xx/PIPS/ThirdPartyLibs/MA57/src/include'
/usr/bin/install: ‘include/hsl_ma57s.h’ and ‘/xx/PIPS/ThirdPartyLibs/MA57/src/include/hsl_ma57s.h’ are the same file
/usr/bin/install: ‘include/hsl_ma57d.h’ and ‘/xx/PIPS/ThirdPartyLibs/MA57/src/include/hsl_ma57d.h’ are the same file
make: *** [install-includeHEADERS] Error 1

I am not sure if this error matters for building PIPS-NLP. Your help is appreciated.

nychiang commented 10 months ago

It seems that you have multiple metis installed in your system, and both are provided to pips. You can try to use your default one in installMa57.sh

tso-martin commented 10 months ago

Hi @nychiang, I checked that there is no other METIS-library on the system. I changed a line in installMa57.sh into an absolute path:

 ./configure FFLAGS=-fPIC --with-metis=/xx/PIPS/ThirdPartyLibs/METIS/Lib/libmetis.a --prefix=`pwd`

When using the relative path ../../METIS/Lib/libmetis.a the configure script confirms that it finds libmetis.a, but during building gfortran does not find it:

gfortran: error: ../../METIS/Lib/libmetis.a: No such file or directory

Anyway, by using the absolute METIS path MA57 could be built. I investigated the static library libhsl_ma57.a using nm:

nm: libmetis.a: File format not recognized

Do you have any idea, what could be wrong?

nychiang commented 10 months ago

Seems like you have different fortran compilers on you machine, but it is hard to tell what is wrong with the limited information. Have you tried to build metis, ma57 and pips by adding F77=gfortran in front of your command, e.g., F77=gfortran ./installMa57.sh and F77=gfortran ./wgetMETIS.sh ?

tso-martin commented 10 months ago

Add F77=gfortran did not solve the problem, but conflicting Fortran versions could be a reason. I get warning during building PIPS-NLP:

Linking CXX executable ../pipsnlp_parallel
/usr/bin/ld: warning: libgfortran.so.3, needed by /usr/local/lib/openblas/0.3.9/mt/int64/libopenblas.so, may conflict with libgfortran.so.5

I am not sure if this an issue.

nychiang commented 10 months ago

It seems to me that you are using different compilers for openblas, metis and pips. see her for example Maybe you can try to compile ma57 without metis, by removing -with-metis=... in installMa57.sh.