I can't convince cmake to find my ATLAS

2,567 views
Skip to first unread message

Dustin Lang

unread,
Sep 18, 2013, 5:53:06 PM9/18/13
to ceres-...@googlegroups.com
Hi,

Installing on my Mac laptop was a breeze -- isn't homebrew awesome?

Now I need to install it on my linux cluster and the pain begins.

We use the 'modules' system to set up packages, so I have:

> module load atlas
> echo $ATLAS_DIR
/clusterfs/riemann/software/ATLAS/3.8.3
> ls $ATLAS_DIR
include  lib
> ls $ATLAS_DIR/lib
libatlas.a  libcblas.a    libf77blas.a  liblapack.a  libptcblas.a  libptf77blas.a

I have tried a variety of incantations to try to convince cmake to find it, but to no avail.  I find cmake incredibly opaque in this regard!  I have no idea where it is looking and I can't figure out how to make it tell me.  "-L" doesn't seem to tell the whole story.

I have tried things like,

> cmake ../ceres-solver-1.7.0 -DEIGEN_INCLUDE=~/software/eigen/Eigen -DBLAS_LINKER_FLAGS=${ATLAS_DIR}/lib
> cmake ../ceres-solver-1.7.0 -DEIGEN_INCLUDE=~/software/eigen/Eigen -DCMAKE_LIBRARY_PATH=${ATLAS_DIR}/lib                                  

But I keep getting the (fairly unhelpful) complaints

-- Found Eigen 3.x: /home/dstn/software/eigen/Eigen
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Did not find LAPACK library
-- A library with BLAS API not found. Please specify library location.

Yeah, HOW do I specify the library location, please?  Let's imagine I'm not interested in becoming an expert in cmake before building something with it.

Thanks!  From what I've seen so far, Ceres rocks.  I was able to plumb it into my python app and it looks like it is going to beat out my existing sparse least-squares solver (and with way more flexibility and power) without any real tuning.

cheers,
dustin


Sameer Agarwal

unread,
Sep 18, 2013, 6:14:47 PM9/18/13
to ceres-...@googlegroups.com
Hi Dustin,

CMAKE_LIBRARY_PATH  and CMAKE_INCLUDE_PATH are the two variables you need to set.

cmake -DCMAKE_LIBRARY_PATH="/clusterfs/riemann/software/ATLAS/3.8.3/lib" -DCMAKE_INCLUDE_PATH=${HOME}/software/eigen

should do the trick I think.

Sameer




--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/b433cc2d-36d2-4442-ba92-01e519979440%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dustin Lang

unread,
Sep 18, 2013, 7:19:55 PM9/18/13
to ceres-...@googlegroups.com
Afraid not:

> cmake ../ceres-solver-1.7.0 -DCMAKE_LIBRARY_PATH="/clusterfs/riemann/software/ATLAS/3.8.3/lib" -DCMAKE_INCLUDE_PATH=${HOME}/software/eigen 2>&1      
-- Found Eigen 3.x: /home/dstn/software/eigen/Eigen
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Did not find LAPACK library
-- A library with BLAS API not found. Please specify library location.
-- Did not find BLAS library

> cmake --version
cmake version 2.8.11.2


Dustin Lang

unread,
Sep 18, 2013, 7:22:35 PM9/18/13
to ceres-...@googlegroups.com
Tried this too:

> cmake ../ceres-solver-1.7.0 -DCMAKE_LIBRARY_PATH="${ATLAS_DIR}/lib" -DCMAKE_INCLUDE_PATH="${HOME}/software/eigen:${ATLAS_DIR}/include" 2>&1 | head

-- Found Eigen 3.x: /home/dstn/software/eigen/Eigen
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Did not find LAPACK library
-- A library with BLAS API not found. Please specify library location.
-- Did not find BLAS library

but no dice.

--dstn


Dustin Lang

unread,
Sep 18, 2013, 7:31:43 PM9/18/13
to ceres-...@googlegroups.com
> can you try one more thing?just edit the cmake file and add the line
>
> LIST(APPEND CMAKE_LIBRARY_PATH /clusterfs/riemann/software/ATLAS/3.8.3/lib)
>
> around line 122 or so

No luck there.

Is there any chance the BLAS cmake recipe is looking for dynamic libs?  It looks like we only have static libraries in our ATLAS install:


> ls $ATLAS_DIR/lib
libatlas.a  libcblas.a    libf77blas.a  liblapack.a  libptcblas.a  libptf77blas.a

thanks for your help,
--dustin

Sameer Agarwal

unread,
Sep 18, 2013, 7:40:15 PM9/18/13
to ceres-...@googlegroups.com
yes this seems to be the case. Here is the relevant cmake output on my linux box.

<snip>
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Found LAPACK library: /usr/lib/liblapack.so;/usr/lib/libf77blas.so;/usr/lib/libatlas.so
-- A library with BLAS API found.
-- Found BLAS library: /usr/lib/libf77blas.so;/usr/lib/libatlas.so
<snip>

and it seems to be finding the shared libraries, but ubuntu only installs the shared versions of these libraries.

But I believe if you set the variable BLA_STATIC to ON, it will look for the static version of these libraries.

so try doing -DBLA_STATIC=ON

Sameer



--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Dustin Lang

unread,
Sep 18, 2013, 8:26:54 PM9/18/13
to ceres-...@googlegroups.com

But I believe if you set the variable BLA_STATIC to ON, it will look for the static version of these libraries.

so try doing -DBLA_STATIC=ON


No luck:

> cmake ../ceres-solver-1.7.0 -DCMAKE_INCLUDE_PATH="${HOME}/software/eigen" -DBLA_STATIC=ON -DCMAKE_LIBRARY_PATH="${ATLAS_DIR}/lib" -DCMAKE_INCLUDE_PATH="${HOME}/software/eigen:${ATLAS_DIR}/include" 2>&1 | head

Dustin Lang

unread,
Sep 18, 2013, 8:32:22 PM9/18/13
to ceres-...@googlegroups.com
Wait, I've got something!

> cmake ../ceres-solver-1.7.0 -DCMAKE_INCLUDE_PATH="${HOME}/software/eigen" -DLAPACK_LIBRARIES=${ATLAS_DIR}/lib/libatlas.a -DBLAS_LIBRARIES=${ATLAS_DIR}/lib/libcblas.a


-- Found Eigen 3.x: /home/dstn/software/eigen/Eigen
-- A library with BLAS API found.

-- A library with LAPACK API found.
-- Found LAPACK library: /clusterfs/riemann/software/ATLAS/3.8.3/lib/libatlas.a

-- A library with BLAS API found.
-- Found BLAS library: /clusterfs/riemann/software/ATLAS/3.8.3/lib/libcblas.a



cmake --trace

was what allowed me to see what variables it could possibly be looking at.

@Sameer, thanks very much for your help!... I'll probably be back for more as I try to get the dependency stack installed.

cheers,
--dustin

Reply all
Reply to author
Forward
0 new messages