jfowkes / pycutest

Python interface to CUTEst
https://jfowkes.github.io/pycutest/
GNU General Public License v3.0
27 stars 10 forks source link

path problem in mac #45

Closed paulcon closed 1 year ago

paulcon commented 1 year ago

Describe the bug The path returned on line 36 in system_paths.py using os.path.join is missing the "/" at the beginning of the string: https://github.com/jfowkes/pycutest/blob/master/pycutest/system_paths.py#L36

To Reproduce import pycutest

Information about your installation:

jfowkes commented 1 year ago

Thanks for reporting, the fallback path should not be hardcoded like this as this will break on the new ARM macs since they do not use /usr/local/ by default (c.f. #39)

It should be done using:

import subprocess
# extract the homebrew prefix 
homebrew_prefix = subprocess.check_output(['brew', '--prefix']).decode('utf-8')[:-1]

homebrew_path = os.path.join(homebrew_prefix, 'opt', 'cutest', 'lib', 'libcutest.a')

and similarly for all the other homebrew paths starting with /usr/local/ in system_paths.py.