Closed jchen419 closed 4 years ago
Could you also put the result of cmake .
here?
Sure thing:
jchen@DESKTOP-B2KDSAV:~/jchen419-M2/M2/BUILD/build$ cmake .
## Configure Macaulay2
M2 version = 1.16.0.2
Git commit = d12e1e0d4
Install prefix = /usr
CMAKE_BUILD_TYPE = Release
BUILD_NATIVE = ON
BUILD_SHARED_LIBS = OFF
BUILD_TESTING = ON
BUILD_DOCS = OFF
COVERAGE = OFF
PROFILING = OFF
DEVELOPMENT = OFF
EXPERIMENT = OFF
## Host OS information
ISSUE = Ubuntu-20.04
NODENAME = DESKTOP-B2KDSAV
OS REL = Linux 4.19.128-microsoft-standard
ARCH = x86_64
## Staging area prefixes
usr-host = /home/jchen/jchen419-M2/M2/BUILD/build/usr-host
common = /home/jchen/jchen419-M2/M2/BUILD/build/usr-dist/common
exec = /home/jchen/jchen419-M2/M2/BUILD/build/usr-dist/x86_64-Linux-Ubuntu-20.04
## Compiler information
C = GNU 9.3.0 (/usr/bin/cc)
C++ = GNU 9.3.0 (/usr/bin/c++)
CHECK_START Checking for existing libraries and programs
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE)
CHECK_START Checking library compatibility
CHECK_PASS Libraries are compatible!
-- Submodule update
CHECK_FAIL Some components are missing
## Before building Macaulay2, rerun build-libraries and build-programs targets
## External components
Need to build:
Libraries = N/A
Programs = 4ti2;cohomcalg;csdp;gfan;lrslib;nauty;normaliz;topcom
Already built:
Libraries = BDWGC;MPFR;NTL;Flint;Factory;Frobby;cddlib;MPSolve;GTest;Memtailor;Mathic;Mathicgb;GLPK;Givaro;FFLAS_FFPACK
Programs = N/A
## Library information
Linear Algebra = /usr/lib/x86_64-linux-gnu/libopenblas.so
MP Arithmetic = /usr/lib/x86_64-linux-gnu/libgmpxx.so;/usr/lib/x86_64-linux-gnu/libgmp.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jchen/jchen419-M2/M2/BUILD/build
(Not sure if this is relevant to the issue at hand, but I should also add that WSL2 has been consistently unstable for me with respect to RAM usage - the build process always causes the terminal to crash at least once. I believe this is because the process corresponding to the virtual OS (vmmem.exe) has runaway RAM usage, and is thus killed by Windows.)
If you try running ninja M2-binary
a few times, does the error change?
No, it's giving the same error right now. (Although on previous iterations, it has given an extremely long list of errors, which are all of the form /usr/bin/ld: in function ..., undefined reference to ...)
Try doing:
rm Macaulay2/e/libM2-engine.a
rm Macaulay2/e/CMakeFiles/M2-engine.dir/interrupted.cpp.o
rm Macaulay2/e/CMakeFiles/M2-engine.dir/franzi-interface.cpp.o
Then run ninja M2-binary -j1
, does the error change?
Nope, unfortunately still exactly the same error.
(I think -j1
might help with the RAM usage so that it doesn't crash during the build process, but it's never crashed for me on this step of building the binary.)
I think what has happened is that the compilation crashed earlier, but somehow still produced a faulty file, so then later when it is being used to compile the binary some references are missing from it. Maybe try ninja clean
then ninja M2-binary -j1
.
So that seemed to work! RAM usage was steady, no crashes happened during the build process (though naturally it was slower), and I now have the binary file. It has some errors when starting M2 though - should I run ninja -j1
now?
Try M2-core first, then you should be able to run M2.
For packages, too, add -j1. Feel free to close this if you don't run into any other issues. I'll add a FAQ entry about WSL2.
ninja -j1
worked (again with steady RAM usage), and now the binary works also. Thanks a lot for the help!! (I had thought that ninja was smart enough to recover from a crash, but apparently there can still be silent issues...)
I am unable to build M2 via CMake on a fresh WSL2 install. After repeated attempts, it seems the problem always comes in the same step of building the binary, as shown below: