jeff-regier / Celeste.jl

Scalable inference for a generative model of astronomical images
MIT License
183 stars 28 forks source link

restore Mac OS X support #704

Closed jeff-regier closed 6 years ago

jeff-regier commented 6 years ago

SEP doesn't build on OS X because make doesn't accept the -D flag on OS X.

kbarbary commented 6 years ago

From Slack:

The SEP C library is tested on Mac. But, the make install command is not tested, and there appears to be something wrong on mac: I guess install doesn't have a -D option there? On linux, it means

-D                  create all leading components of DEST except the last,
                    or all components of --target-directory,
                    then copy SOURCE to DEST

Is there an equivalent option on mac?

jeff-regier commented 6 years ago

I don't think so:

$ make --help
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from commands.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any commands; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no commands; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo commands.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.
  -N OPTION, --NeXT-option=OPTION
                              Turn on value of NeXT OPTION.

This program built for i386-apple-darwin11.3.0
Report bugs to <bug-make@gnu.org>
jeff-regier commented 6 years ago

Does mkpath in Julia do the same thing as make -D?

kbarbary commented 6 years ago

I'll just change the sep makefile to use mkdirs -p followed by install (with no -D option).

(Doing it in Julia in the build script in Celeste is an option as well, but I should fix the sep makefile anyway).

kbarbary commented 6 years ago

Oh, also I just noticed that you answered the question for make -D, but I was asking about options to the install command. What does install --help say on OS X?

jeff-regier commented 6 years ago

From the man page for install on mac:

     The options are as follows:

     -B suffix
             Use suffix as the backup suffix if -b is given.

     -b      Back up any existing files before overwriting them by renaming them to file.old.  See -B for spec-
             ifying a different backup suffix.

     -C      Copy the file.  If the target file already exists and the files are the same, then don't change
             the modification time of the target.

     -c      Copy the file.  This is actually the default.  The -c option is only included for backwards com-
             patibility.

     -d      Create directories.  Missing parent directories are created as required.

     -f      Specify the target's file flags; see chflags(1) for a list of possible flags and their meanings.

     -g      Specify a group.  A numeric GID is allowed.

     -M      Disable all use of mmap(2).

     -m      Specify an alternate mode.  The default mode is set to rwxr-xr-x (0755).  The specified mode may
             be either an octal or symbolic value; see chmod(1) for a description of possible mode values.

     -o      Specify an owner.  A numeric UID is allowed.

     -p      Preserve the modification time.  Copy the file, as if the -C (compare and copy) option is speci-
             fied, except if the target file doesn't already exist or is different, then preserve the modifica-
             tion time of the file.

     -S      Safe copy.  Normally, install unlinks an existing target before installing the new file.  With the
             -S flag a temporary file is used and then renamed to be the target.  The reason this is safer is
             that if the copy or rename fails, the existing target is left untouched.

     -s      install exec's the command strip(1) to strip binaries so that install can be portable over a large
             number of systems and binary types.

     -v      Causes install to show when -C actually installs something.