-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues compiling shared library #26
Comments
Are you using MS Windows? I am not familiar with Windows, not sure the
problem.
Does static link work?
Sherry
…On Wed, Aug 22, 2018 at 1:16 AM, Filip Sund ***@***.***> wrote:
I'm trying to compile a shared library version of SuperLU. I'm using the
following cmake command from the build directory
cmake -G'MSYS Makefiles' -Denable_blaslib=OFF -DCMAKE_INSTALL_PREFIX="C:/msys64/mingw64/" -DBUILD_SHARED_LIBS=TRUE ..
Running make works until it reaches Linking C shared library libmatgen.dll,
where I get a lot of undefined reference to [...]-errors
[ 90%] Linking C shared library libmatgen.dll
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatm1.c.obj):slatm1.c:(.text+0x15d): undefined reference to `input_error'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatb4.c.obj):slatb4.c:(.text+0x38): undefined reference to `smach'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatb4.c.obj):slatb4.c:(.text+0x87): undefined reference to `smach'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slartg.c.obj):slartg.c:(.text+0x3c): undefined reference to `smach'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slartg.c.obj):slartg.c:(.text+0x52): undefined reference to `smach'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slartg.c.obj):slartg.c:(.text+0x68): undefined reference to `smach'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slartg.c.obj):slartg.c:(.text+0x9c): more undefined references to `smach' follow
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatms.c.obj):slatms.c:(.text+0x776): undefined reference to `input_error'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatms.c.obj):slatms.c:(.text+0xa83): undefined reference to `sscal_'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatms.c.obj):slatms.c:(.text+0xbdd): undefined reference to `scopy_'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/matgen.dir/objects.a(slatms.c.obj):slatms.c:(.text+0xca7): undefined reference to `scopy_'
[...]
I think this is some kind of linking error related to BLAS, but I haven't
been able to figure it out. Any ideas?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALMq9409Xzvhh7cOwzttm1x2x1ZXkLVpks5uTRN2gaJpZM4WHMvD>
.
|
Yes, I managed to get static linking to work in the end. The issues might be related to Windows, but I am not sure. There is a comment on stack overflow suggesting using the options
to the linker to generate the import library libexample_dll.a. I have not tried this yet, since I am not sure how to do this when using CMake. Anyway, the static version works for me, so I will just use that. |
Great. I'll probably get some Windows expert to take a look at this.
Sherry Li
…On Fri, Aug 24, 2018 at 1:49 AM, Filip Sund ***@***.***> wrote:
Yes, I managed to get static linking to work in the end.
The issues might be related to Windows, but I am not sure. There is a comment
on stack overflow <https://stackoverflow.com/a/17602173/1850917>
suggesting using the options
-Wl,--out-implib,libexample_dll.a
to the linker to generate the import library libexample_dll.a. I have not
tried this yet, since I am not sure how to do this when using CMake.
Anyway, the static version works for me, so I will just use that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALMq9yltzSScz3Ay2IeI6ePaQ7nPG-PHks5uT74ngaJpZM4WHMvD>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to compile a shared library version of SuperLU. I'm using the following cmake command from the
build
directoryRunning
make
works until it reachesLinking C shared library libmatgen.dll
, where I get a lot ofundefined reference to [...]
-errorsI think this is some kind of linking error related to BLAS, but I haven't been able to figure it out. Any ideas?
EDIT: Compiling the static version seems to work fine, but then I get
undefined reference to [...]
-errors when trying to compile any program, for exampleEXAMPLES/superlu.c
.Using the internal BLAS instead of the installed version (
cmake -G'MSYS Makefiles' -Denable_blaslib=ON -DCMAKE_INSTALL_PREFIX="C:/msys64/mingw64/" -DBUILD_SHARED_LIBS=TRUE ..
) gives me the same errors, but at a different stage in the compilationThe text was updated successfully, but these errors were encountered: