Hi all,
When trying to compile OpenBLAS, I ran into this issue:
gfortran -pthread -O2 -Wall -m64 -fPIC -lm -lpthread -lgfortran -o testslamch slamch.o lsame.o slamchtst.o
gfortran -pthread -O2 -Wall -m64 -fPIC -lm -lpthread -lgfortran -o testdlamch dlamch.o lsame.o dlamchtst.o
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crt1.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crti.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lpthread
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:13: testdlamch] Error 1
make[2]: *** Waiting for unfinished jobs....
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crt1.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crti.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lpthread
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:7: testlsame] Error 1
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crt1.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crti.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lpthread
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:10: testslamch] Error 1
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crt1.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find crti.o: No such file or directory
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lpthread
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
/hab/pkgs/core/binutils/2.30/20180608050633/bin/ld.bfd.real: cannot find -lm
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:17: testsecond] Error 1
make[2]: Leaving directory '/hab/cache/src/OpenBLAS-0.2.20/lapack-netlib/INSTALL'
make[1]: *** [Makefile:17: lapack_install] Error 2
make[1]: Leaving directory '/hab/cache/src/OpenBLAS-0.2.20/lapack-netlib'
make: *** [Makefile:215: netlib] Error 2
The following is my current plan.sh:
pkg_name=openblas
pkg_origin=mike
pkg_version=0.2.20
pkg_description="an optimized BLAS library based on GotoBLAS2 1.13 BSD version"
pkg_upstream_url=https://www.openblas.net/
pkg_license=('BSD')
pkg_maintainer="mike10010100 <mike10010100@gmail.com>"
pkg_source="https://github.com/xianyi/OpenBLAS/archive/v${pkg_version}.tar.gz"
pkg_filename="${pkg_name}-${pkg_version}.tar.gz"
pkg_dirname="OpenBLAS-${pkg_version}"
pkg_shasum=5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394
pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_pconfig_dirs=(lib/pkgconfig)
pkg_build_deps=(
core/make
core/gcc
core/perl
core/ccache
)
pkg_deps=(
core/glibc
)
# do_prepare(){
# export HAB_ENV_LD_LIBRARY_PATH_TYPE=aggregate
# export LIBRARY_PATH=$(pkg_path_for core/glibc/2.27)/lib:$LIBRARY_PATH
# export LD_LIBRARY_PATH=$(pkg_path_for core/glibc/2.27)/lib:$LD_LIBRARY_PATH
# }
do_build() {
#stupid hack from https://github.com/xianyi/OpenBLAS/issues/818
CF="${CFLAGS}"
unset CFLAGS
make FC=gfortran CFLAGS="${CF}" NUM_THREADS=64
}
do_install() {
make PREFIX="$pkg_prefix" install
}
Note the commented out do_prepare
section. This originally allowed the compilation to work. However, if I uncomment that section, it results in the following error:
Makefile.system:958: Makefile.: No such file or directory
make: *** No rule to make target 'Makefile.'. Stop.
Thanks for all your help!