bertiniteam / b2

Bertini 2.0: The redevelopment of Bertini in C++.
88 stars 34 forks source link

[Solved] Installation Problem Boost/Eigen Mac M1 #164

Closed mfogelson closed 1 year ago

mfogelson commented 2 years ago

System Information : Screen Shot 2021-12-11 at 9 53 58 PM

Autoreconf ouput:

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'.
glibtoolize: copying file 'config/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: copying file 'm4/libtool.m4'
glibtoolize: copying file 'm4/ltoptions.m4'
glibtoolize: copying file 'm4/ltsugar.m4'
glibtoolize: copying file 'm4/ltversion.m4'
glibtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /opt/homebrew/Cellar/autoconf/2.71/bin/autoconf --force
configure.ac:141: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:141: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:745: AM_CONFIG_HEADER is expanded from...
configure.ac:141: the top level
autoreconf: running: /opt/homebrew/Cellar/autoconf/2.71/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:50: installing 'config/compile'
configure.ac:20: installing 'config/missing'
Makefile.am: installing 'config/depcomp'
autoreconf: Leaving directory '.'

Configure:

./configure CPPFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib" CFLAGS="-I/opt/homebrew/include" CC="gcc-11" CXX="gcc-11"

output (Eigen Error):

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C++11 features... none needed
checking dependency style of gcc-11... gcc3
checking whether gcc-11 supports C++14 features by default... yes
checking whether ln -s works... yes
checking build system type... aarch64-apple-darwin20.6.0
checking host system type... aarch64-apple-darwin20.6.0
checking how to print strings... printf
checking for gcc... gcc-11
checking whether the compiler supports GNU C... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C11 features... none needed
checking whether gcc-11 understands -c and -o together... yes
checking dependency style of gcc-11... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin20.6.0 file names to aarch64-apple-darwin20.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin20.6.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc-11 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-11 supports -fno-rtti -fno-exceptions... no
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... gcc-11 -E
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking for library containing cos... none required
checking for library containing __gmpz_init... -lgmp
checking for library containing mpfr_get_version... -lmpfr
checking for library containing mpc_clear... -lmpc
configure: error: unable to find Eigen directory

FIXED add following to line 18497 configure:

ac_eigen_path="/opt/homebrew/Cellar/eigen/3.4.0_1/include"

output (Boost Error):

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C++11 features... none needed
checking dependency style of gcc-11... gcc3
checking whether gcc-11 supports C++14 features by default... yes
checking whether ln -s works... yes
checking build system type... aarch64-apple-darwin20.6.0
checking host system type... aarch64-apple-darwin20.6.0
checking how to print strings... printf
checking for gcc... gcc-11
checking whether the compiler supports GNU C... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C11 features... none needed
checking whether gcc-11 understands -c and -o together... yes
checking dependency style of gcc-11... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin20.6.0 file names to aarch64-apple-darwin20.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin20.6.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc-11 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-11 supports -fno-rtti -fno-exceptions... no
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... gcc-11 -E
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking for library containing cos... none required
checking for library containing __gmpz_init... -lgmp
checking for library containing mpfr_get_version... -lmpfr
checking for library containing mpc_clear... -lmpc
configure: error: unable to find Eigen directory
(bertini) mitchfogelson@Mitchs-Mac-mini core % ./configure CPPFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib" CFLAGS="-I/opt/homebrew/include" CC="gcc-11" CXX="gcc-11"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C++11 features... none needed
checking dependency style of gcc-11... gcc3
checking whether gcc-11 supports C++14 features by default... yes
checking whether ln -s works... yes
checking build system type... aarch64-apple-darwin20.6.0
checking host system type... aarch64-apple-darwin20.6.0
checking how to print strings... printf
checking for gcc... gcc-11
checking whether the compiler supports GNU C... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to enable C11 features... none needed
checking whether gcc-11 understands -c and -o together... yes
checking dependency style of gcc-11... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin20.6.0 file names to aarch64-apple-darwin20.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin20.6.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc-11 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-11 supports -fno-rtti -fno-exceptions... no
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... gcc-11 -E
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking for library containing cos... none required
checking for library containing __gmpz_init... -lgmp
checking for library containing mpfr_get_version... -lmpfr
checking for library containing mpc_clear... -lmpc
checking for Eigen/Dense... yes
checking for boostlib >= 1.71 (107100)... yes
checking for Boost.Multiprecision as part of the found Boost installation: ... checking for boost/multiprecision/mpc.hpp... yes
checking whether the Boost::System library is available... yes
configure: error: Could not find a version of the Boost::System library!

NOTES:

  1. I was able to get this to compile on my other mac Image 12-11-21 at 10 04 PM

Questions:

  1. Why is the Eigen and Boost information not being found during the compile process even when I set the appropriate flags to their locations?

***SOLUTION**** find and replace: /opt/local to /opt/homebrew

Note: No flags needed

make check ERROR, but I think this should be a problem (Maybe):

=====================================
   b2 2.0-alpha6: ./test-suite.log
=====================================

# TOTAL: 10
# PASS:  9
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: b2_class_test
===================

Running 393 test cases...
test/classes/boost_multiprecision_test.cpp:137: error: in "boost_multiprecision/precision_complex_rational_add": check c.precision() == 30 has failed [646392383 != 30]
test/classes/boost_multiprecision_test.cpp:243: error: in "boost_multiprecision/precision_complex_longlong_div_set_float_16digits": check result.precision() == 16 has failed [19 != 16]

*** 2 failures are detected in the test module "Bertini 2 Class Testing"
FAIL b2_class_test (exit status: 201)
mfogelson commented 2 years ago

While I was momentarily able to get things to compile in the end, the whole system continued to struggle.

I recommend anyone using a mac M1 to do the following:

  1. Download UTM
  2. Install Ubuntu 20.04
  3. Follow the Compile guide
  4. When compiling the python code there is a small error to include the architecture of your machine: add the following to line 61 of minieigen/src/double-conversion/utils.h
    define(__aarch64__)
  5. update LD_LIBRARY_PATH and PYTHONPATH to make sure all files are included
  6. Complete
ofloveandhate commented 2 years ago

Reopening -- I need to check if minieigen has implemented this, and if not, make a PR for that.

mfogelson commented 2 years ago

Since you are reopening this, do you want to work with me to get the install working with MacOS?

The install for ubuntu 20.04 is really easy and great, and with mac it is pretty painful unclear where issues are arising.

ofloveandhate commented 1 year ago

I finally just fixed this, by adjusting the m4 macro that finds eigen, and adjusting that line of code in minieigen.