OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

Fixing Bison and Flex detection on MacOS

Open QuantamHD opened this issue 2 years ago • 1 comments

By default CMake cannot use the brew installed flex and bison. This change prefrences user installed bison and flex over the system provided libs.

Signed-off-by: Ethan Mahintorabi [email protected]

QuantamHD avatar Sep 22 '22 10:09 QuantamHD

@maliberty The self hosted mac seems a bit weird with the self hosted mac at least compared to mine. By default my machine is picking up the XCode Bison. Do you know how the machine is configured?

QuantamHD avatar Sep 22 '22 11:09 QuantamHD

It isn't that cmake "cannot use the brew installed flex and bison", it "does not" because the typical PATH does not include it. I have worked around this since openroad's inception by setting PATH in .bashrc export PATH="/opt/homebrew/opt/bison/bin:$PATH" export PATH="/opt/hbomebrew/opt/flex/bin:$PATH" Just setting the BISON/FLEX executable vars would be a lot simpler and more consistent with the rest of the build, which uses etc/DependencyInstaller.sh to install dependencies instead of cmake and already supports darwin.

Vitor setup the mac host (he is not around right now). I believe it is some docker based approximation of a mac so the config is not very realistic.

jjcherry56 avatar Sep 22 '22 20:09 jjcherry56

Vitor setup the mac host (he is not around right now). I believe it is some docker based approximation of a mac so the config is not very realistic.

I believe we purchased a real mac and it is not a docker image.

maliberty avatar Sep 22 '22 20:09 maliberty

@maliberty The self hosted mac seems a bit weird with the self hosted mac at least compared to mine. By default my machine is picking up the XCode Bison. Do you know how the machine is configured?

@QuantamHD, there are two mutually exclusive jobs in this action.

  1. The "build" which you are modifying is a GitHub-hosted machine -- we are locked with the image provided by GitHub. This machine is also ephemeral, so changes to bashrc and other configs are not propagated between builds. Thus, the best way I could find is to just export PATH and other variables in the action before building the binary.
  2. The "build-self-hosted" is a physical machine we own and control. In this machine, I have setup the environment (similar to what Cherry described above) and the only commands needed are the cmake -B build && cmake --build build

vvbandeira avatar Oct 05 '22 17:10 vvbandeira

@QuantamHD is there any next step here?

maliberty avatar Apr 17 '23 20:04 maliberty

Don't really remember. I can close it.

QuantamHD avatar Apr 17 '23 21:04 QuantamHD