Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libNexus.a for Mac OsX 10.11 El Capitan #455

Open
skansen76 opened this issue Dec 21, 2017 · 5 comments
Open

libNexus.a for Mac OsX 10.11 El Capitan #455

skansen76 opened this issue Dec 21, 2017 · 5 comments

Comments

@skansen76
Copy link

I was using a fortran software on my Mac that requires the libNexus.a and libNexus77.a libraries.
After upgrading from os X 10.6 to 10.11 it does compile, but when I load the data it crashes when it load the data, suggesting that it might have to do with the fact that I use the old libNexus.a and libNexus77.a libraries which needs then to be recompiled for the 10.11...
With my very poor programming skills I was trying to recompile the libraries, but I miserably failed.
I was wondering if anybody has succeeded with compiling them on osX 10.11.
Thanks,
Valerio

@prjemian
Copy link
Contributor

prjemian commented Dec 21, 2017 via email

@skansen76
Copy link
Author

Hi,
thanks for your help.
Maybe before going the errors, I need to know if I have just to run the run build_mac_kit.sh
or something else must be done like in README.rst (somehow not really straightforward for me).
If I try to run build_mac_kit.sh I get the following output:
bash-3.2$ ./build_mac_kit.sh
Removing old package root (require root privileges)
Building NeXus
make: *** No rule to make target distclean'. Stop. env: ./configure: No such file or directory ciao make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target install'. Stop.
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
./build_mac_kit.sh: line 29: pkg.config: No such file or directory

if I put ./ pkg.config instead of . pkg.config
then I get the error:
bash-3.2$ sudo ./build_mac_kit.sh
Removing old package root (require root privileges)
Building NeXus
make: *** No rule to make target distclean'. Stop. env: ./configure: No such file or directory ciao make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target install'. Stop.
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
Building the package (requires root to set permissions)
need to create package_root and Resources
Building the disk image
du: .pkg: No such file or directory
................................................................................................................
created: /tmp/dmgpack54425.dmg
Initialized /dev/rdisk3 as a 4 MB case-insensitive HFS Plus volume
ditto: can't get real path for source '.pkg'
"disk3" unmounted.
"disk3" ejected.
rm: illegal option -- .
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
Preparing imaging engineâ¦
Reading whole disk (Apple_HFS : 0)â¦

hdiutil: convert failed - File exists
Enabling internet install
hdiutil: internet-enable: enable succeeded
Cleaning NeXus build (as we configured without dependency tracing)
make: *** No rule to make target `distclean'. Stop.
Removing temporary files (requires root to clear)

This is the file build_mac_kit.sh

#!/bin/sh

at the moment hdf4 only support -arch i386 -arch ppc

and nexus tests fail if hdf5 is build with -arch x86_64 -arch ppc64

so leave as just "-arch i386 -arch ppc" for the moment

echo "Removing old package root (require root privileges)"
test -d package_root && sudo rm -fr package_root

cd ..
echo "Building NeXus"
make distclean # needed as we disable dependency tracking
arch_flags="-arch i386 -arch ppc"
export MACOSX_DEPLOYMENT_TARGET=10.11
env CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $arch_flags"
CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $arch_flags"
LDFLAGS="-Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk $arch_flags"
./configure --with-hdf4=/sinqsw/code-master/macosx_install_kit/hdf4.2r4
--with-hdf5=/sinqsw/code-master/macosx_install_kit/hdf5-1.8.2 --with-python
--disable-dependency-tracking
echo "ciao"
make
make install DESTDIR=pwd/macosx_install_kit/package_root
cp InstallerBits/Licences/*.txt macosx_install_kit/package_root/usr/local/share/nexus

cd macosx_install_kit

Use pkg.config to fetch the package name and version number

./pkg.config
rm -rf "$PACKAGE.pkg" "$PACKAGE-$VERSION$RELEASE"

cp ../NEWS Resources/English.lproj/ReadMe.txt

echo "Building the package (requires root to set permissions)"
ROOT=package_root bin/makepkg.sh pkg.config

echo "Building the disk image"
bin/dmgpack.sh "$PACKAGE-$VERSION$RELEASE" ReadMe.txt "$PACKAGE.pkg"

echo "Enabling internet install"
hdiutil internet-enable -yes "$PACKAGE-$VERSION$RELEASE.dmg"

echo "Cleaning NeXus build (as we configured without dependency tracing)"
( cd ..; make distclean; ) > /dev/null

echo "Removing temporary files (requires root to clear)"
#sudo rm -fr package_root
#rm -rf "$PACKAGE.pkg"

@zjttoefs
Copy link
Contributor

zjttoefs commented Jan 9, 2018

Sorry for the delay in replying. You suspicion that build_mac_kit.sh isn't the way to go is right. That is out of date (using the old build system) and would generate a dmg for distribution.

I see no reason why you should not be able to follow the Linux instructions, with cmake etc. We should update the README, I guess.

@prjemian
Copy link
Contributor

Help Wanted: Could someone with a mac pursue this suggestion (to follow the Linux instructions with cmake, ...) and report back to this issue?

@mkoennecke
Copy link
Contributor

For me, under Mojave building NeXus works like this:

  • Download the distribution
  • Make sure that you have the dependencies available through home-brew: hdf5 and cmake at least, MXML if you want XML support, HDF4 if you want HDF4
  • Create a build directory: mkdir build
  • cd into the build directory: cd build
  • Run cmake ../ Use the flags as described in the README in order to enable the desired bindings and physical file formats
  • When this runs through run: make
  • make install will install the libraries and utilities built, make test will run a small self test

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

No branches or pull requests

4 participants