sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
107 stars 63 forks source link

Dumb question - default architecture mismatch? #184

Closed hgrw closed 1 year ago

hgrw commented 1 year ago

OS & Arch - ubuntu 22, amd64, x86

I'm following steps in documentation to build and install libs. I am using a pretty fresh ubuntu 22 install. Everything default. Unexpectedly, the LSL toolchain defaults to i386 instead of amd64. This happens regardless of whether I use LSL-provided toolchain...There is something fundamental I'm missing here. Since I'm using Ninja, and the docs specify visual studio, I don't need to use the -A flag, and I can see that the generated files match my architecture. Nonetheless, resultant .so are 32 bit arch. Is this the default behaviour of the project, or is it something to do with my build setup?

Steps

  1. git clone --depth=1 https://github.com/sccn/liblsl.git
  2. cd liblsl && cmake -S . -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/LSLCMake.cmake. Confirm detected architecture: amd64, as below:
    -- The C compiler identification is GNU 11.3.0
    -- The CXX compiler identification is GNU 11.3.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Using bundled pugixml
    -- Found Git: /usr/bin/git (found version "2.34.1") 
    fatal: No names found, cannot describe anything.
    -- Git version information: master/
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE  
    -- Using bundled Boost
    -- Looking for clock_gettime
    -- Looking for clock_gettime - found
    -- Included LSL CMake helpers, rev. 15, /home/mars/git/liblsl/cmake
    -- Detected architecture: amd64
    -- Installing Components: liblsl
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/mars/git/liblsl/build
  3. Install sudo cmake --build build -j --config Release --target install. Lib installed as expected:
    -- Install configuration: ""
    -- Installing: /usr/local/lib/liblsl.so.1.16.0
    -- Up-to-date: /usr/local/lib/liblsl.so.2
    -- Up-to-date: /usr/local/lib/liblsl.so
    -- Installing: /usr/local/lib/cmake/LSL/LSLTargets.cmake
    -- Installing: /usr/local/lib/cmake/LSL/LSLTargets-noconfig.cmake
    -- Up-to-date: /usr/local/include
    -- Up-to-date: /usr/local/include/lsl_cpp.h
    -- Up-to-date: /usr/local/include/lsl_c.h
    -- Up-to-date: /usr/local/include/lsl
    -- Up-to-date: /usr/local/include/lsl/resolver.h
    -- Up-to-date: /usr/local/include/lsl/streaminfo.h
    -- Up-to-date: /usr/local/include/lsl/xml.h
    -- Up-to-date: /usr/local/include/lsl/types.h
    -- Up-to-date: /usr/local/include/lsl/common.h
    -- Up-to-date: /usr/local/include/lsl/outlet.h
    -- Up-to-date: /usr/local/include/lsl/inlet.h
    -- Up-to-date: /usr/local/lib/cmake/LSL/LSLCMake.cmake
    -- Installing: /usr/local/lib/cmake/LSL/LSLConfig.cmake
    -- Installing: /usr/local/lib/cmake/LSL/LSLConfigVersion.cmake
    -- Installing: /usr/local/bin/lslver
    -- Set runtime path of "/usr/local/bin/lslver" to "$ORIGIN:$ORIGIN/../lib"
  4. Check architecture objdump -f /usr/local/lib/liblsl.so
    /usr/local/lib/liblsl.so:     file format elf64-x86-64
    architecture: i386:x86-64, flags 0x00000150:
    HAS_SYMS, DYNAMIC, D_PAGED
    start address 0x0000000000000000
tstenner commented 1 year ago

Two things:

hgrw commented 1 year ago

Ah, great. Thanks!