coin-or / Ipopt

COIN-OR Interior Point Optimizer IPOPT
https://coin-or.github.io/Ipopt
Other
1.4k stars 279 forks source link

failed to complie HSL on Mac OS X #325

Closed jianglinchun closed 5 years ago

jianglinchun commented 6 years ago

jianglinchundeMacBook-Pro:HSL jianglinchun$ ./configure --prefix=/opt/local/ F77=g77 CC=gcc CXX=g++ jianglinchundeMacBook-Pro:HSL jianglinchun$ make /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am /bin/sh ./../../libtool --tag=F77 --mode=link /usr/local/bin/g77 -O3 -pipe -o libcoinhsl.la -rpath /opt/local//lib -no-undefined deps.lo mc19d.lo ma27d.lo ma28d.lo -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0 -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0/../../.. -lfrtbegin -lg2c -lSystem /usr/local/bin/g77 -dynamiclib -single_module -o .libs/libcoinhsl.0.0.0.dylib .libs/deps.o .libs/mc19d.o .libs/ma27d.o .libs/ma28d.o -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0 -L/usr/local/lib/gcc/i686-apple-darwin8.8.1/3.4.0/../../.. -lfrtbegin /usr/local/lib/libg2c.dylib -lSystem -install_name /opt/local//lib/libcoinhsl.0.dylib -compatibility_version 1 -current_version 1.0 ld: warning: -macosx_version_min not specified, assuming 10.10 Undefined symbols for architecture i386: "huge", referenced from: ma30ad in deps.o ld: symbol(s) not found for architecture i386 fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: internal link edit command failed make[1]: [libcoinhsl.la] Error 1 make: [all] Error 2 jianglinchundeMacBook-Pro:HSL jianglinchun$

svigerske commented 6 years ago

Nothing I can do. Probably caused by using g77 instead of a proper Fortran compiler.

jianglinchun commented 6 years ago

@svigerske thank you so much. Will you please give me advice about the complier?? Too much to choice. And I found a list here: http://vesta.informatik.rwth-aachen.de/fortran/append-f.html

svigerske commented 6 years ago

gfortran should work somehow. Mac is often trouble, since it doesn't come with a preinstalled Fortran compiler and Apple doesn't seem to care to make one that fits to the preinstalled C/C++ compiler easily available. So one has to resort to some third-party providers like homebrew, XCode, or http://hpc.sourceforge.net/. I don't know which of all these should be prefered (I don't work on a mac). Further, it's probably good to ensure that one uses the same source (i.e., same GCC) for the C, C++, and Fortran compiler.

jianglinchun commented 6 years ago

Thank you so much. @svigerske I'm working on cross complie on BaiDu's ApolloAuto open source. And Ipopt is the most important part. :) I had tried http://hpc.sourceforge.net/ with no luck. I'm thinking about buy some commercial complier https://github.com/ApolloAuto/apollo/issues/2467