Open jcreinhold opened 1 year ago
I'm suspecting this issue is related to the location of the flags in the call to gcc
/lack of -lgfortran
as a lib/the inability to use -l:libopenblas.a
instead of -lopenblas
. Perhaps we could add an OWL_LDLIBS
environment variable which would default to -lopenblas
or perhaps -lm -lopenblas
?
I can fork this repo and try it out, unless you see something obviously wrong with the previous implementation.
For completeness, here is my PKG_CONFIG_PATH
. Note that OpenBLAS
is present.
PKG_CONFIG_PATH=/.../pcre/8.43/.../lib/pkgconfig:/.../libev/.../lib/pkgconfig:/.../OpenBLAS/0.3.20/.../lib/pkgconfig:/.../gmp/6.1.2/.../lib/pkgconfig:/.../libjpeg/.../lib/pkgconfig:/.../libpng/1.6.37/.../lib/pkgconfig:/.../re2/20190601/.../lib/pkgconfig:/.../sqlite/3.36/.../lib/pkgconfig:/.../zlib/1.2.8/.../lib/pkgconfig:/.../readline/8.0/.../lib/pkgconfig:/.../ncurses/6.1/.../lib/pkgconfig
If I run pkg-config
in the build environment, I get the following.
+ pkg-config --cflags openblas
-I/.../OpenBLAS/0.3.20/.../include
+ pkg-config --libs openblas
-L/.../OpenBLAS/0.3.20/.../lib -lopenblas
So I believe OpenBLAS and pkg-config
are interacting appropriately.
FWIW, I removed OpenBLAS from PKG_CONFIG_PATH
to see if it was interfering with the other OWL_CFLAGS
; it failed with the same error.
Probably worthwhile to put an OWL_LDFLAGS
too so we don't have to jam everything into something named LDLIBS
. Perhaps just have OWL_
versions for CPP_FLAGS
, LDFLAGS
, LDLIBS
which would be placed in the right location.
Actually, the error might just be coming from this test
where OWL_CFLAGS
are ignored. Perhaps this should be moved after cflags
are set? Presumably we want to run the test with the same parameters that will be used for the build.
I'm thinking this error might be coming up is because the build script has a set -e
in it. I believe C.c_test
should just report if the compilation succeeded or failed, not fail (right?). Perhaps the set -e
is killing the process.
Disregard that; it's failing from this test
which kills the build.
This is solved with a patch akin to #636
Thank you very much for the great work with this package.
I'm trying to build this package on a CentOS7 machine with
gcc
v11. I have an OpenBLAS installation compiled from source and a corresponding shared library object whose directory is linked to in theOWL_FLAGS
which I have changed and provided below (with some of the directories replaces with...
for space).However, I'm receiving the following error:
Here are the
OWL_FLAGS
:FWIW, I know that
libgfortran.so.5
is linked to in the-L
andWl,-rpath=
flags containingligcc
in myOWL_FLAGS
. I believe I'm using the samegcc
andlibgfortran
that were used to buildOpenBLAS
.Admittedly, I'm not an expert properly linking libraries in
gcc
; however, it seems that this might be remedied by adding-lgfortran
as a library like-lopenblas
is passed togcc
.If there's any chance you happen to see an obvious problem in this setup; I'd really appreciate it. Otherwise, perhaps it'd be worth considering adding another environment variable which would add libraries like
-lopenblas
is added to thegcc
call. (I tried to add the-lgfortran
as the final flag inOWL_CFLAGS
, but it didn't solve the error; however, I believe that might just be because of the position in thegcc
call.)I'd try to change this myself and see if it worked, but the build system I'm working on is strange and I can't easily do so. I also think there's a reasonable chance that I'm doing something obviously wrong with the above setup.
FYI, we also have a static library for OpenBLAS (using
-Bstatic
on the relevant-Wl
flag inOWL_CFLAGS
), and I've tried linking to that instead of the shared library; however, that resulted inconf-openblas
, whoseopam
file I modified to use$OWL_CFLAGS
instead of$CFLAGS
in thebuild
section) failing with different errors (conf-openblas
would still try to use the shared library object, but the failure would be related to another library).