adokter / hlhdf

fork from git://git.baltrad.eu/hlhdf.git
Other
0 stars 0 forks source link

Installing hlhdf on Mac OSX #1

Open adokter opened 8 years ago

adokter commented 8 years ago

Instead of using node-installer, I found it to be easier to install RAVE from git directly, as documented in the wiki

On Mac OSX, one edit needed to be made in the package directory of hlhdf: the file def.mk in the root directory of the hlhdf package, the LDSHARED variable had to be changed from -bundle into -dynamiclib. Anders, could the make script be adjusted to make this happen automatically (just like other OSX-specific checks)

adokter commented 8 years ago

Anders: This is not something we are currently supporting. Node-installer has been developed for linux. I maybe could do something about it later on but I have serious problems testing the compability :)

adokter commented 8 years ago

We need to make a patch ourselves, and send the commits to Anders as a diff

adokter commented 8 years ago

This patch on configure.ac in the hlhdf repo works for @adokter:

--- OLDconfigure.ac 2016-06-02 00:43:47.000000000 +0200
+++ configure.ac    2016-06-02 01:00:28.000000000 +0200
@@ -272,6 +272,13 @@
   else
     PYLDSHARED=`cat $PY_CONFIG_MAKE | sed -n "/^LDSHARED=/p" | sed -n -e"s/^LDSHARED=[[   ]]*\(.*\)/\1/p"`
   fi
+
+  case $ac_sys_system/$ac_sys_release in
+      Darwin/*)
+      PYLDSHARED=`echo $PYLDSHARED | sed "s/bundle/dynamiclib/"`
+      ;;
+  esac
+
   AC_MSG_RESULT($PYLDSHARED)

   AC_MSG_CHECKING(for ccshared)
@@ -337,7 +344,7 @@
       fi 
       ;;
     Darwin/*)
-      PYLDSHARED='$(CC) $(LDFLAGS) -bundle'
+      PYLDSHARED='$(CC) $(LDFLAGS) -dynamiclib'
       ;;
     Linux*|GNU*|QNX*)
       PYLDSHARED='$(CC) -shared'

Patch generated by running:

diff -Naur OLDconfigure.ac configure.ac > configure.ac.patch
adokter commented 8 years ago

otool -hv libhlhdf.so gives:

libhlhdf.so:
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    14       1648   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS

i.e. it's a DYLIB (which usually as an extension .dylib instead of .so

See also http://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx