-
Notifications
You must be signed in to change notification settings - Fork 267
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
Cannot link in msys64/ucrt64 because of wrong linking with -lC:/pathToGOMP/libgomp.dll.a #882
Comments
It looks like you are building for a MSYS2 (i.e., Cygwin) target while trying to use a Windows linker to link to Windows libraries. What does |
The default that come with msys2/UCRT64.
|
I didn't ask for the output of |
Additionally, you shouldn't edit the CMake files of SuiteSparse's build system. If you'd like to build just a subset of the SuiteSparse libraries, follow the example given in the README file:
|
|
Sorry, but this is an old SuiteSparse habit since the Makefile days that hard to get rid of. But I find it much more convenient since it is easier to maintain because I cannot remember by heart which variable to set to what. This is the kind of complexity I find unacceptable which cmake. I have lost many days in the past to learn how to use it just to realize that it is another badly designed computer science project with a terrible learning curve similar to emacs, to be replaced soon by something more reasonable. I am happy that there are much more logical alternatives at the moment providing everything that cmake offers and much more readable as well. Check for example xmake. |
You are using a |
If that is what you are struggling with most, maybe |
OK I installed the ucrt64 cmake as you suggested.
|
Delete your build directory (with all files that were created when you used the wrong cmake), and start again. |
Fwiw, here is the configure command that I use most of the time when building in SuiteSparse in MSYS2:
If you don't plan on building the libraries repeatedly, you can get rid of the
|
I do that every time before cmake. This is another reason why I do not like cmake. |
Same problem as before. I delete every time before cmaking: |
What does |
If you only want to use SuiteSparse but you are struggling to build it, it might be easier to use distributed binaries. E.g., from MSYS2: https://packages.msys2.org/base/mingw-w64-suitesparse |
`
if you see the output I pasted above it clearly shows that it runs the new cmake we installed recently.
|
What is |
What is |
|
The reason I am doing all these is that I want to add a function to KLU to monitor the memory allocated through a function call because I am using KLU from .NET. I do not know how to write in .NET an interface to the Common structure but it is relatively easy to add an interface to a function. But I was not able to find such a function in KLU. |
Maybe, write a small function in C that does that for you. I don't know much about .NET. But surely it can link to objects written in C and use functions that are declared in it. Can it? But by the looks of it, either your compiler or your linker (or something else) doesn't work. Have a look at the (Another idea: You wouldn't be the first for which a overzealous virus scanner deleted something important. Which are you using?) |
No, this is a brand new laptop. |
.NET cannot link to objects it uses shared objects opens the .dll or .so object. This is not the problem. This is doable. |
This problem we ran into has been reported in other context. It seems it is a problem with the ninja of ucrt64. |
After, reinstalling ninja for ucrt64 and updating the whole system using
and reinstalling ninja, make, cmake after the previous command, the cmake command mentioned that it generates ninja files instead of Makefiles. It is important to reinstall ucrt64/mingw-w64-ucrt-x86_64-make although it may say that it is already installed.
It configured correctly without issues and the command |
shall I close this issue as resolved? |
I updated the instructions in my previous reply. The key point I missed was to reinstall also ucrt64/mingw-w64-ucrt-x86_64-make although it is already installed. You many now close the issue as resolved. |
The bug
$ make
[ 0%] Building C object SuiteSparse_config/CMakeFiles/SuiteSparseConfig.dir/SuiteSparse_config.c.o
[ 0%] Linking C shared library msys-suitesparseconfig-7.dll
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lC:/msys64/ucrt64/lib/libgomp.dll.a: Invalid argument
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lC:/msys64/ucrt64/lib/libmingwthrd.a: Invalid argument
collect2.exe: error: ld returned 1 exit status
make[2]: *** [SuiteSparse_config/CMakeFiles/SuiteSparseConfig.dir/build.make:97: SuiteSparse_config/msys-suitesparseconfig-7.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:367: SuiteSparse_config/CMakeFiles/SuiteSparseConfig.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
To Reproduce
After I enabled only a subset of packages in CMakeLists.txt by commenting the "all" line and specifying them individually
I tried
The text was updated successfully, but these errors were encountered: