<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi all<br>
    <br>
    I am trying to build IPOPT 3.11.3 on the MinGW-w64 platform. I set
    up a new environment as carefully detailed here:<br>
    <a class="moz-txt-link-freetext" href="http://ascend4.org/Setting_up_a_MinGW-w64_build_environment">http://ascend4.org/Setting_up_a_MinGW-w64_build_environment</a><br>
    <br>
    This is using latest GCC 4.8.0 packaged by rubenvb from the
    MinGW-w64 project. I get the following error from the IPOPT
    configure scripts:<br>
    <br>
    <pre>checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
configure: Fortran compiler options are: -O3 -pipe
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...  -lstdc++ <font color="#009900"><b>-lm'</b></font> -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0 -Lc:/mingw/64/b
in/../lib/gcc -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/lib/../lib -Lc:/mingw/64/bin/..
/lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-min
gw32/lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../.. -lgfortran -lmingw32 -lgcc_s -lmoldname -lmingwex -lmsvcrt
 -lquadmath -lm -ladvapi32 -lshell32 -luser32 -lkernel32
<font color="#009900"><b>checking for dummy main to link with Fortran libraries... unknown</b><b>
</b><b>configure: error: linking to Fortran libraries from C fails</b><b>
</b><b>See `config.log' for more details.</b><b>
</b><b>configure: error: /bin/sh './configure' failed for ThirdParty/Lapack</b></font>

</pre>
    The config.log file contains a clue:<br>
    <br>
    <pre>configure:4471: gcc -o conftest.exe -O3 -pipe -DNDEBUG -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -W
cast-qual -Wall -Wno-unknown-pragmas -Wno-long-long   -DLAPACK_BUILD   conftest.c   -lstdc++ -lm' -Lc:/mingw/64/bin/../lib/gcc/x86
_64-w64-mingw32/4.8.0 -Lc:/mingw/64/bin/../lib/gcc -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mi
ngw32/lib/../lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-min
gw32/4.8.0/../../../../x86_64-w64-mingw32/lib -Lc:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../.. -lgfortran -lmingw32
-lgcc_s -lmoldname -lmingwex -lmsvcrt -lquadmath -lm -ladvapi32 -lshell32 -luser32 -lkernel32 &gt;&amp;5
<font color="#009900"><b>c:/mingw/64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lm'</b><b>
</b></font>collect2.exe: error: ld returned 1 exit status
configure:4477: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "ThirdPartyLapack"
| #define PACKAGE_TARNAME "thirdpartylapack"
| #define PACKAGE_VERSION "1.4.3"
</pre>
    <br>
    So it looks to me that somewhere in the current configuration
    scripts used by (provided by) IPOPT, something is failing to
    correctly detect library linking flags, and a stray apostrophe is
    being inserted at the end of <b>-lm'</b>. This could be perhaps
    because config.guess returns "i686-pc-mingw32" on this platform, ie
    the 64-bit nature of this environment is not correctly identified.
    Or it could be because of something unusual being present in my
    PATH. I'm not sure why this would be happening. Although looking at
    the output from <b>gcc -v</b>, I wonder if it could be that the
    IPOPT configure script is mis-handling some strings in the
    following:<br>
    <br>
    <pre>$ gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw\64\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: /home/ruben/mingw-w64/src/gcc/configure --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu --target=x86_64-w64-mi
ngw32 --with-sysroot=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --prefix=/home/ruben/mingw-w64/mingw64mingw64/mingw64 --with-gmp
=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-mpfr=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --wit
h-mpc=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-cloog=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install
 --disable-cloog-version-check --with-isl=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --enable-cloog-backend=isl <font color="#009900"><b>--wit</b><b>
</b><b>h-host-libstdcxx='-static -lstdc++ -lm'</b></font> --enable-shared --enable-static --enable-threads=win32 --enable-plugins --disable-multilib
 --enable-languages=c,lto,c++,objc,obj-c++,fortran,java --enable-libgomp --enable-fully-dynamic-string --enable-libstdcxx-time --d
isable-nls --disable-werror --enable-checking=release --with-gnu-as --with-gnu-ld --disable-win32-registry --disable-rpath --disab
le-werror --with-libiconv-prefix=/home/ruben/mingw-w64/prereq/x86_64-w64-mingw32/install --with-pkgversion=rubenvb-4.8.0 --with-bu
<a class="moz-txt-link-abbreviated" href="mailto:gurl=mingw-w64-public@lists.sourceforge.net">gurl=mingw-w64-public@lists.sourceforge.net</a> CC= CFLAGS='-O2 -march=nocona -mtune=core2 -fomit-frame-pointer -momit-leaf-frame-poin
ter' CXXFLAGS='-O2 -march=nocona -mtune=core2 -fomit-frame-pointer -momit-leaf-frame-pointer' LDFLAGS= 'BOOT_CFLAGS=-O2 -march=noc
ona -mtune=core2 -fomit-frame-pointer -momit-leaf-frame-pointer' 'BOOT_CXXFLAGS=-O2 -march=nocona -mtune=core2 -fomit-frame-pointe
r -momit-leaf-frame-pointer' BOOT_LDFLAGS= 'CFLAGS_FOR_TARGET= -O2 -march=nocona -mtune=core2 -fgraphite-identity -floop-interchan
ge -floop-block -floop-parallelize-all' 'CXXFLAGS_FOR_TARGET= -O2 -march=nocona -mtune=core2 -fgraphite-identity -floop-interchang
e -floop-block -floop-parallelize-all' LDFLAGS_FOR_TARGET=
Thread model: win32
gcc version 4.8.0 (rubenvb-4.8.0)
</pre>
    <br>
    I have tried specifying "--build=x86_64-w64-mingw32" to the
    Configure line. I have tried IPOPT 3.10.1, 3.10.4 and 3.11.3 and I
    get the same error in each case. I have also tried using earlier
    versions of the MinGW-w64 compiler package (ie GCC 4.7.0 and 4.7.4).
    I have tried intalling OpenBLAS, and that removed the problem with
    BLAS, but the problem just pops up again with LAPACK (and I presume
    it will pop up again with MUMPS).<br>
    <br>
    Can anyone please give me some suggestions on what I can try next? I
    am stuck!<br>
    <br>
    Cheers<br>
    JP<br>
    <br>
    <br>
    <br>
    <br>
  </body>
</html>