Open bharswami opened 11 months ago
SPRAL requires autotools to generate the necessary build files so I suggest that you generate these in Linux by running ./autogen.sh
on WSL or a Linux machine and copy them over to Windows as described in #75.
We are working on moving SPRAL over to a meson based build system that will avoid all this and work on Windows.
Does autogen.sh give libraries or project files for Visual Studio?
We do not supply libraries or project files for Visual Studio as we do not support Visual Studio.
I don’t use Linux. So could you please tell me what autogen.sh actually does?
It generates the necessary files for you to be able to start compilation, see here for more details: https://en.wikipedia.org/wiki/GNU_Autotools
Do they generate file that I can compile with other files in a Visual Studio environment? I know you said you don’t support Visual Studio. Just clarifying.
Yes once you have the build files generated you should be able to compile SPRAL under Visual Studio provided you can install the necessary dependencies METIS and hwloc in your Visual Studio environment.
I don’t have access to a Linux machine. If it’s not too much to ask, can you provide them to me or add it to a repository and give me a link?
In that case I suggest you use WSL: https://learn.microsoft.com/en-us/windows/wsl/about
Thanks jfowkes. I am trying as we type. I will still like to build SPRAL from the code in Windows Visual Studio. I have been trying but some "tests" (ldlt_app.cpp) are giving errors. The project is building fine though. The error is an out-of-bounds index for a vector. I am trying several ways to identify the source of the error. Could you help me in this?
I have ./autogen.sh 'd the repository as suggested. I am getting a bunch of files. [image: image.png] Which among these should I use in my VS project.
On Tue, Sep 19, 2023 at 1:32 PM Jari @.***> wrote:
In that case I suggest you use WSL: https://learn.microsoft.com/en-us/windows/wsl/about
— Reply to this email directly, view it on GitHub https://github.com/ralna/spral/issues/137#issuecomment-1725017252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHO5AOPRNQVLGQNBEBMWG3X3FGRFANCNFSM6AAAAAA44Y6MYM . You are receiving this because you authored the thread.Message ID: @.***>
@bharswami
I cross-compiled SPRAL on Windows for you: SPRAL.v2023.9.7.x86_64-windows.tar.gz
You will find static and shared libraries (libspral.a
and libspral.dll
) as well as all dependencies required by SPRAL (deps
folder).
Thanks a ton. But windows statis libraries *.lib files?
MinGW generates static libraries on Windows as *.a
but you can rename them *.lib
.
I doubt if it works that way. I am getting the following error on compiling (after renaming it to *.lib). spralltestfull_dlls is my project name. Severity Code Description Project File Line Suppression State Error LNK1143 invalid or corrupt file: no symbol for COMDAT section 0x8 spraltestfull_dlls D:\Bharath\OptiToolbox\ipopt\spraltestfull_dlls\libspral.lib(guess_topology.o) 1
Can you try with the dynamic shared library? Ipopt is compiled with libspral.dll
in Julia and it's working.
Can you also provide your compilers (C, C++ and Fortran)?
.dll needs .lib. Both are needed while compiling. Can you provide the *.lib files for the 'deps' dlls you sent me? I am using Intel Compiler for FORTRAN and MSVC compiler for C++.
Oh, you need the import libraries (.lib or .dll.a) and not static libraries .a.
I can send you the .dll.a files but you must use gfortran
because I cross-compiled with gfortran
.
Shared libraries compiled with ifort
or ifx
are not compatible.
Send me the import libraries. I will try. I doubt if I will need to compile in FORTRAN. But is it possible for you to compile with ifort?
SPRAL.v2023.9.7.x86_64-w64-mingw32-libgfortran5.tar.gz No, only gcc / gfortran / g++ is available in the cross-compiler.
I am still getting the same error.
Severity Code Description Project File Line Suppression State
Error LNK1143 invalid or corrupt file: no symbol for COMDAT section 0x8 spraltestfull_dlls D:\Bharath\OptiToolbox\ipopt\spraltestfull_dlls\libspral.a(guess_topology.o) 1
You have not sent all the lib files. Any reason for that?
I am only building a C++ project (running test ssids.cpp). So I won't need a FORTRAN compiler. I am giving the path to the dlls to the C++ compiler.
Can you please send me the *.o files generated by the cross-compiler?
Yes, I can. I hope that it will help you. spral.zip
Does the function ldlt_app_tests(), in file ldlt_app.cpp, run fine at your end? Can you please confirm? Can you send me the file dependencies for ldlt_app.cpp?
@bharswami Can you try to compiler SPRAL with the new Meson build system on Windows?
Sure. Give me a day’s time as I am also with another assignment.
On Mon, Oct 30, 2023 at 2:25 AM Alexis Montoison @.***> wrote:
@bharswami https://github.com/bharswami Can you try to compiler SPRAL with the new Meson build system on Windows?
— Reply to this email directly, view it on GitHub https://github.com/ralna/spral/issues/137#issuecomment-1784222458, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHO5ALWEGA4CSJKKCJIPK3YB27DHAVCNFSM6AAAAAA44Y6MYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGIZDENBVHA . You are receiving this because you were mentioned.Message ID: @.***>
I am sorry for the delay in replying. I have been busy with the placement season here. I don't know if you still like me to build the new repository. Do you have the Meson build system as a Visual Studio project? Or is it using a makefile? How do I build it on my windows PC? Please let me know.
On Mon, Oct 30, 2023 at 12:59 PM Bharath ae15d019 @.***> wrote:
Sure. Give me a day’s time as I am also with another assignment.
On Mon, Oct 30, 2023 at 2:25 AM Alexis Montoison @.***> wrote:
@bharswami https://github.com/bharswami Can you try to compiler SPRAL with the new Meson build system on Windows?
— Reply to this email directly, view it on GitHub https://github.com/ralna/spral/issues/137#issuecomment-1784222458, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHO5ALWEGA4CSJKKCJIPK3YB27DHAVCNFSM6AAAAAA44Y6MYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGIZDENBVHA . You are receiving this because you were mentioned.Message ID: @.***>
Can you build and test SPRAL on your windows PC with the meson build system? https://github.com/ralna/spral#installation
I am having trouble installing OpenBLAS on my windows PC. meson.build:59:13: ERROR: Fortran shared or static library 'openblas' not found Could you highlight the steps to do this on Windows? I was able to find only the binaries online, but not install/add them to the path.
I believe you can pass the paths as options to meson setup
as follows:
meson setup builddir -Dlibblas=openblas -Dliblapack=openblas -Dlibblas_path=path/to/blas -Dlibblas_include=path/to/blas_headers -Dliblapack_path=path/to/lapack
All the meson options we support are described in meson_options.txt
We should also add paths to metis and hwloc. There were some errors, a lot of repeated ones. I think it is possibly because of using mingw compiler. Is it possible to change it to Visual Studio? Some warnings/errors on doing meson compile -C builddir:
@amontoison could you advise?
@bharswami Did you compile METIS
with MinGW
? I suspect that it was compiled by a different compiler.
Yes, you can compile SPRAL
with a different compiler, you just need to setup CC
, CXX
and FC
at the setup phase of Meson:
CC=gcc CXX=g++ FC=gfortran meson setup builddir
CC=icc CXX=icpc FC=ifort meson setup builddir
...
CC=gcc CXX=g++ FC=ifort meson setup builddir I am getting the following error if I set the flags: 'CC' is not recognized as an internal or external command, operable program or batch file. Do you know what is the equivalent flag for visual studio?
@amontoison can you advise?
In that case you need to define CC
, CXX
and FC
as environment variables.
I'm not a windows user but I think that the compiler for Visual Studio is msvc
.
I added them to the environment variables. I am still getting the error.
Hi, I am trying to build SPRAL in Windows Visual Studio 2022. Can anyone share the proj files with the necessary cpps and headers? Or could someone tell me what files are needed in the projects?