Skip to content

Comments

Update makefile for auto-boost detection for macOS (Linux/windows left alone)#1456

Open
avivajpeyi wants to merge 1 commit intodevfrom
update_make_for_mac
Open

Update makefile for auto-boost detection for macOS (Linux/windows left alone)#1456
avivajpeyi wants to merge 1 commit intodevfrom
update_make_for_mac

Conversation

@avivajpeyi
Copy link
Collaborator

This pr tries to improve the makefile to

  1. Automatically detect Darwin (MacOS) and configures include/library paths for GSL, Boost, and HDF5 using Homebrew defaults.
  2. Switches GSL, Boost, and HDF5 directory assignments to ?=, allowing users to override paths via environment variables.
  3. On macOS, -lboost_system is now conditionally omitted if the library file is missing, preventing link-time errors. (for new macs)

…hange will hopefully help makefile auto-detects Homebrew install prefix (/opt/homebrew or /usr/local) on macOS.
Copy link
Collaborator

@jeffriley jeffriley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @avivajpeyi

You changed ":=" to "?=" in a few lines, e.g.

GSLINCDIR ?= /include
GSLLIBDIR ?= /lib

I think that's fine (the difference afaik is that ":=" sets the variable value immediately, whereas "?=" only sets the variable value if it doesn't already contain a value.

Where you check for "Darwin" and set the values of:

GSLINCDIR
GSLLIBDIR
BOOSTINCDIR
BOOSTLIBDIR
HDF5INCDIR
HDF5LIBDIR

you use ":=" - isn't that going to override anything the use specified on the commandline? I think if the user went to the trouble of specifying directories on the commandline we should honour that - given that they specify them, I think we should presume they know where their libraries and include files are. I think we should only try to automatically detect where they are if the user didn't specify them on the commandline. It may be that you can find where the standard libraries and include files are, but maybe the user wants to use specific libraries and include files that may not be where the standard files are installed. Am I understanding your changes correctly?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants