[Ipopt] [Fwd: Re: gfortran for mingw]

Edson Valle edsoncv at enq.ufrgs.br
Wed Oct 1 16:07:12 EDT 2008


       I'm forwarding the message from Rafael giving more details abou  
the gfortran for mingw problem, since he couldn't send it to the list.

Start of forwarded message.

Hi Edson/All,

Giving some more details on this, my experience follows:

1. Install the migw-cross compiling tool from
http://sourceforge.net/projects/mingw-cross/

2. Configure Ipopt with the following:
./configure --target=i386-mingw32 --host=i386-mingw32 --build=i386-linux

Then what happens is that the configure script can find my
cross-compiler for C and C++ (i386-mingw32-gcc and i386-mingw32-g++,
respectively) but it cannot detect the presence of my Fortran
cross-compiler (i386-mingw32-gfortran). Actually it have found my
'regular' fortran compiler (gfortran) and obviously fails to use it as a
cross-compiler. If I remove my gfortran compiler and create a symbolic
link for 'i386-mingw32-gfortran' called simply 'gfortran' then the
configure and make process go fine. So definitely it is a bug with the
configure script which can detect C and C++ cross-compilers but cannot
detect a Fortran one.

Regards.

It follows the configure output for the Ipopt trunk code:

./configure --target=i386-mingw32 --host=i386-mingw32 --build=i386-linux
checking build system type... i386-pc-linux-gnu
checking whether we want to compile in debug mode... no
checking for i386-mingw32-xlc... no
checking for i386-mingw32-gcc... i386-mingw32-gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i386-mingw32-gcc accepts -g... yes
checking for i386-mingw32-gcc option to accept ANSI C... none needed
configure: C compiler options are: -O3 -fomit-frame-pointer -pipe
-DNDEBUG -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point
-Wreturn-type -Wcast-qual -Wall -Wno-unknown-pragmas
checking for i386-mingw32-xlC_r... no
checking for i386-mingw32-aCC... no
checking for i386-mingw32-CC... no
checking for i386-mingw32-g++... i386-mingw32-g++
checking whether we are using the GNU C++ compiler... yes
checking whether i386-mingw32-g++ accepts -g... yes
configure: C++ compiler options are: -O3 -fomit-frame-pointer -pipe
-DNDEBUG -pedantic-errors -Wimplicit -Wparentheses -Wreturn-type
-Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion
-Wno-unknown-pragmas
configure: Trying to determine Fortran compiler name
checking for xlf_r... no
checking for fort77... no
checking for gfortran... gfortran
checking for i386-mingw32-xlf_r... (cached) gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
configure: Fortran compiler options are: -O3 -fomit-frame-pointer
-pipe
checking for egrep... grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for i386-mingw32-strip... i386-mingw32-strip
checking dependency style of i386-mingw32-gcc... gcc3
checking dependency style of i386-mingw32-g++... gcc3
checking whether to enable maintainer-specific portions of Makefiles...
no
checking host system type... i386-pc-mingw32
checking for a sed that does not truncate output... /bin/sed
checking for ld used by
i386-mingw32-gcc... /usr/local/i386-mingw32/bin/ld
checking if the linker (/usr/local/i386-mingw32/bin/ld) is GNU ld... yes
checking for /usr/local/i386-mingw32/bin/ld option to reload object
files... -r
checking for BSD-compatible nm... /usr/local/bin/i386-mingw32-nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... file_magic file format
pei*-i386(.*architecture: i386)?
checking how to run the C preprocessor... i386-mingw32-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... no
checking dlfcn.h presence... no
checking for dlfcn.h... no
checking how to run the C++ preprocessor... i386-mingw32-g++ -E
checking the maximum length of command line arguments... 32768
checking command to parse /usr/local/bin/i386-mingw32-nm -B output from
i386-mingw32-gcc object... ok
checking for objdir... .libs
checking for i386-mingw32-ar... i386-mingw32-ar
checking for i386-mingw32-ranlib... i386-mingw32-ranlib
checking for i386-mingw32-strip... (cached) i386-mingw32-strip
checking if i386-mingw32-gcc supports -fno-rtti -fno-exceptions... no
checking for i386-mingw32-gcc option to produce PIC... -DDLL_EXPORT
checking if i386-mingw32-gcc PIC flag -DDLL_EXPORT works... yes
checking if i386-mingw32-gcc static flag -static works... yes
checking if i386-mingw32-gcc supports -c -o file.o... yes
checking whether the i386-mingw32-gcc linker
(/usr/local/i386-mingw32/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by i386-mingw32-g
++... /usr/local/i386-mingw32/bin/ld
checking if the linker (/usr/local/i386-mingw32/bin/ld) is GNU ld... yes
checking whether the i386-mingw32-g++ linker
(/usr/local/i386-mingw32/bin/ld) supports shared libraries... yes
checking for i386-mingw32-g++ option to produce PIC... -DDLL_EXPORT
checking if i386-mingw32-g++ PIC flag -DDLL_EXPORT works... yes
checking if i386-mingw32-g++ static flag -static works... yes
checking if i386-mingw32-g++ supports -c -o file.o... yes
checking whether the i386-mingw32-g++ linker
(/usr/local/i386-mingw32/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gfortran option to produce PIC... -DDLL_EXPORT
checking if gfortran PIC flag -DDLL_EXPORT works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking whether the gfortran linker (/usr/local/i386-mingw32/bin/ld)
supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
configure: Build is "i386-pc-linux-gnu".
checking whether code for third party package Blas is available... yes
checking whether code for third party package Lapack is available... yes
checking whether code for third party package HSL is available... no
checking whether code for third party package ASL is available... no
checking whether code for third party package Mumps is available... yes
checking whether directory Ipopt is available... yes
checking which command should be used to link input files... ln -s
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
configure: configuring in ThirdParty/Blas
configure: running /bin/bash './configure'
--prefix=/home/rafael/src/Ipopt-win32  '--target=i386-mingw32'
'--host=i386-mingw32' '--build=i386-linux' 'build_alias=i386-linux'
'host_alias=i386-mingw32' 'target_alias=i386-mingw32'
--cache-file=/dev/null --srcdir=.
checking build system type... i386-pc-linux-gnu
checking whether we want to compile in debug mode... no
checking for i386-mingw32-xlc... no
checking for i386-mingw32-gcc... i386-mingw32-gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i386-mingw32-gcc accepts -g... yes
checking for i386-mingw32-gcc option to accept ANSI C... none needed
configure: C compiler options are: -O3 -fomit-frame-pointer -pipe
-DNDEBUG -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point
-Wreturn-type -Wcast-qual -Wall -Wno-unknown-pragmas
configure: Trying to determine Fortran compiler name
checking for xlf_r... no
checking for fort77... no
checking for gfortran... gfortran
checking for i386-mingw32-xlf_r... (cached) gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
configure: Fortran compiler options are: -O3 -fomit-frame-pointer
-pipe
checking for egrep... grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for i386-mingw32-strip... i386-mingw32-strip
checking dependency style of i386-mingw32-gcc... gcc3
checking whether to enable maintainer-specific portions of Makefiles...
no
configure: Using libtool script in directory ../..
checking how to get verbose linking output from gfortran... -v
checking for Fortran libraries of gfortran...
-L/usr/lib/gcc/i486-linux-gnu/4.2.3
-L/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.2.3/../../..
-lgfortranbegin -lgfortran -lm -lgcc_s
checking for dummy main to link with Fortran libraries... unknown
configure: error: linking to Fortran libraries from C fails
See `config.log' for more details.



On Tue, 2008-09-30 at 13:14 -0300, Edson Cordeiro do Valle wrote:
[Ocultar Texto Citado]
> Hello I'm posting again the message....
>
>    Recently we've tried to cross-compile ipopt using gfortran for  
> mingw (linux). We found that the configure script couldn't find the  
> gfortran  for mingw. Have anyone noticed such a problem?
>                                                          Regards
>                                                         Edson Valle
>                                                     edsoncv at enq.ufrgs.br
>



More information about the Ipopt mailing list