[Ipopt] Compiling IPOPT on Ubuntu 11.10 64-bit with ATLAS
Stefan Vigerske
stefan at math.hu-berlin.de
Tue Feb 21 17:33:34 EST 2012
Hi,
> Thanks for your reply! got me past the configure stage, but my make still
> fails.
>
> 1) I modified my configure statement to read as follows: (the options
> -lblas and -llapack seemed to pick up the BLAS and Lapack in ThirdParty/,
> not the ATLAS libraries)
No, the libs build in ThirdParty/Blas,Lapack are called libcoinblas.*
and libcoinlapack.*, so they wouldn't be picked up by -lblas and -llapack.
> ./configure --with-blas="/usr/lib/atlas-base/atlas/libblas.so.3gf" \
> --with-lapack="/usr/lib/atlas-base/atlas/liblapack.so.3gf"
>
> The configure worked fine:
> ========================================================================
> <snipped>
> checking whether user supplied
> BLASLIB="/usr/lib/atlas-base/atlas/libblas.so.3gf.0" works... yes:
> /usr/lib/atlas-base/atlas/libblas.so.3gf.0
> checking whether user supplied
> LAPACKLIB="/usr/lib/atlas-base/atlas/liblapack.so.3gf.0" works... yes:
> /usr/lib/atlas-base/atlas/liblapack.so.3gf.0
> /usr/lib/atlas-base/atlas/libblas.so.3gf.0
> <snipped>
> ========================================================================
>
>
> 2) However, the "make" process still fails.
> ========================================================================
> <snipped>
> ../../Interfaces/.libs/libipopt.a(IpLapack.o): In function
> `Ipopt::IpLapackDpotrs(int, int, double const*, int, double*, int)':
> IpLapack.cpp:(.text+0x50): undefined reference to `dpotrs_'
> ../../Interfaces/.libs/libipopt.a(IpLapack.o): In function
> `Ipopt::IpLapackDpotrf(int, double*, int, int&)':
> IpLapack.cpp:(.text+0x90): undefined reference to `dpotrf_'
> ../../Interfaces/.libs/libipopt.a(IpLapack.o): In function
> `Ipopt::IpLapackDsyev(bool, int, double*, int, double*, int&)':
> IpLapack.cpp:(.text+0x124): undefined reference to `dsyev_'
> IpLapack.cpp:(.text+0x27c): undefined reference to `dsyev_'
> ../../Interfaces/.libs/libipopt.a(IpLapack.o): In function
> `Ipopt::IpLapackDgetrf(int, double*, int*, int, int&)':
> IpLapack.cpp:(.text+0x2dc): undefined reference to `dgetrf_'
> ../../Interfaces/.libs/libipopt.a(IpLapack.o): In function
> `Ipopt::IpLapackDgetrs(int, int, double const*, int, int*, double*, int)':
> IpLapack.cpp:(.text+0x348): undefined reference to `dgetrs_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDdot(int, double const*, int, double const*, int)':
> IpBlas.cpp:(.text+0x21): undefined reference to `ddot_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDnrm2(int, double const*, int)':
> IpBlas.cpp:(.text+0x47): undefined reference to `dnrm2_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDasum(int, double const*, int)':
> IpBlas.cpp:(.text+0x67): undefined reference to `dasum_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasIdamax(int, double const*, int)':
> IpBlas.cpp:(.text+0x87): undefined reference to `idamax_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDcopy(int, double const*, int, double*, int)':
> IpBlas.cpp:(.text+0xb1): undefined reference to `dcopy_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDaxpy(int, double, double const*, int, double*, int)':
> IpBlas.cpp:(.text+0xf2): undefined reference to `daxpy_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDscal(int, double, double*, int)':
> IpBlas.cpp:(.text+0x125): undefined reference to `dscal_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDgemv(bool, int, int, double, double const*, int, double
> const*, int, double, double*, int)':
> IpBlas.cpp:(.text+0x1d6): undefined reference to `dgemv_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDsymv(int, double, double const*, int, double const*, int,
> double, double*, int)':
> IpBlas.cpp:(.text+0x25f): undefined reference to `dsymv_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDgemm(bool, bool, int, int, int, double, double const*, int,
> double const*, int, double, double*, int)':
> IpBlas.cpp:(.text+0x36a): undefined reference to `dgemm_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDsyrk(bool, int, int, double, double const*, int, double,
> double*, int)':
> IpBlas.cpp:(.text+0x41b): undefined reference to `dsyrk_'
> ../../Interfaces/.libs/libipopt.a(IpBlas.o): In function
> `Ipopt::IpBlasDtrsm(bool, int, int, double, double const*, int, double*,
> int)':
> IpBlas.cpp:(.text+0x4fe): undefined reference to `dtrsm_'
> ../../Interfaces/.libs/libipopt.a(IpMa28Partition.o): In function
> `ma28part_':
> IpMa28Partition.F:(.text+0x156): undefined reference to `dcopy_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `mc71ad_':
> ma57ad.f:(.text+0xb0a8): undefined reference to `idamax_'
> ma57ad.f:(.text+0xb2e3): undefined reference to `idamax_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57td_':
> ma57ad.f:(.text+0xc9e2): undefined reference to `dgemm_'
> ma57ad.f:(.text+0xca97): undefined reference to `dtpsv_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57rd_':
> ma57ad.f:(.text+0xd6d6): undefined reference to `dgemm_'
> ma57ad.f:(.text+0xd765): undefined reference to `dtpsv_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57yd_':
> ma57ad.f:(.text+0xe06e): undefined reference to `dgemv_'
> ma57ad.f:(.text+0xe0b8): undefined reference to `dtpsv_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57qd_':
> ma57ad.f:(.text+0xe7ae): undefined reference to `dtpsv_'
> ma57ad.f:(.text+0xec86): undefined reference to `dgemm_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57xd_':
> ma57ad.f:(.text+0xedfa): undefined reference to `dtpsv_'
> ma57ad.f:(.text+0xf1f9): undefined reference to `dgemv_'
> /home/usual/INSTALLDIRS/Ipopt310/ThirdParty/HSL/.libs/libcoinhsl.a(ma57ad.o):
> In function `ma57od_':
> ma57ad.f:(.text+0x1517c): undefined reference to `dgemm_'
> ma57ad.f:(.text+0x163a2): undefined reference to `dgemm_'
> ma57ad.f:(.text+0x16478): undefined reference to `dgemm_'
> collect2: ld returned 1 exit status
> make[3]: *** [ipopt] Error 1
> make[3]: Leaving directory
> `/home/usual/INSTALLDIRS/Ipopt310/Ipopt/src/Apps/AmplSolver'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/usual/INSTALLDIRS/Ipopt310/Ipopt/src/Apps'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/usual/INSTALLDIRS/Ipopt310/Ipopt'
> ========================================================================
Well, you just "snipped" away the compiler/linker call line, difficult
to say then what is going wrong,
> If one were to do an 'nm' on the static library, one notices for instance
> that the dgemm symbol clearly exists.
> ========================================================================
> % nm /usr/lib/atlas-base/atlas/libblas.a | grep dgemm
> 0000000000000000 T atl_f77wrap_dgemm_
> ATL_dgemm.o:
> 0000000000000000 T ATL_dgemm
> dgemm.o:
> U atl_f77wrap_dgemm_
> ========================================================================
No, there are three symbols that have dgemm in the name, but no
"dgemm_", as required by the solvers. Some other library that maps
dgemm_ to, e.g., ATL_dgemm seems to be missing.
Maybe that are the libblas.a and liblapack.a that Andreas was mentioning.
Stefan
>
> I'm baffled!
>
> David
>
>
> On Wed, Feb 15, 2012 at 10:12 PM, Andreas Waechter<awaechter.iems at gmail.com
>> wrote:
>
>> Hi David,
>>
>>
>> I was wondering if anyone here running Ubuntu has managed to successfully
>>> compile IPOPT 3.10 with the system-packaged ATLAS?
>>>
>>> I'm running Ubuntu 11.10 64-bit.
>>>
>>
>> I'm running the same OS.
>>
>>
>>> In previous versions of Ubuntu, all I had to do was to link against
>>> libblas.so.3 and liblapack.so.3 provided by the package libatlas-dev-sse2.
>>> However, this package has been removed and replaced with a new package
>>> called libatlas-base-dev (ATLAS 3.8.4), which provides two new libraries
>>> named libf77blas.so and liblapack_atlas.so.
>>>
>>> IPOPT's configure script accepts libf77blas.so but fails for
>>> liblapack_atlas.so.
>>>
>>> 1) Could it be that the new liblapack_atlas.so does not have the LAPACK
>>> routines that IPOPT needs?
>>> 2) Are there any workarounds or do I have to compile my own ATLAS from
>>> scratch?
>>>
>>
>> I have the same package installed (libatlas-base-dev). If I understand
>> correctly, all you have to do is to link with -lblas and -llapack. Your
>> "alternatives configurator" should be set up automatically to pick up
>>
>> /usr/lib/atlas-base/atlas/**libblas.so.3gf and
>> /usr/lib/atlas-base/atlas/**liblapack.so.3gf
>>
>> If you look at the symbols in the static versions of those libraries
>> (e.g., nm /usr/lib/atlas-base/atlas/**libblas.a) you will see the atlas
>> symbols ATL_... I guess this setup is meant to be a very convenient way to
>> link with Atlas by just using -lblas and -llapack.
>>
>> Hope this is correct, and hopeful,
>>
>> Andreas
>>
>>
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
More information about the Ipopt
mailing list