Skip to content
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

windows 10 +MSYS : error while loading shared libraries #35

Open
reumle opened this issue Dec 20, 2019 · 2 comments
Open

windows 10 +MSYS : error while loading shared libraries #35

reumle opened this issue Dec 20, 2019 · 2 comments

Comments

@reumle
Copy link

reumle commented Dec 20, 2019

Hello I have managed to compile the C project successfully (thanks to MSYS/Mingw64), however

  • i can't run tests:
$ make test
mkdir -p out/obj
…..
*************************************************************
Successfully compiled SuperSCS (based on SCS)
Find more at: https://github.com/kul-forbes/scs
To test, type 'out/demo_direct' or 'out/demo_indirect',
….

Compiling individual tests...
….
$ out/UNIT_TEST_RUNNER_DIR.exe
C:/proj/Rprojs/PS1908/scs/out/UNIT_TEST_RUNNER_DIR.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

This happens whether libblas.dll and liblapack.dll are in the out directory or not. (I put them there after compilation).

some subquestions:

  • why is the missing library named "?"
  • what would a static linking look like?
  • what is the way to call up the demo? the instruction To test, type 'out/demo_direct' or 'out/demo_indirect', does not seem to work… should there be an .exe in there?

Thanks!

@reumle
Copy link
Author

reumle commented Dec 21, 2019

Hello, this works now. The error is gone.

make run-test
….
out/UNIT_TEST_RUNNER_DIR.exe

is functionnal on my machine, Windows 10 msys/Mingw64 emulation.

Please find below some recipes (some obvious) to make it work.

  1. download the lapack package for msys. Probably best with pacman -S mingw-w64-x86_64-lapack
  1. make sure your (offending) extra libraries libblas and liblapack are not visible from the <scs/out> when you run out/UNIT_TEST_RUNNER_DIR.exe
  2. success!

@jerrylvx
Copy link

I have run into another error while trying to compile this:

Compiling individual tests...
cc -c -g -Wall -std=c99 -Wwrite-strings -funroll-loops -Wstrict-prototypes -I. -Iinclude -D__USE_MINGW_ANSI_STDIO=1 -Ofast -DSVD_ACTIVATED=1 -DCTRLC=1  -DCOPYAMATRIX=1  -DLAPACK_LIB_FOUND -DUSE_LAPACK tests/c/test_dummy.c -o out/obj/test_dummy.o
cc -c -g -Wall -std=c99 -Wwrite-strings -funroll-loops -Wstrict-prototypes -I. -Iinclude -D__USE_MINGW_ANSI_STDIO=1 -Ofast -DSVD_ACTIVATED=1 -DCTRLC=1  -DCOPYAMATRIX=1  -DLAPACK_LIB_FOUND -DUSE_LAPACK tests/c/test_utilities.c -o out/obj/test_utilities.o
cc -c -g -Wall -std=c99 -Wwrite-strings -funroll-loops -Wstrict-prototypes -I. -Iinclude -D__USE_MINGW_ANSI_STDIO=1 -Ofast -DSVD_ACTIVATED=1 -DCTRLC=1  -DCOPYAMATRIX=1  -DLAPACK_LIB_FOUND -DUSE_LAPACK tests/c/test_broyden.c -o out/obj/test_broyden.o
cc -c -g -Wall -std=c99 -Wwrite-strings -funroll-loops -Wstrict-prototypes -I. -Iinclude -D__USE_MINGW_ANSI_STDIO=1 -Ofast -DSVD_ACTIVATED=1 -DCTRLC=1  -DCOPYAMATRIX=1  -DLAPACK_LIB_FOUND -DUSE_LAPACK tests/c/test_superscs.c -o out/obj/test_superscs.o
Building test runner...
cc -g -Wall -std=c99 -Wwrite-strings -funroll-loops -Wstrict-prototypes -I. -Iinclude -D__USE_MINGW_ANSI_STDIO=1 -Ofast -DSVD_ACTIVATED=1 -DCTRLC=1  -DCOPYAMATRIX=1  -DLAPACK_LIB_FOUND -DUSE_LAPACK tests/c/test_runner_dir.c \
    -o out/UNIT_TEST_RUNNER_DIR out/obj/test_dummy.o \
    out/obj/test_broyden.o \
    out/obj/test_superscs.o \
    out/obj/test_utilities.o \
    out/libscsdir.a -lm -lblas -llapack
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: out/obj/test_dummy.o:C:\tools\msys64\scs/include/unit_test_util.h:60: multiple definition of `number_of_assertions'; C:\tools\msys64\tmp\ccfsegwV.o:C:\tools\msys64\scs/include/unit_test_util.h:60: first defined here
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: out/obj/test_broyden.o:C:\tools\msys64\scs/include/unit_test_util.h:60: multiple definition of `number_of_assertions'; C:\tools\msys64\tmp\ccfsegwV.o:C:\tools\msys64\scs/include/unit_test_util.h:60: first defined here
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: out/obj/test_superscs.o:C:\tools\msys64\scs/include/unit_test_util.h:60: multiple definition of `number_of_assertions'; C:\tools\msys64\tmp\ccfsegwV.o:C:\tools\msys64\scs/include/unit_test_util.h:60: first defined here
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: out/obj/test_utilities.o:C:\tools\msys64\scs/include/unit_test_util.h:60: multiple definition of `number_of_assertions'; C:\tools\msys64\tmp\ccfsegwV.o:C:\tools\msys64\scs/include/unit_test_util.h:60: first defined here
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: out/libscsdir.a(unit_test_util.o):C:\tools\msys64\scs/include/unit_test_util.h:60: multiple definition of `number_of_assertions'; C:\tools\msys64\tmp\ccfsegwV.o:C:\tools\msys64\scs/include/unit_test_util.h:60: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:162: test] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants