Closed kschwede closed 4 years ago
That's bizarre! Could you post the full output of cmake -LA . | grep -i boost
?
ps: better to use ```[newline][code][newline]```
for multi-line code
Here you are. The first time I pasted it, it complained about missing programs, but it build programs successfully. I'll try again with a clean clone as well.
## Configure Macaulay2
M2 version = 1.16.0.2
Git commit = 8103563cf
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 = 2020AMDComputer
OS REL = Linux 4.19.104-microsoft-standard
ARCH = x86_64
## Staging area prefixes
common = /home/schwede/M2Ninja/M2/M2/BUILD/build/usr-dist/common
exec = /home/schwede/M2Ninja/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
CHECK_START Checking library compatibility
CHECK_PASS Libraries are compatible!
CHECK_PASS Everything is in order! �
## External components
Need to build:
Libraries = N/A
Programs = N/A
Already built:
Libraries = Flint;Factory;Frobby;MPSolve;GTest;Memtailor;Mathic;Mathicgb
Programs = 4ti2;cohomCalg;lrslib;Nauty;TOPCOM
## 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
Boost_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0
Boost_INCLUDE_DIR:PATH=/usr/include
Boost_REGEX_LIBRARY_RELEASE:STRING=/usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0
Boost_STACKTRACE_BACKTRACE_LIBRARY_RELEASE:STRING=/usr/lib/x86_64-linux-gnu/libboost_stacktrace_backtrace.so.1.71.0
boost_headers_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/boost_headers-1.71.0
boost_regex_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/boost_regex-1.71.0
boost_stacktrace_backtrace_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/boost_stacktrace_backtrace-1.71.0
No need to do a fresh build, having separate components guarantees that a problem in one component (e.g. missing programs) will never cause a problem with building the binary.
What is the output of this?
nm --demangle /lib/x86_64-linux-gnu/libboost_regex.a | grep "boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform"
When I run this on Ubuntu 20.04 I get the following:
macaulay@527be761f5fa:~/M2/M2/BUILD/build-docker$ nm --demangle /lib/x86_64-linux-gnu/libboost_regex.a | grep "boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform"
U boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const
U boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const
0000000000000000 W boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const
0000000000000000 W boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const
nm: regex_debug.o: no symbols
nm: w32_regex_traits.o: no symbols
nm: usinstances.o: no symbols
So the symbols are there in the static library.
Here's my output
schwede@2020AMDComputer:~/M2Ninja/M2/M2/BUILD/build$ nm --demangle /lib/x86_64-linux-gnu/libboost_regex.a | grep "boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform"
U boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const
U boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const
0000000000000000 W boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const
0000000000000000 W boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const
nm: regex_debug.o: no symbols
nm: w32_regex_traits.o: no symbols
nm: usinstances.o: no symbols
Anyways, I started from scratch, still no luck.
Could you try compiling with clang instead? This probably does require a clean start. You can set the compiler with:
CC=clang CXX=clang++ cmake ....
On the first run of cmake.
Actually, before that, let's try building a test program: boost-example.cpp.txt The compile command:
g++ boost-example.cpp.txt -lboost_regex
The simple example seemed to work.
schwede@2020AMDComputer:~$ mv boost-example.cpp.txt boost-example.cpp
schwede@2020AMDComputer:~$ g++ boost-example.cpp -lboost_regex
schwede@2020AMDComputer:~$ ls
M2Ninja M2Projects MMP Workshop-2016-Utah a.out boost-example.cpp.txt:Zone.Identifier mail nwM2
M2OldMake M2SourceMoved MyFork Workshop-2020-Cleveland boost-example.cpp dead.letter myM2 test.m2
schwede@2020AMDComputer:~$ a.out
a.out: command not found
schwede@2020AMDComputer:~$ ./a.out
abcd, ab, c, d,
I had to
sudo apt install clang
and then I ran
CC=clang CXX=clang++ cmake -GNinja -S../.. -B. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
-- Checking for one of the modules 'givaro>=4.1.1'
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found suitable version "2.9.10", minimum required is "2.9")
CHECK_START Checking library compatibility
CHECK_FAIL Detected library incompatibilities; rerun the build-libraries target
-- Submodule update
Submodule 'M2/Macaulay2/editors/emacs' (https://github.com/Macaulay2/M2-emacs.git) registered for path 'Macaulay2/editors/emacs'
Submodule 'M2/submodules/bdwgc' (https://github.com/Macaulay2/bdwgc.git) registered for path 'submodules/bdwgc'
Submodule 'M2/submodules/fflas-ffpack' (https://github.com/linbox-team/fflas-ffpack.git) registered for path 'submodules/fflas_ffpack'
Submodule 'M2/submodules/flint2' (https://github.com/Macaulay2/flint2.git) registered for path 'submodules/flint2'
Submodule 'M2/submodules/frobby' (https://github.com/Macaulay2/frobby.git) registered for path 'submodules/frobby'
Submodule 'M2/submodules/givaro' (https://github.com/Macaulay2/givaro.git) registered for path 'submodules/givaro'
Submodule 'M2/submodules/googletest' (https://github.com/google/googletest.git) registered for path 'submodules/googletest'
Submodule 'M2/submodules/libatomic_ops' (https://github.com/Macaulay2/libatomic_ops.git) registered for path 'submodules/libatomic_ops'
Submodule 'M2/submodules/mathic' (https://github.com/Macaulay2/mathic) registered for path 'submodules/mathic'
Submodule 'M2/submodules/mathicgb' (https://github.com/Macaulay2/mathicgb) registered for path 'submodules/mathicgb'
Submodule 'M2/submodules/memtailor' (https://github.com/Macaulay2/memtailor) registered for path 'submodules/memtailor'
Submodule 'M2/submodules/mpir' (https://github.com/Macaulay2/mpir.git) registered for path 'submodules/mpir'
Cloning into '/home/schwede/M2Ninja/M2/M2/Macaulay2/editors/emacs'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/bdwgc'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/fflas_ffpack'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/flint2'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/frobby'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/givaro'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/googletest'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/libatomic_ops'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/mathic'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/mathicgb'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/memtailor'...
Cloning into '/home/schwede/M2Ninja/M2/M2/submodules/mpir'...
Submodule path 'Macaulay2/editors/emacs': checked out '310601c59196cd70cc105191ce8771676c25f5b4'
From https://github.com/Macaulay2/bdwgc
* branch 98ac50b6311219b8f57a794deb9a72d2a25b23ce -> FETCH_HEAD
Submodule path 'submodules/bdwgc': checked out '98ac50b6311219b8f57a794deb9a72d2a25b23ce'
From https://github.com/linbox-team/fflas-ffpack
* branch 91ca323d0dfe2236148a2847d33602fc702f2a8f -> FETCH_HEAD
Submodule path 'submodules/fflas_ffpack': checked out '91ca323d0dfe2236148a2847d33602fc702f2a8f'
Submodule path 'submodules/flint2': checked out 'e159671204454a784fa2120fb315be9ebff10f47'
Submodule path 'submodules/frobby': checked out 'd12b7b786a0e50765c1a2878601125ac2f55b68c'
Submodule path 'submodules/givaro': checked out '9f23d861971b48584bd628d05bdf526267c81b95'
Submodule path 'submodules/googletest': checked out '703bd9caab50b139428cea1aaff9974ebee5742e'
Submodule path 'submodules/libatomic_ops': checked out 'ba6c3170412ef7f751ff63e2b656296265dcff93'
Submodule path 'submodules/mathic': checked out 'd26913a8117c2c2191d286ae766592a84ec4d003'
Submodule path 'submodules/mathicgb': checked out 'd8dd3d617e7c5658d3222490c1d8d8984a848c0b'
Submodule path 'submodules/memtailor': checked out '31024178b1337c364b6f652e3de0d893d5874223'
Submodule path 'submodules/mpir': checked out '82816d99518e8779cbe981e6667a9b0fd23be20a'
CMake Error at cmake/build-libraries.cmake:239 (message):
gmp integer package specified, but not found
Call Stack (most recent call first):
CMakeLists.txt:76 (include)
-- Configuring incomplete, errors occurred!
See also "/home/schwede/M2Ninja/M2/M2/BUILD/build/CMakeFiles/CMakeOutput.log".
See also "/home/schwede/M2Ninja/M2/M2/BUILD/build/CMakeFiles/CMakeError.log".
but I had errors, see the log files here:
http://www.math.utah.edu/~schwede/CMakeError.log
http://www.math.utah.edu/~schwede/CMakeOutput.log
what else do I need to install? It's not so obvious from me from the log files.
By the way, I've tried it (not the CLang version) on another machine using WSL2 + Ubuntu 20.04, I had the same issue. But I had no trouble with an actual Ubuntu machine. Perhaps something else is missing?
Regarding the clang errors, did you start with a fresh build directory?
Yes, I tried it on an ubuntu machine as well, which is why I'm at a loss for what could be going wrong. Can you try compiling the test program with these two commands instead:
g++ -DBOOST_ALL_NO_LIB -DBOOST_REGEX_DYN_LINK boost-example.cpp -lboost_regex
and:
g++ -DBOOST_ALL_NO_LIB -DBOOST_REGEX_DYN_LINK -c boost-example.cpp
g++ -DBOOST_ALL_NO_LIB -DBOOST_REGEX_DYN_LINK -o a.out boost-example.o /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.71.0
and if both of them work, try the following:
g++ -g -S boost-example.cpp
and attach the resulting boost-example.s
file.
Oh, I just noticed this line in one of the logs you uploaded:
clang: error: unknown argument: '-fabi-version=6'
Uninstall givaro and fflas-ffpack! The version on ubuntu 20.04 is too old for gcc 9. Crossing fingers that this resolves the issue!!
The test program had no issues. I'm attaching the boost-example.s (.gz)
II removed fflas-ffpack although it didn't appear that I had givaro installed. I'll try clang again momentarily (I think I did a clean install...)
I was able to reproduce the issue after installing ubuntu's fflas-ffpack 2.4.3-1 and libgivaro-dev 4.1.1-2build1, both of which have -fabi-version=6
among their cflags:
/usr/bin/ld: Macaulay2/d/CMakeFiles/M2-interpreter.dir/boost-regex.cpp.o: in function `boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) const':
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:966: undefined reference to `boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
/usr/bin/ld: Macaulay2/d/CMakeFiles/M2-interpreter.dir/boost-regex.cpp.o: in function `boost::cpp_regex_traits<char>::transform(char const*, char const*) const':
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:962: undefined reference to `boost::re_detail_107100::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Ok, I'm still having trouble with clang, but I'll try it after removing everything fflas-ffpack. By the way, the instructions for compiling the classic way still tell people to install libgivaro-dev
and fflas-ffpack
.
Ok, I'm still having trouble with clang, but I'll try it after removing everything fflas-ffpack.
I think using gcc should be fine with fflas-ffpack and givaro removed.
By the way, the instructions for compiling the classic way still tell people to install libgivaro-dev and fflas-ffpack.
Yes, and that works for older compilers. I reopened #1227 a couple of months back to address this. @d-torrance could you reconsider patching the Ubuntu package? The upstreams haven't made a new release in months, but this continues to be a nuisance.
Ok, it worked for me too. I'm currently building documentation. I've gotten more errors for that in the cmake version in the past, but I haven't tried compiling recently, so hopefully it works.
Great! Are you building from the development branch (or a branch on top of it)? If so please open an issue if you get documentation errors, I recently made a lot of improvements in the documentation system and there may be bugs hidden.
I'll close this for now. Feel free to reopen if similar issues occur.
Yes, and that works for older compilers. I reopened #1227 a couple of months back to address this. @d-torrance could you reconsider patching the Ubuntu package? The upstreams haven't made a new release in months, but this continues to be a nuisance.
It's on my to-do list. FYI, any changes to the Debian fflas-ffpack package now won't be part of an official Ubuntu release until 21.04 next April. The feature freeze for the next release (20.10 in October) was last month.
But 20.04 is an LTS release, doesn't that mean packages will have updates and patches for longer? If not then we'll need to remove fflas-ffpack and givaro from the INSTALL file because presumably a lot of people will use 20.04 until the next LTS.
But 20.04 is an LTS release, doesn't that mean packages will have updates and patches for longer?
That's true. I'm not familiar with the process, but could look into it.
Also, the default compiler in 20.04 is still gcc 9, and isn't the issue just with gcc 10? gcc 10 won't be the default until 20.10 (https://lists.ubuntu.com/archives/ubuntu-devel/2020-July/041102.html).
Also, the default compiler in 20.04 is still gcc 9, and isn't the issue just with gcc 10? gcc 10 won't be the default until 20.10 (https://lists.ubuntu.com/archives/ubuntu-devel/2020-July/041102.html).
Apparently this affects gcc 9 as well. I just tested it manually, and removing -fabi-version=6
from the compile command resolved the bug.
Following the instructions for the quick build from
INSTALL-CMake.mod
This fails even before I get to packages. I already have libboost-regex-dev installed (1.71.0.0ubuntu2). Is there something else needed? (Ubuntu 20.04, WSL2).
The classic way of building from source still works. Here is the output when the build fails.