[Ipopt] Problems linking with gfortran libraries in Snow Leopard

Peter Carbonetto pcarbo at uchicago.edu
Sat Oct 23 16:07:06 EDT 2010


Hi Anil, this is the command I used to compile the Ipopt libraries on Snow 
Leopard. Does it work for you too?

../ipopt/configure --with-blas="-framework vecLib" \
     --with-lapack="-framework vecLib" F77=gfortran \
     FFLAGS="-fexceptions -m64 -fbackslash" \
     CFLAGS="-fno-common -no-cpp-precomp -arch x86_64 -m64" \
     CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" \
     -disable-shared CC=gcc-4.0 CXX=g++-4.0

Peter Carbonetto, Ph.D.
Postdoctoral Fellow
Dept. of Human Genetics
University of Chicago

> All,
> 
> I am having a very strange problem compiling IPOPT with a brand new
> installation of Mac OS-X Snow Leopard using the following ./configure
> command:
> 
> ./configure --prefix=$HOME/Software/ipopt/install CXX=g++ CC=gcc
> F77=gfortran ADD_CXXFLAGS="-m64" ADD_CCFLAGS="-m64" ADD_FFLAGS="-m64"
> FLIBS="-lgfortran -lSystem -lg2c"--disable-shared
> 
> At the bottom of the output below you will see the error, "configure: error:
> linking to Fortran libraries from C fails."  I have gfortran installed and
> the gfortran libraries are in the directory /usr/local/lib.  I have compiled
> IPOPT successfully in Snow Leopard many times at this point using the above
> configure command and have not had a problem.  hen I tried adding
> "-L/usr/local/lib" to my FLIBS, nothing changed (that is, I still received
> the same error).
> 
> I would be grateful if somebody could tell me what may be the problem.
> 
> Anil Rao
> 
> 
> 
> 
> 
> ./configure --prefix=$HOME/Software/ipopt/install CXX=g++ CC=gcc
> F77=gfortran ADD_CXXFLAGS="-m64" ADD_CCFLAGS="-m64" ADD_FFLAGS="-m64"
> FLIBS="-L/usr/local/lib -lgfortran -lSystem -lg2c"--disable-shared
> checking build system type... i386-apple-darwin10.4.0
> checking whether we want to compile in debug mode... no
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> configure: C compiler options are: -O3 -fomit-frame-pointer -pipe -DNDEBUG
> -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
> -Wno-unknown-pragmas 
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking whether C++ compiler g++ works... yes
> configure: C++ compiler options are: -O3 -fomit-frame-pointer -pipe -DNDEBUG
> -Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith
> -Wwrite-strings -Wconversion -Wno-unknown-pragmas -m64
> configure: Trying to determine Fortran compiler name
> checking for xlf_r... 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 
> -m64
> 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... no
> checking for mawk... no
> checking for nawk... no
> checking for awk... awk
> checking whether make sets $(MAKE)... yes
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking dependency style of g++... gcc3
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking host system type... i386-apple-darwin10.4.0
> checking for a sed that does not truncate output... /usr/bin/sed
> checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld
> checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) is
> GNU ld... no
> checking for /usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld option to reload
> object files... -r
> checking for BSD-compatible nm... /usr/bin/nm
> checking whether ln -s works... yes
> checking how to recognise dependent libraries... pass_all
> checking how to run the C preprocessor... 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... yes
> checking dlfcn.h presence... yes
> checking for dlfcn.h... yes
> checking how to run the C++ preprocessor... g++ -E
> checking the maximum length of command line arguments... 196608
> checking command to parse /usr/bin/nm output from gcc object... ok
> checking for objdir... .libs
> checking for ar... ar
> checking for ranlib... ranlib
> checking for strip... strip
> checking if gcc supports -fno-rtti -fno-exceptions... no
> checking for gcc option to produce PIC... -fno-common
> checking if gcc PIC flag -fno-common works... yes
> checking if gcc static flag -static works... no
> checking if gcc supports -c -o file.o... yes
> checking whether the gcc linker
> (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... darwin10.4.0 dyld
> 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 g++... /usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld
> checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) is
> GNU ld... no
> checking whether the g++ linker
> (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) supports shared libraries...
> yes
> checking for g++ option to produce PIC... -fno-common
> checking if g++ PIC flag -fno-common works... yes
> checking if g++ static flag -static works... no
> checking if g++ supports -c -o file.o... yes
> checking whether the g++ linker
> (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... darwin10.4.0 dyld
> 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... -fno-common
> checking if gfortran PIC flag -fno-common works... yes
> checking if gfortran static flag -static works... no
> checking if gfortran supports -c -o file.o... yes
> checking whether the gfortran linker
> (/usr/libexec/gcc/i686-apple-darwin10/4.0.1/ld) supports shared libraries...
> yes
> checking dynamic linker characteristics... darwin10.4.0 dyld
> checking how to hardcode library paths into programs... immediate
> configure: Build is "i386-apple-darwin10.4.0".
> configure: Applying patches to libtool for Darwin
> 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 Metis is available... yes
> checking whether code for third party package HSL is available... yes
> checking whether code for third party package ASL is available... yes
> checking whether code for third party package Mumps is available... no
> 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/sh './configure'
> --prefix=/Users/anilvrao/Software/ipopt/install 
> '--prefix=/Users/anilvrao/Software/ipopt/install' 'CXX=g++' 'CC=gcc'
> 'F77=gfortran' 'ADD_CXXFLAGS=-m64' 'ADD_CCFLAGS=-m64' 'ADD_FFLAGS=-m64'
> 'FLIBS=-L/usr/local/lib -lgfortran -lSystem -lg2c--disable-shared'
> --cache-file=/dev/null --srcdir=.
> checking build system type... i386-apple-darwin10.4.0
> checking whether we want to compile in debug mode... no
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> configure: C compiler options are: -O3 -fomit-frame-pointer -pipe -DNDEBUG
> -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall
> -Wno-unknown-pragmas 
> configure: Trying to determine Fortran compiler name
> checking for xlf_r... 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 
> -m64
> 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... no
> checking for mawk... no
> checking for nawk... no
> checking for awk... awk
> checking whether make sets $(MAKE)... yes
> checking for style of include used by make... GNU
> checking dependency style of 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/local/lib -lgfortran
> -lSystem -lg2c--disable-shared
> 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.
> configure: error: /bin/sh './configure' failed for ThirdParty/Blas
> 
> 
> --
> Anil V. Rao
> Assistant Professor
> Dept. of Mechanical and Aerospace Engineering
> University of Florida
> MAE-A Room 314
> Gainesville, FL 32611-6250
> E-mail:  anilvrao at ufl.edu
> Tel: (352) 392-5523 (office)
>       (352) 672-1529 (cell)
> 
> 
>


More information about the Ipopt mailing list