Boost logo

Ublas :

From: Jesse Manning (manning.jesse_at_[hidden])
Date: 2007-10-09 14:55:33


is there a reason you are using the dynamic library (.so) files? I have
only used the static (.a) files for linking with ATLAS/LAPACK on linux. On
the ATLAS FAQ page they mention people have linked with .so files, but it is
not supported by the ATLAS dev team. I would try using the static libraries
and linking the same way as I mentioned above to see if that gets you any
further.

Your build line looks OK to me. You specify the directory and the specific
libraries so I think it should at least find the libraries to link with.

Jesse

On 10/6/07, e r <erwann.rogard_at_[hidden]> wrote:
>
> Jesse Manning wrote:
> > Not sure how you have everything setup, but when I compile/link with
> > atlas on windows I link against the ATLAS libs in this order:
> >
> > liblapack
> > libf77blas
> > libcblas
> > libatlas
> >
> >
> > also this comes from the ATLAS documentation folder in the file named
> > LibReadme.txt
> > ********************************* LINKING
> > *************************************
> > When linking, remember that order is important. So, if you want
> > uniprocessor
> > libs, your link line would contain IN THIS ORDER:
> > -LLIBDIR -llapack -lcblas -lf77blas -latlas
> > And if you want to utilize an SMP version, it would be:
> > -LLIBDIR -llapack -lptcblas -lptf77blas -latlas
> >
> >
> > I hope this helps and you get the problem figured out. Also I compiled
> > the code you posted fine with my setup.
> >
> > Jesse
> >
> >
> > On 10/5/07, *e r* <erwann.rogard_at_[hidden]
> > <mailto:erwann.rogard_at_[hidden]>> wrote:
> >
> > hi,
> >
> > i looked at previous posts on this topic. did not help, a suggestion
> > would be appreciated:
> >
> > installed atlas version 3.6.0-20.6
> >
> > /usr/lib/atlas3-test runs just fine.
> >
> > header cblas.h and clapack.h are in /usr/include/ which is by
> default in
> > my include path.
> >
> > Configuration:
> > -I/usr/local/include/boost_1_34_1
> > -I/usr/local/include/boost-bindings
> > -L/usr/lib/atlas
> > -llapack
> > -lblas
> >
> > i'm trying to run the program:
> >
> > #include <boost/numeric/bindings/atlas/clapack.hpp>
> > #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
> > #include <boost/numeric/bindings/traits/std_vector.hpp>
> > // #include <atlas/cblas.h>
> >
> > namespace ublas = boost::numeric::ublas;
> > namespace atlas = boost::numeric::bindings::atlas;
> >
> > int main() {
> > std::size_t n = 5;
> > ublas::matrix<double> a(n, n);
> > // fill matrix A
> >
> > std::vector<int> ipiv (n); // pivot vector
> > atlas::lu_factor (a, ipiv); // alias for getrf()
> > atlas::lu_invert (a, ipiv); // alias for getri()
> >
> > return 0;
> > };
> >
> > i get the error
> >
> > Building target: testing_numeric_bindings
> > Invoking: GCC C++ Linker
> > g++ -L/usr/lib/atlas -o"testing_numeric_bindings" ./main.o
> -llapack
> > -lblas
> > ./main.o: In function
> > `boost::numeric::bindings::atlas::detail::getrf(CBLAS_ORDER, int,
> int,
> > double*, int, int*)':
> >
> /usr/local/include/boost-bindings/boost/numeric/bindings/atlas/clapack_overloads.hpp:87:
> > undefined reference to `clapack_dgetrf'
> > ./main.o: In function
> > `boost::numeric::bindings::atlas::detail::getri(CBLAS_ORDER, int,
> > double*, int, int const*)':
> >
> /usr/local/include/boost-bindings/boost/numeric/bindings/atlas/clapack_overloads.hpp:163:
> > undefined reference to `clapack_dgetri'
> > collect2: ld returned 1 exit status
> > make: *** [testing_numeric_bindings] Error 1
> > make: Target `all' not remade because of errors.
> > Build complete for project testing_numeric_bindings
> >
> > _______________________________________________
> > ublas mailing list
> > ublas_at_[hidden] <mailto:ublas_at_[hidden]>
> > http://lists.boost.org/mailman/listinfo.cgi/ublas
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ublas mailing list
> > ublas_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/ublas
> thank you for your help. if i follow your advice, i don't link to the
> atlas related libraries. is this meant to?
>
> ./usr/lib/libcblas.so.3
> ./usr/lib/libcblas.so.3.0
>
> ./usr/lib/atlas/libblas.so.3.0
> ./usr/lib/atlas/libblas.so.3
>
> ./usr/lib/liblapack_atlas.so.3.0
> ./usr/lib/liblapack_atlas.so.3
>
> ./usr/lib/atlas/liblapack.so.3.0
> ./usr/lib/atlas/liblapack.so.3
>
> ./usr/lib/libatlas.so.3.0
> ./usr/lib/libatlas.so.3
>
> ./usr/lib/libf77blas.so.3.0
> ./usr/lib/libf77blas.so.3
>
> moreoever, i still have some linking problems:
>
> make -k all
> Building file: ../main.cpp
> Invoking: GCC C++ Compiler
> g++ -I/usr/local/include/boost_1_34_1
> -I/usr/local/include/boost-bindings -O0 -g3 -Wall -c -fmessage-length=0
> -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
> Finished building: ../main.cpp
>
> Building target: testing_numeric_bindings
> Invoking: GCC C++ Linker
> g++ -L/usr/lib -L/usr/lib/atlas -o"testing_numeric_bindings" ./main.o
> -llapack -lf77blas -lcblas -latlas
> /usr/bin/ld: cannot find -llapack
> collect2: ld returned 1 exit status
> make: *** [testing_numeric_bindings] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project testing_numeric_bindings
>
> alternatively,
>
> make -k all
> Building file: ../main.cpp
> Invoking: GCC C++ Compiler
> g++ -I/usr/local/include/boost_1_34_1
> -I/usr/local/include/boost-bindings -O0 -g3 -Wall -c -fmessage-length=0
> -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
> Finished building: ../main.cpp
>
> Building target: testing_numeric_bindings
> Invoking: GCC C++ Linker
> g++ -Wl,-rpath,/usr/lib,/usr/lib/atlas -o"testing_numeric_bindings"
> ./main.o -llapack -lf77blas -lcblas -latlas
> /usr/bin/ld: /usr/lib/atlas: No such file: File format not recognized
> collect2: ld returned 1 exit status
> make: *** [testing_numeric_bindings] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project testing_numeric_bindings
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>