Issue of the installation on MacOS.

Issue #10 resolved
Former user created an issue

There is an error when execute "make" to compile main.cpp

../sources/main.cpp:452:110: error: braces around scalar initializer for type 'in_port_t {aka short unsigned int}' struct sockaddr_in serv_addr = {AF_INET, htons(common::port), {.s_addr = inet_addr("127.0.0.1")}, {}};

There is a difference of the declaration of struct "sockaddr_in" in MacOS,

struct sockaddr_in { __uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; };

Hope you can fix it. Thanks

Comments (28)

  1. Alexander Smirnov

    Hi. The thing is that

    • this is related to a part I do not recommend to use (launching on multiple computers with a tcp-ip connection) since the introduction of the MPI approach with modular arithmetics
    • it’s been completely removed in a private version

    I would recommend to get rid of this part of code at all. Not sure if I can get my hands to the public verision fast

  2. Sudeepan Datta

    Hi. I face the same problem after modifying the ./extra/kyotocabinet-1.2.77/kccommon.h file for proper compilation in the “make dep” stage. Can you be a bit more specific, as in, which parts of the code need to be changed/removed?

  3. Alexander Smirnov

    I removed the port option and related things (see the bugfix/mac_build branch). Please give it a try once more

  4. Sudeepan Datta

    I changed the 16 files as mentioned in that branch. The “make dep” worked out fine, but the “make” got stuck. I am providing a link to my dropbox file containing the error message, which I think is too long for this space (and I don’t know which part I should specifically focus on to shorten it).
    +“make” issue from bugfix/mac_build

  5. Alexander Smirnov

    I am afraid we need a MAC OS X expert here. The problem is not compilation, but linking and is related to libstdc++, so some flags in the linking command should be altered, but I have no idea how

  6. Alexander Smirnov

    You can google for whatever looking like

    Undefined symbols for architecture x86_64:

    "__ZNKSt5ctypeIcE13_M_widen_initEv"

  7. Alexander Smirnov

    would perhaps -lstdc++ help instead of -lc++ to link it

    Otherwise I still need a Mac expert, do you perhaps know any?

  8. Sudeepan Datta

    You were right. I just had to change -lc++ to -lstdc++ in the makefiles in the poly and prime subdirectories. I did this in the LFLAGS input in those makefiles, when ifeq ($(UNAME_S),Darwin) holds true, because we are in MacOS.

    Some details: Duplicated the Mac Terminal and enabled the duplicated version with Rosetta emulation, since it’s the new chip. Opened the Rosetta terminal, brew installed gcc-11 (and g++-11) to /usr/local/bin. Configured and built (all the steps, such as make dep) with CC=/usr/local/bin/gcc-11 and CXX=/usr/local/bin/g++-11. Set CPLUS_INCLUDE_PATH to /usr/local/include/c++/11/x86_64-apple-darwin21.

    For some reason, make test CC=/usr/local/bin/gcc-11 CXX=/usr/local/bin/g++-11 gives the following error:

    make -f tests.makefile
    rm -rf ./tests/db/*
    rm -rf ./tests/outputs/*
    rm -rf ./tests/hints/*
    rm -rf ./tests/storage/*
    
    make -f Makefile
    /Library/Developer/CommandLineTools/usr/bin/make -C ./poly
    make[3]: Nothing to be done for `default'.
    /Library/Developer/CommandLineTools/usr/bin/make -C ./prime
    make[3]: Nothing to be done for `default'.
    
    *** Basic test with global symmetries
    bin/FIRE6 -c ./tests/boxs > /dev/null
    Error: signal 11:
    Quick backtrace summary
    0   FIRE6                               0x00000001022cbbca _Z7handleri + 42
    1   ???                                 0x8000600001904120 0x0 + 9223477589997273376
    2   libstdc++.6.dylib                   0x000000010c101a25 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEmmPKcm + 213
    Detailed backtrace summary
    ^Cmake[1]: *** [boxs] Interrupt: 2
    gmake: *** [Makefile:21: test] Interrupt: 2
    

    I had to abort the run manually with ctrl-c.

  9. Alexander Smirnov

    I’ve committed the build change.

    Please provide the output of

    bin/FIRE6 -c examples/box

  10. Sudeepan Datta

    Here’s the output:

    > FIRE6 % bin/FIRE6 -c examples/box
    FIRE 6.4
    Error: signal 11:
    Quick backtrace summary
    0   FIRE6                               0x000000010416fbca _Z7handleri + 42
    1   ???                                 0x8000600000564040 0x0 + 9223477589976694848
    2   libstdc++.6.dylib                   0x000000010dfa6a25 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEmmPKcm + 213
    Detailed backtrace summary
    

  11. Alexander Smirnov

    Same problem, I see.

    I do not know. Perhaps some strange interaction of compilers or std libraries.

    What if you try to build everything with clang?

  12. Alexander Smirnov

    To be on the safe side I merged the dev branch with latest changes into bugfix/mac_build

    You can try to pull the latest changes, but I do nto beleive they will change anything, it is something mac-specific.

    However the changes in the bugfix/mac_build branch do not hurt the linux build anyway

  13. Sudeepan Datta

    I tested the merged branch on Mac. It fails building with both clang-clang++ and gcc-g++, both natively and via Rosetta emulation.

    Only the unmerged branch seems to work till the make step, but just with gcc-g++ on Rosetta.

    Tried the following combinations (all others stay commented in .zshrc when one is being used, here, I show them uncommented):

    #------------      NATIVE XCODE CLANG    ----------------
    #-------------  In .zshrc  -----------------
    export PATH="/Library/Developer/CommandLineTools/usr/bin:$PATH"
    export LIBRARY_PATH="/Library/Developer/CommandLineTools/usr/lib"
    export CPATH="/Library/Developer/CommandLineTools/usr/include"
    export CPLUS_INCLUDE_PATH="/Library/Developer/CommandLineTools/usr/include/c++/v1/"
    
    export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib"
    export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
    
    #-------------  In shell  -----------------
    ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_tcmalloc --enable_lthreads --disk_database --small_point CC=/Library/Developer/CommandLineTools/usr/bin/clang CXX=/Library/Developer/CommandLineTools/usr/bin/clang++
    make dep CC=/Library/Developer/CommandLineTools/usr/bin/clang CXX=/Library/Developer/CommandLineTools/usr/bin/clang++
    #--------------------------------------------------
    
    
    #------------       NATIVE GNU     ----------------- 
    #-------------  In .zshrc  -----------------
    export PATH="/opt/homebrew/bin:$PATH"
    export LIBRARY_PATH="/opt/homebrew/lib"
    export CPATH="/opt/homebrew/include"
    export CPLUS_INCLUDE_PATH="/opt/homebrew/include/c++/11/aarch64-apple-darwin21"
    
    export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib"
    export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
    
    #-------------  In shell  -----------------
    ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_tcmalloc --enable_lthreads --disk_database --small_point CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11
    make dep CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11
    #------------                      -----------------
    
    
    #------------    NATIVE LLVM CLANG    ------------------
    #-------------  In .zshrc  -----------------
    export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
    export LIBRARY_PATH="/opt/homebrew/opt/llvm/lib"
    export CPATH="/opt/homebrew/opt/llvm/include"
    export CPLUS_INCLUDE_PATH="/opt/homebrew/opt/llvm/include/c++/v1"
    
    export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib"
    export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
    
    #These lines always stay commented in my .zshrc
    #for bundled libc++
    #LDFLAGS="-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib"
    #for compilers to find llvm
    #export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
    #export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
    
    #-------------  In shell -----------------
    ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_tcmalloc --enable_lthreads --disk_database --small_point CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++
    make dep CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++
    #---------------------------------------------------
    
    
    #------------      ROSETTA GNU     -----------------
    #-------------  In .zshrc  -----------------
    export PATH="/usr/local/bin:$PATH"
    export LIBRARY_PATH="/usr/local/lib"
    export CPATH="/usr/local/include"
    export CPLUS_INCLUDE_PATH="/usr/local/include/c++/11/x86_64-apple-darwin21"
    export PKG_CONFIG_PATH="/usr/local/share/pkgconfig:$PKG_CONFIG_PATH"
    
    export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib"
    export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
    
    #-------------  In shell  -----------------
    ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_tcmalloc --enable_lthreads --disk_database --small_point CC=/usr/local/bin/gcc-11 CXX=/usr/local/bin/g++-11
    make dep CC=/usr/local/bin/gcc-11 CXX=/usr/local/bin/g++-11
    #---------------------------------------------------
    
    
    #------------  ROSETTA LLVM CLANG  ------------------
    #-------------  In .zshrc  -----------------
    export PATH="/usr/local/opt/llvm/bin:$PATH"
    export LIBRARY_PATH="/usr/local/opt/llvm/lib"
    export CPATH="/usr/local/opt/llvm/include"
    export CPLUS_INCLUDE_PATH="/usr/local/opt/llvm/include/c++/v1"
    
    export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib"
    export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
    export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
    
    #These lines always stay commented in my .zshrc
    #for bundled libc++
    # LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
    #for compilers to find llvm
    #export LDFLAGS="-L/usr/local/opt/llvm/lib"
    #export CPPFLAGS="-I/usr/local/opt/llvm/include"
    
    #-------------  In shell  -----------------
    ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_tcmalloc --enable_lthreads --disk_database --small_point CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++
    make dep CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++
    #---------------------------------------------------
    

    Native clang had about 20 errors like the following, due to a conflict of sizeof with size_t:

    /Library/Developer/CommandLineTools/usr/include/c++/v1/type_traits:1553:32: error: use of undeclared identifier 'size_t'; did you mean 'sizeof'?
        : public integral_constant<size_t, 0> {};
                                   ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/type_traits:1553:38: error: expected expression
        : public integral_constant<size_t, 0> {};
    

    Native llvm clang had the following error:

     /usr/bin/install -c -m 644 src/gperftools/malloc_hook.h src/gperftools/malloc_hook_c.h src/gperftools/malloc_extension.h src/gperftools/malloc_extension_c.h src/gperftools/nallocx.h '/Users/arya/All-Softwares/fire/FIRE6/extra/gperftools-2.7/../../usr/include/gperftools'
     ./install-sh -c -d '/Users/arya/All-Softwares/fire/FIRE6/extra/gperftools-2.7/../../usr/lib/pkgconfig'
     /usr/bin/install -c -m 644 libtcmalloc.pc libtcmalloc_minimal.pc libtcmalloc_debug.pc libtcmalloc_minimal_debug.pc libprofiler.pc '/Users/arya/All-Softwares/fire/FIRE6/extra/gperftools-2.7/../../usr/lib/pkgconfig'
    cp extra/FSBAllocator.hh usr/include/
    /Library/Developer/CommandLineTools/usr/bin/make -C ./extra/zstd-1.4.3
    make[2]: Nothing to be done for `lib-release'.
    ==> building with threading support
    ==> building zstd with .gz compression support
    ==> no liblzma, building zstd without .xz/.lzma support
    ==> no liblz4, building zstd without .lz4 support
    /opt/homebrew/opt/llvm/bin/clang -I../lib -I../lib/common -I../lib/compress -I../lib/dictBuilder -DXXH_NAMESPACE=ZSTD_ -I../lib/legacy -DZSTD_MULTITHREAD -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS   -DZSTD_LEGACY_SUPPORT=5 -O3 -DBACKTRACE_ENABLE=0  -pthread -lz    ../lib/common/debug.c ../lib/common/entropy_common.c ../lib/common/error_private.c ../lib/common/fse_decompress.c ../lib/common/pool.c ../lib/common/threading.c ../lib/common/xxhash.c ../lib/common/zstd_common.c ../lib/compress/fse_compress.c ../lib/compress/hist.c ../lib/compress/huf_compress.c ../lib/compress/zstd_compress.c ../lib/compress/zstd_compress_literals.c ../lib/compress/zstd_compress_sequences.c ../lib/compress/zstd_double_fast.c ../lib/compress/zstd_fast.c ../lib/compress/zstd_lazy.c ../lib/compress/zstd_ldm.c ../lib/compress/zstd_opt.c ../lib/compress/zstdmt_compress.c ../lib/decompress/huf_decompress.c ../lib/decompress/zstd_ddict.c ../lib/decompress/zstd_decompress.c ../lib/decompress/zstd_decompress_block.c ../lib/dictBuilder/cover.c ../lib/dictBuilder/divsufsort.c ../lib/dictBuilder/fastcover.c ../lib/dictBuilder/zdict.c ../lib/legacy/zstd_v05.c ../lib/legacy/zstd_v06.c ../lib/legacy/zstd_v07.c zstdcli.o util.o timefn.o fileio.o benchfn.o benchzstd.o datagen.o dibio.o  -o zstd -pthread -lz   
    Undefined symbols for architecture arm64:
      "_lzma_alone_decoder", referenced from:
          _FIO_decompressSrcFile in fileio.o
      "_lzma_alone_encoder", referenced from:
          _FIO_compressFilename_srcFile in fileio.o
      "_lzma_code", referenced from:
          _FIO_compressFilename_srcFile in fileio.o
          _FIO_decompressSrcFile in fileio.o
      "_lzma_easy_encoder", referenced from:
          _FIO_compressFilename_srcFile in fileio.o
      "_lzma_end", referenced from:
          _FIO_compressFilename_srcFile in fileio.o
          _FIO_decompressSrcFile in fileio.o
      "_lzma_lzma_preset", referenced from:
          _FIO_compressFilename_srcFile in fileio.o
      "_lzma_stream_decoder", referenced from:
          _FIO_decompressSrcFile in fileio.o
    ld: symbol(s) not found for architecture arm64
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [zstd] Error 1
    make[1]: *** [zstd-release] Error 2
    make: *** [depend] Error 2
    

    Native GNU, Rosetta clang, and Rosetta GNU had similar (not exactly same) errors with linking, because of libtcmalloc_minimal.la.

    Native GNU error msg:

    libtool: link: /opt/homebrew/bin/g++-11 -dynamiclib  -o .libs/libtcmalloc_minimal.4.dylib  src/.libs/libtcmalloc_minimal_la-tcmalloc.o   -Wl,-force_load,./.libs/libtcmalloc_minimal_internal.a   -g -O2   -install_name  /Users/arya/All-Softwares/fire/FIRE6/extra/gperftools-2.7/../../usr/lib/libtcmalloc_minimal.4.dylib -compatibility_version 10 -current_version 10.3 -Wl,-single_module
    Undefined symbols for architecture arm64:
    .
    . (I am not showing the entire msg here)
    .
    ld: symbol(s) not found for architecture arm64
    collect2: error: ld returned 1 exit status
    make[1]: *** [libtcmalloc_minimal.la] Error 1
    make: *** [depend] Error 2
    

    Rosetta clang error msg:

    libtool: link: /usr/local/opt/llvm/bin/clang++ -dynamiclib  -o .libs/libtcmalloc_minimal.4.dylib  src/.libs/libtcmalloc_minimal_la-tcmalloc.o   -Wl,-force_load,./.libs/libtcmalloc_minimal_internal.a   -g -O2   -install_name  /Users/arya/All-Softwares/fire/FIRE6/extra/gperftools-2.7/../../usr/lib/libtcmalloc_minimal.4.dylib -compatibility_version 10 -current_version 10.3 -Wl,-single_module
    ld: warning: ignoring file ./.libs/libtcmalloc_minimal_internal.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
    Undefined symbols for architecture x86_64:
    .
    .(I am not showing the entire msg here)
    .
    ld: symbol(s) not found for architecture x86_64
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [libtcmalloc_minimal.la] Error 1
    make: *** [depend] Error 2
    

    P.S, while checking the dev branch on linux, bin/FIRE6 -c ./tests/lbases throws the following error:

    FIRE 6.4
    Path: /home/octaquark/All-Softwares/HEPTools/fire/FIRE6/bin/
    Version: 77afa21 Merged in feature/litered_upgrade (pull request #16)
    Threads: 4
    Fermat: 4
    Bucket: 16 for sector databases
    Compressor: lz4
    Database path: tests/db
    Temporary directory exists
    Deleting file "wrapper.kch"
    Deleting file "0018.kch"
    Using database wrapping to a single file
    Tables will be saved to tests/v2/../outputs/lbases.tables
    Empty file tests/db/0018.tmp
    Error: signal 6:
    Quick backtrace summary
    bin/FIRE6(_Z7handleri+0x41)[0x56197aeb7a01]
    /lib/x86_64-linux-gnu/libc.so.6(+0x430c0)[0x7f882285f0c0]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f882285f03b]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f882283e859]
    bin/FIRE6(_Z24database_to_file_or_backibb+0x6df)[0x56197ae82ecf]
    bin/FIRE6(main+0x44a)[0x56197ae3b28a]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f88228400b3]
    bin/FIRE6(_start+0x2e)[0x56197ae3d92e]
    Detailed backtrace summary
    [bt] Execution path:
    [bt] #1 /lib/x86_64-linux-gnu/libc.so.6(+0x430c0) [0x7f882285f0c0]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #2 /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7f882285f03b]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #3 /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b) [0x7f882283e859]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #4 bin/FIRE6(_Z24database_to_file_or_backibb+0x6df) [0x56197ae82ecf]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #5 bin/FIRE6(main+0x44a) [0x56197ae3b28a]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #6 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f88228400b3]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    [bt] #7 bin/FIRE6(_start+0x2e) [0x56197ae3d92e]
    sh: 1: eu-addr2line: not found
    eu-addr2line provided no information for this frame 
    Aborted (core dumped)
    

  14. Alexander Smirnov

    I see most error are about tcmalloc. Perhaps configure it without --enable-tcmalloc? It is needed only for extreme optimization.

    P.S, while checking the dev branch on linux, bin/FIRE6 -c ./tests/lbases throws the following error:

    That’s strange. Perhaps install eu-addr2line (on Ubuntu that’s apt-get install elfutils) and provide the output after that.

  15. Sudeepan Datta

    Installing elfutils got rid of the earlier error message, but it got stuck here.

    bin/FIRE6 -c ./tests/lbases
    FIRE 6.4
    Path: /home/sudeepan/All-Softwares/mathematica/mathematica-softwares/ibp/fire/FIRE6/bin/
    Version: 77afa21 Merged in feature/litered_upgrade (pull request #16)
    Threads: 4
    Fermat: 4
    Bucket: 16 for sector databases
    Compressor: lz4
    Database path: tests/db
    Temporary directory exists
    Deleting file "0018.kch"
    Deleting file "wrapper.kch"
    Using database wrapping to a single file
    Tables will be saved to tests/v2/../outputs/lbases.tables
    Empty file tests/db/0018.tmp
    Error: signal 6:
    Quick backtrace summary
    bin/FIRE6(_Z7handleri+0x40)[0x5587df348640]
    /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f0ddf250520]
    /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7f0ddf2a4a7c]
    /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7f0ddf250476]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7f0ddf2367f3]
    bin/FIRE6(_Z24database_to_file_or_backibb+0x6bb)[0x5587df3148cb]
    bin/FIRE6(main+0x48b)[0x5587df2ce58b]
    /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f0ddf237d90]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f0ddf237e40]
    bin/FIRE6(_start+0x25)[0x5587df2d0a15]
    Detailed backtrace summary
    [bt] Execution path:
    [bt] #1 /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f0ddf250520]
    __restore_rt
    ??:0
    [bt] #2 /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c) [0x7f0ddf2a4a7c]
    __pthread_kill_implementation inlined at ./nptl/pthread_kill.c:78:10 in pthread_kill@@GLIBC_2.34
    ./nptl/pthread_kill.c:44:76
    __pthread_kill_internal
    ./nptl/pthread_kill.c:78:10
    __GI___pthread_kill
    ./nptl/pthread_kill.c:89:10
    [bt] #3 /lib/x86_64-linux-gnu/libc.so.6(raise+0x16) [0x7f0ddf250476]
    __GI_raise
    ../sysdeps/posix/raise.c:27:6
    [bt] #4 /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3) [0x7f0ddf2367f3]
    __GI_abort
    ./stdlib/abort.c:81:7
    [bt] #5 bin/FIRE6(_Z24database_to_file_or_backibb+0x6bb) [0x5587df3148cb]
    _Z24database_to_file_or_backibb
    ../sources/common.cpp:544:22
    [bt] #6 bin/FIRE6(main+0x48b) [0x5587df2ce58b]
    _ZNSt6vectorISt4pairI5point5COEFFESaIS3_EED4Ev inlined at ../sources/main.cpp:223:5 in main
    /usr/include/c++/11/bits/stl_vector.h:680:15
    main
    ../sources/main.cpp:223:5
    [bt] #7 /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f0ddf237d90]
    __libc_start_call_main
    ../sysdeps/nptl/libc_start_call_main.h:58:16
    [bt] #8 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f0ddf237e40]
    call_init inlined at ../csu/libc-start.c:379:5 in __libc_start_main@@GLIBC_2.34
    ../csu/libc-start.c:128:20
    __libc_start_main_impl
    ../csu/libc-start.c:379:5
    [bt] #9 bin/FIRE6(_start+0x25) [0x5587df2d0a15]
    _start
    ??:0
    Aborted (core dumped)
    

    It turned out that the issue is caused by turning on the --disk_database flag in the configure step. Everything works when it's turned off, even without elfutils installed.

    On pg. 23 of https://arxiv.org/pdf/1901.07808.pdf, at the bottom, the following has been written:

    FIRE6 has two ways to work with databases, the disk mode (default) and
    the memory mode (turned on by the #memory setting). In the default mode
    FIRE uses disk databases which are open by sector jobs or the master job for
    data transfer. In the other case on-memory databases are used, and their
    snapshots are saved to disk when work in the sector is done.

    If the disk mode is the default setting, what's the use of this flag? Or do these serve separate purposes?

    I shall check the tcmalloc issue on Mac in the morning.

  16. Alexander Smirnov

    The #memory option is gone, now it depends on the configure option.

    The similarity of two errors leads to an undersanding that somehow kyotocabinet::HashDB is broken on your computer - it is used in those two cases

    I wonder if the #nolock option will make is work with --disk-database?

    (not in the test of wrap_database, but I can add it if it is the solution)

  17. Sudeepan Datta

    I configured again with --disk-database turned on, and put in the #nolock option in tests/lbases.config, between the #database and #start lines. The elfutils issue reappears, and after installing it, the other issue reappears.

    The only change in this new error message (post elfutils) seems to be the message on line 8.

    bin/FIRE6 -c ./tests/lbases
    FIRE 6.4
    Path: /home/sudeepan/All-Softwares/mathematica/mathematica-softwares/ibp/fire/FIRE6/bin/
    Version: 77afa21 Merged in feature/litered_upgrade (pull request #16)
    Threads: 4
    Fermat: 4
    Bucket: 16 for sector databases
    The database will not be locked
    Compressor: lz4
    Database path: tests/db
    Temporary directory exists
    Deleting file "0018.kch"
    Deleting file "wrapper.kch"
    Using database wrapping to a single file
    Tables will be saved to tests/v2/../outputs/lbases.tables
    Empty file tests/db/0018.tmp
    Error: signal 6:
    Quick backtrace summary
    bin/FIRE6(_Z7handleri+0x40)[0x55dcf359b640]
    /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ff6a4af6520]
    /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7ff6a4b4aa7c]
    /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7ff6a4af6476]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7ff6a4adc7f3]
    bin/FIRE6(_Z24database_to_file_or_backibb+0x6bb)[0x55dcf35678cb]
    bin/FIRE6(main+0x48b)[0x55dcf352158b]
    /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7ff6a4addd90]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7ff6a4adde40]
    bin/FIRE6(_start+0x25)[0x55dcf3523a15]
    Detailed backtrace summary
    [bt] Execution path:
    [bt] #1 /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7ff6a4af6520]
    __restore_rt
    ??:0
    [bt] #2 /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c) [0x7ff6a4b4aa7c]
    __pthread_kill_implementation inlined at ./nptl/pthread_kill.c:78:10 in pthread_kill@@GLIBC_2.34
    ./nptl/pthread_kill.c:44:76
    __pthread_kill_internal
    ./nptl/pthread_kill.c:78:10
    __GI___pthread_kill
    ./nptl/pthread_kill.c:89:10
    [bt] #3 /lib/x86_64-linux-gnu/libc.so.6(raise+0x16) [0x7ff6a4af6476]
    __GI_raise
    ../sysdeps/posix/raise.c:27:6
    [bt] #4 /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3) [0x7ff6a4adc7f3]
    __GI_abort
    ./stdlib/abort.c:81:7
    [bt] #5 bin/FIRE6(_Z24database_to_file_or_backibb+0x6bb) [0x55dcf35678cb]
    _Z24database_to_file_or_backibb
    ../sources/common.cpp:544:22
    [bt] #6 bin/FIRE6(main+0x48b) [0x55dcf352158b]
    _ZNSt6vectorISt4pairI5point5COEFFESaIS3_EED4Ev inlined at ../sources/main.cpp:223:5 in main
    /usr/include/c++/11/bits/stl_vector.h:680:15
    main
    ../sources/main.cpp:223:5
    [bt] #7 /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ff6a4addd90]
    __libc_start_call_main
    ../sysdeps/nptl/libc_start_call_main.h:58:16
    [bt] #8 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ff6a4adde40]
    call_init inlined at ../csu/libc-start.c:379:5 in __libc_start_main@@GLIBC_2.34
    ../csu/libc-start.c:128:20
    __libc_start_main_impl
    ../csu/libc-start.c:379:5
    [bt] #9 bin/FIRE6(_start+0x25) [0x55dcf3523a15]
    _start
    ??:0
    Aborted (core dumped)
    

  18. Alexander Smirnov
    1. elfutils is simply a tool to provide more information when FIRE crashes. Its absense is not the reason why it crashes
    2. I found the error and fixed it I think, will push a commit soon. The disk-database mode and the wrapper database were indeed incompatible. However I would advise not to use the disk-database mode

  19. Sudeepan Datta

    Turning off tcmalloc on mac in configure throws the following error during make dep

    gperftools-2.7/ && ./configure --enable-minimal --prefix=`pwd`/../../usr///snappy-1.1.7/ && mkdir -p build && cd build && cmake ../
    /bin/sh: gperftools-2.7/: No such file or directory
    make: *** [depend] Error 127
    

    I found the error and fixed it I think, will push a commit soon. The disk-database mode and the wrapper database were indeed incompatible. However I would advise not to use the disk-database mode

    Thanks

  20. Alexander Smirnov

    I committed a change that I expect should fix it.

    The reason is withing different ways Linux and Max treat replacement patterns from bash.

    Do not forget to run ./configure with options before rebuilding

  21. Sudeepan Datta

    Yes. Everything works this time. I have checked with the Rosetta GNU compilers. The others still have some linking issues, but I guess Rosetta should be sufficient for most purposes.

  22. Alexander Smirnov

    Do you mean that finally it works (aside from tcmalloc)?

    Could you please provide some instructions for a user willing to install in on a Mac?

  23. Sudeepan Datta

    Yes, leaving out --enable_tcmalloc in the configure step resolves it.

    Here are the steps:

    1. Install Xcode Commandline Tools: xcode-select --install
    2. Install homebrew native: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    3. Right-click on Terminal.app located in /Applications/Utilities, click on “Duplicate” in the pop-down menu, and enable the duplicate copy with Rosetta. Rename it for convenience; I renamed it as Rosetta.app.
    4. Open this duplicate, and install homebrew as Rosetta: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    5. Set the following aliases in your ~/.zshrc:

      alias ibrew='arch -x86_64 /usr/local/bin/brew'
      alias mbrew='arch -arm64e /opt/homebrew/bin/brew'

    6. The default brew would always correspond to the native homebrew, so in a sense, mbrew is redundant, but still better to have it explicitly mentioned in ~/.zshrc for consistency.

    7. ibrew install gcc in the Rosetta terminal (or in the native terminal) would install the GNU compiler binaries and libraries in the usual directories under/usr/local, as is the case in linux and the previous x86-64 Macs. brew install gcc (or mbrew install gcc) would install them in directories located under /opt/homebrew.
    8. Set the relevant environment variables. For me, they are set as follows:

      export PATH="/usr/local/bin:$PATH" && export LIBRARY_PATH="/usr/local/lib" && export CPATH="/usr/local/include" && export CPLUS_INCLUDE_PATH="/usr/local/include/c++/11/x86_64-apple-darwin21" && export PKG_CONFIG_PATH="/usr/local/share/pkgconfig:$PKG_CONFIG_PATH" && export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib" && export DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH" && export CMAKE_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"

    9. Clone the repo and enter fire/FIRE6, enable whatever you want in configure save for tcmalloc:

      ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_lthreads --disk_database --small_point

    10. Build everything with these CC and CXX flags:

      make dep CC=/usr/local/bin/gcc-11 CXX=/usr/local/bin/g++-11 && make CC=/usr/local/bin/gcc-11 CXX=/usr/local/bin/g++-11 && make test

  24. Alexander Smirnov

    Thank you. I put the link to instructions in README and am merging this branch. Will also produce a numbered version today with all the changes

  25. Sophie

    Thanks for the contribution. Could you please take a look at my MacOS installation-related issues? I’m pretty new to programming, if some of the questions below are not well structured, please forgive me. For what it’s worth, I’ve added a link to the output of my macOS to the commands: configure, make dep, make, make test, bin/FIRE6 -c examples/box, respectively: https://bitbucket.org/sophiehep/workspace/snippets/5XnX78

    First of all, I had homebrew, xcode-select and gcc installed.

    I’ve changed the 23 files manually as suggested in https://bitbucket.org/feynmanIntegrals/fire/pull-requests/17/bugfix-mac-build. I was wondering if there is a way to pull the changed files out automatically?

    I used bash instead of zsh, I’m not sure if it would affect my installation if I followed the steps as listed by Sudeepan Datta. I didn’t have the .zshrc at /~, instead, I had .bash_profile and .bashrc.

    I had an older mac system (2018 MacBook Pro with macOS Big Sur) without M1 chips and the Rosetta. app isn’t available on my computer in the 2ed step.

    Could you give more instructions on the environment setup? I don’t know how to set up the correct environment variables related to my computer. I checked Sudeepan Datta’s path, I had all the directories listed except for this one: export LD_LIBRARY_PATH="$LIBRARY_PATH:/Applications/Macaulay2-1.19.1/lib, I don’t know if I could leave out this path. But if I leave out this, DYLD_LIBRARY_PATH="$LD_LIBRARY_PATH" wouldn’t make much sense. Finally, If I have all the paths right, do I copy and paste them into the .zshrc file? (or in my case, into bash_profile or .bashrc files instead?).

    I did try setting the environment variables the same as Sudeepan Datta’s temporarily, leaving the LD_LIBRARY_PATH and the DYLD_LIBRARY_PATH, after make cleandep and make clean. I installed it again, and here is the output.

    https://bitbucket.org/sophiehep/workspace/snippets/Lpxp75

    it seems to work now. Thank you for reading this through. I’ll post it in case someone has the same problem.

  26. Sudeepan Datta

    Hi Sophie,

    1) You can clone from the master branch itself, since all of the modifications that were made in bugfix/mac_build branch have now been committed to master.
    For an automated way to pull the content from a specific branch, use either of the following:
    git clone -b <branchname> <remote-repo-url>
    or
    git clone -b <branchname> --single-branch <remote-repo-url>
    Refer to this link for more details.

    2) It seems that zsh was introduced as the default shell on Mac since 2019 models. The curious thing is that Big Sur is a later version than Catalina (the one that was in the 2019 models, where zsh was introduced as default shell). Not clear to me whether the default shell setting depends on the OS or something else. Maybe at the time of OS upgrade, it prompts the user if they would like to change their default shell or something, Idk. But whatever the case might be, for our purposes, it should not matter much what shell we use.

    Edit: Just figured out that the default shell change occurs only when new accounts are created on Catalina or later versions (refer to “Is bash gone!?” section in the previous link). So if you are working in an account created before the Catalina upgrade, bash would continue as your default shell.

    3) Macaulay2 is a nice computer algebra system with very good functionalities for computational commutative algebra and computational algebraic geometry. There are some use cases of it in the context of analytical studies of Feynman integrals, so I have it installed on my system. While custom setting my library paths, I found out that by default, its libraries are set in the LD_LIBRARY_PATH environment variable. And for some other softwares like FiniteFlow, things work (at least for me) when their libraries are set under the LIBRARY_PATH env variable. So I thought that adding the contents ofLIBRARY_PATHto LD_LIBRARY_PATH won’t hurt much. A lucky guess perhaps, alongside trial and error.

    Also, most of the time, one sets the LD_LIBRARY_PATH when libraries have been installed in a non-standard location on Linux systems like Ubuntu or CentOS. That is because usually, one uses dynamic linking with libraries instead of static linking. These two answers explain the issue in some details: https://stackoverflow.com/a/4250666/8756093, https://stackoverflow.com/a/30186852/8756093

    Afaik, DYLD_LIBRARY_PATH is exclusive to Mac, and has a similar functionality as what LD_LIBRARY_PATH has on Linux. That is somewhat confusing for me, since had that been the case, I would (maybe erroneously) expect the location of the Macaulay libraries to be set by DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH by default. I am not much accustomed to using it myself, but left it in my .zshrc as a just-in-case option. Maybe the compilation on my device would work out as usual even if I left out setting it.

    And yes, once you have set up your environments, add them to your ~/.bashrc, else those settings are lost once you quit the current shell session.

    Hope this helps.

  27. Sudeepan Datta

    Update: as of 4th Jan 2023, on MacOS 13.1 and XCode 14.2 (Build version 14C18), I have been able to successfully install FIRE6 using the dev branch (shall check master soon). Rosetta is still a necessity. tcmalloc should be avoided. Installation is very simple:

    1) Open a terminal, type in arch -x86_64 zsh to enable Rosetta. The Terminal app can no longer be duplicated on Ventura, thus this hack. Or even better, use this idea: https://stackoverflow.com/a/74531940/8756093

    2) Clone the dev branch. Enter fire/FIRE6.

    3) Configure everything except tcmalloc with ./configure --enable_zlib --enable_snappy --enable_zstd --enable_debug --enable_lthreads --disk_database --small_point --enable_math_diff --cc=/usr/local/bin/gcc-12 --cpp=/usr/local/bin/g++-12 The x86-64 GNU compilers have been installed using homebrew.

    4) Build with the usual make dep && make, test with make test.

  28. Alexander Smirnov

    Dear Sudeepan, thank you for information.

    I will try to include this into readme when I get myu hands to updating the master branch

  29. Log in to comment