Open ahmadia opened 10 years ago
For example, ScaLAPACK is built with:
extends: [cmake_package]
dependencies:
build: [lapack, mpi]
sources:
- url: http://www.netlib.org/scalapack/scalapack.tgz
key: tar.gz:br2k5ltjb7s64tnxsjxutroqxnu44cpo
defaults:
# lib/libscalapack.so contains hard-coded path
relocatable: false
build_stages:
- name: configure
when compiler == 'gcc':
extra: ['-D CMAKE_Fortran_FLAGS_RELEASE:STRING="-O3 -fPIC -march=native -ffast-math -funroll-loops"',
'-D BUILD_TESTING:BOOL=OFF',
'-D BUILD_SHARED_LIBS:BOOL=ON',
'-D LAPACK_LIBRARIES:STRING="${LAPACK_DIR}/lib/liblapack.so"',
'-D BLAS_LIBRARIES:STRING="${LAPACK_DIR}/lib/libblas.so"',
]
when compiler != 'gcc':
extra: ['-D BUILD_TESTING:BOOL=OFF',
'-D BUILD_SHARED_LIBS:BOOL=ON',
'-D LAPACK_LIBRARIES:STRING="${LAPACK_DIR}/lib/liblapack.so"',
'-D BLAS_LIBRARIES:STRING="${LAPACK_DIR}/lib/libblas.so"',
]
build_in_source: true
- name: setup_builddir
mode: override
bash: |
However, on OS X the library is named liblapack.dylib as you said. Should I just override the build stage in my profile? Or is there a generic way of handling library names?
I think the solution is along these lines: https://github.com/hashdist/hashstack/pull/709#issuecomment-88595480, the lapack implementation should export couple environment variables about how to link it, paths to the libraries (i.e. .so or .dylib, or .dll) and so on. Then packages like scalapack just use those environment variables instead of hardwiring ${LAPACK_DIR}/lib/liblapack.so
.
on OS X, it will be
liblapack.dylib
, the name isliblapack.so
currently. Should be a simple fix.