Hi everyone, I had been using Root for a while on macOS which I built around January this year following the exact instructions provided here: https://root.cern.ch/building-root. I installed the prerequisites using Homebrew. However, I had to change my laptop and I cannot do it anymore following the same instructions. Here is what I did:
- Dumped a list of the existing Homebrew packages on the previous laptop in a file
- Installed the same packages from the file on the new laptop
- Tried to build Root the same way
Here is what the error says:
[ 20%] Linking Fortran executable ../bin/g2root
Undefined symbols for architecture x86_64:
"__gfortran_compare_string", referenced from:
_map_found_ in g2root.f.o
_MAIN__ in g2root.f.o
_hnmadr_ in libminicern.a(hbook.f.o)
_hpath_ in libminicern.a(hbook.f.o)
_hntvar3_ in libminicern.a(hbook.f.o)
_hropen_ in libminicern.a(hbook.f.o)
_hldir_ in libminicern.a(hbook.f.o)
...
"__gfortran_concat_string", referenced from:
_ptname_ in g2root.f.o
_map_found_ in g2root.f.o
_volume_ in g2root.f.o
_node_ in g2root.f.o
_toroot_ in g2root.f.o
_MAIN__ in g2root.f.o
_hpaff_ in libminicern.a(hbook.f.o)
...
"__gfortran_getarg_i4", referenced from:
_MAIN__ in g2root.f.o
"__gfortran_iargc", referenced from:
_MAIN__ in g2root.f.o
"__gfortran_pow_i4_i4", referenced from:
_hmachi_ in libminicern.a(hbook.f.o)
"__gfortran_set_args", referenced from:
_main in g2root.f.o
"__gfortran_set_options", referenced from:
_main in g2root.f.o
"__gfortran_st_close", referenced from:
_toroot_ in g2root.f.o
_create_map_ in g2root.f.o
_hropen_ in libminicern.a(hbook.f.o)
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_st_inquire", referenced from:
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_st_open", referenced from:
_toroot_ in g2root.f.o
_create_map_ in g2root.f.o
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_st_read", referenced from:
_toreal_ in g2root.f.o
_create_map_ in g2root.f.o
_MAIN__ in g2root.f.o
_rziodo_ in libminicern.a(zebra.f.o)
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_st_read_done", referenced from:
_toreal_ in g2root.f.o
_create_map_ in g2root.f.o
_MAIN__ in g2root.f.o
_rziodo_ in libminicern.a(zebra.f.o)
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_st_write", referenced from:
_realname_ in g2root.f.o
_ptname_ in g2root.f.o
_toint_ in g2root.f.o
_markdiv_ in g2root.f.o
_toreal_ in g2root.f.o
_volume_ in g2root.f.o
_node_ in g2root.f.o
...
"__gfortran_st_write_done", referenced from:
_realname_ in g2root.f.o
_ptname_ in g2root.f.o
_toint_ in g2root.f.o
_markdiv_ in g2root.f.o
_toreal_ in g2root.f.o
_volume_ in g2root.f.o
_node_ in g2root.f.o
...
"__gfortran_string_index", referenced from:
_map_found_ in g2root.f.o
_toroot_ in g2root.f.o
_create_map_ in g2root.f.o
_MAIN__ in g2root.f.o
_uoptc_ in libminicern.a(kernlib.f.o)
_cfopen_ in libminicern.a(kernlib.f.o)
_hrfile_ in libminicern.a(hbook.f.o)
...
"__gfortran_string_len_trim", referenced from:
_realname_ in g2root.f.o
_ptname_ in g2root.f.o
_toint_ in g2root.f.o
_toreal_ in g2root.f.o
_toreal_old_ in g2root.f.o
_cfopen_ in libminicern.a(kernlib.f.o)
_cfstat_ in libminicern.a(kernlib.f.o)
...
"__gfortran_transfer_array", referenced from:
_rziodo_ in libminicern.a(zebra.f.o)
"__gfortran_transfer_array_write", referenced from:
_rziodo_ in libminicern.a(zebra.f.o)
_mzlink_ in libminicern.a(zebra.f.o)
"__gfortran_transfer_character", referenced from:
_create_map_ in g2root.f.o
"__gfortran_transfer_character_write", referenced from:
_realname_ in g2root.f.o
_ptname_ in g2root.f.o
_markdiv_ in g2root.f.o
_toreal_ in g2root.f.o
_volume_ in g2root.f.o
_node_ in g2root.f.o
_toroot_ in g2root.f.o
...
"__gfortran_transfer_integer", referenced from:
_MAIN__ in g2root.f.o
_rzopen_ in libminicern.a(zebra.f.o)
"__gfortran_transfer_integer_write", referenced from:
_toint_ in g2root.f.o
_markdiv_ in g2root.f.o
_node_ in g2root.f.o
_toroot_ in g2root.f.o
_g2rin_ in g2root.f.o
_create_map_ in g2root.f.o
_hldirt_ in libminicern.a(hbook.f.o)
...
"__gfortran_transfer_real", referenced from:
_toreal_ in g2root.f.o
"__gfortran_transfer_real_write", referenced from:
_toreal_ in g2root.f.o
_toroot_ in g2root.f.o
_toreal_old_ in g2root.f.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bin/g2root] Error 1
make[1]: *** [main/CMakeFiles/g2root.dir/all] Error 2
make: *** [all] Error 2
make: INTERNAL: Exiting with 21 jobserver tokens available; should be 20!
The command
$ gfortran -v
returns the following:
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/6.3.0_1/libexec/gcc/x86_64-apple-darwin16.3.0/6.3.0/lto-wrapper
Target: x86_64-apple-darwin16.3.0
Configured with: ../configure --build=x86_64-apple-darwin16.3.0 --prefix=/usr/local/Cellar/gcc/6.3.0_1 --libdir=/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-6 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew GCC 6.3.0_1' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 6.3.0 (Homebrew GCC 6.3.0_1)
How can I install it/what is the problem?
Thank you.