Skip to content

OSX: use *.dylib for lib extension not *.so #153

Closed

Description

@gaming-hacker

All,

OSX uses *.dylib for shared libraries not *.so. Please fix your makefile.
currently

BLIS_DLL_NAME := $(BLIS_LIB_BASE_NAME).so

easy fix
OSX := $(shell uname)
ifeq ($(OSX),Darwin)
BLIS_DLL_NAME := $(BLIS_LIB_BASE_NAME).dylib
else
BLIS_DLL_NAME := $(BLIS_LIB_BASE_NAME).so
endif

Thanks.

Activity

  1. devinamatthews commented on Nov 7, 2017

    @devinamatthews
    Member

    .so files (at least the ways BLIS builds them) work fine on OSX on all versions that I have tested. True this would probably be an easy fix but nothing is actually broken at the moment. As an example I linked the testsuite with libblis.so no problem:

    [dmatthews@Devin's iMac release]$rm lib/haswell/libblis.a
    [dmatthews@Devin's iMac release]$gcc -o test_libblis.x obj/haswell/testsuite/*.o -Llib/haswell -lblis
    [dmatthews@Devin's iMac release]$otool -L ./test_libblis.x 
    ./test_libblis.x:
    	lib/haswell/libblis.so (compatibility version 0.0.0, current version 0.0.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    	/usr/local/lib/gcc/7/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    [dmatthews@Devin's iMac release]$otool -hv lib/haswell/libblis.so 
    Mach header
          magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
    MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    14       1984   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS
    
  2. gaming-hacker commented on Nov 8, 2017

    @gaming-hacker
    Author

    you can theoretically use whatever extension you like but using *.so will break most default OSX builds link to the lib as the default search pattern is *.dylib especially when using a cross compiler builds from osx <> linux <> bsd <> arm. *.so is typically a linux or bsd variant not osx. you CAN use *.so on windows as well but see if a generic build that expects to link to a standard lib finds it versus *.dll

    see how openblas builds their code.

    this is common practice, if you want this to be really accepted into the OSX ecosystem. i'm just benchmarking this against openblas and atlas so I will hack my own fork to make it work and tune the Makefile for my own needs.

  3. fgvanzee commented on May 12, 2018

    @fgvanzee
    Member

    @gaming-hacker This issue has been addressed in af1d847. Thanks for your patience, and sorry it took us so long to get around to this.

    Please give it a try and let us know if the changes are satisfactory.

    EDIT: I'm closing the issue for now. We can reopen it if it needs further attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions