Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MA28TDependencyChecker is referenced but not built #783

Open
rlkamalapurkar opened this issue Jul 17, 2024 · 1 comment
Open

MA28TDependencyChecker is referenced but not built #783

rlkamalapurkar opened this issue Jul 17, 2024 · 1 comment

Comments

@rlkamalapurkar
Copy link

rlkamalapurkar commented Jul 17, 2024

Setup (I want statically linked ipopt):

  • Sources (taken from the Ipopt, ThirdParty-Mumps, and ThirdParty-HSL repos) in $DIR/Ipopt, $DIR/mumps, and $DIR/hsl.
  • HSL includes all Maxx solvers
  • The file libopenblas.a is copied to $DIR/install/lib

Build static MUMPS using

export PREFIX=$DIR/install
export LIBDIR=$PREFIX/lib
cd $DIR/mumps/build
../configure --prefix="$PREFIX" --with-lapack-lflags="-Wl,--no-as-needed $LIBDIR/libopenblas.a -lm' --disable-shared
make
make install

static HSL using

cd $DIR/hsl/build
../configure --prefix="$PREFIX" --with-lapack-lflags="-Wl,--no-as-needed $LIBDIR/libopenblas.a -lm' --disable-shared
make
make install

and static Ipopt using

cd $DIR/Ipopt/build
export INCLUDEDIR=$PREFIX/include/coin-or
../configure --prefix="$PREFIX" --with-lapack-lflags="-Wl,--no-as-needed $LIBDIR/libopenblas.a -lm" --with-mumps-cflags="-I$INCLUDEDIR/mumps" --with-mumps-lflags="-L$LIBDIR/libcoinmumps.a" --with-hsl-cflags="-I$INCLUDEDIR/hsl" --with-hsl-lflags="-Wl,$DIR/install/lib/libcoinhsl.a -lgfortran -lm" --disable-shared

I then try to build hs071_cpp using the following modifications to the default Makefile

# Include directories
INCL = -I${prefix}/include/coin-or  -I${prefix}/include/coin-or/hsl -I${prefix}/include/coin-or/mumps  -DIPOPTLIB_BUILD $(ADDINCFLAGS)

# Linker flags
LIBS = -L${exec_prefix}/lib -lipopt ${prefix}/lib/libcoinhsl.a -lgfortran -lm ${prefix}/lib/libcoinmumps.a -lmetis ${prefix}/lib/libopenblas.a -ldl

to get

IpTNLPAdapter.cpp:(.text+0x72f1): undefined reference to `Ipopt::Ma28TDependencyDetector::Ma28TDependencyDetector()'

If I go into IpTNLPAdapter.cpp and comment out all the code that references Ma28, then everything works as expected.

@rlkamalapurkar rlkamalapurkar changed the title MA28TDependencyChecker is referenced even when MA28 is not available. MA28TDependencyChecker is referenced but not built Jul 17, 2024
@svigerske
Copy link
Member

It seems that the CoinHslConfig.h header, which is build and installed by ThirdParty-HSL, says that MA28 is available, but the check for MA28 in the HSL library during Ipopt's configure is failing. The latter decides whether to build Ma28TDependencyDetector.
Please check the config.log from Ipopt why it failed to find the ma28ad symbol (failing on ma28a (the single-precision variant of ma28ad is ok)). Maybe your --with-hsl-lflags need to be adjusted.

Also, it should be sufficient to use

../configure --prefix="$PREFIX" --with-lapack-lflags="-Wl,--no-as-needed $LIBDIR/libopenblas.a -lm" --disable-shared

to configure Ipopt. It should pick up mumps and hsl automatically via pkg-config, since they are installed in the same $PREFIX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants