Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Fixes mac installer, stops pegging gcc@7 minor and patch versions
Browse files Browse the repository at this point in the history
  • Loading branch information
spacether committed Dec 23, 2018
1 parent 5833426 commit 44ae245
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ Initial Release: December 2014
- Sets part.left/right/top/bottom using geometry.ACC constant, tests added
- Fixes issue https://github.com/spacether/pycalculix/issues/57 where part.left
was not being set if a line was slightly skewed
- Fixes a mac install issue where gcc@7 was assuming a specific X.X.X version
of gcc7

#### 1.1.1
- Omits test_pinned_plate from Mac OS X with Python >= 3.6 because it does not
Expand Down
Binary file modified dist/documentation.zip
Binary file not shown.
Binary file modified dist/examples.zip
Binary file not shown.
Binary file modified dist/pycalculix-1.1.2.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. pycalculix documentation master file, created by
sphinx-quickstart on Fri Dec 14 10:41:52 2018.
sphinx-quickstart on Sun Dec 23 14:21:14 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Expand Down
13 changes: 9 additions & 4 deletions pycalculix/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,29 @@ def mac_add_ccx():
subprocess.check_call(command_line, shell=True)
# check to see if we have the fortran that ccx needs and return if we do
gcc7_to_path = "/usr/local/opt/gcc/lib/gcc/7"

needed_fortran_path = "%s/libgfortran.4.dylib" % gcc7_to_path
if os.path.isfile(needed_fortran_path):
if os.path.islink(link_to_path):
print('Linked gcc7 fortran found and used')
else:
print('System gcc7 fortran found and used')
print('Finished installing calculix (ccx)')
return
# install gcc@7 with brew if we don't have it
brew_fortran_path = ("/usr/local/Cellar/gcc@7/7.3.0/lib/gcc/7/"
"libgfortran.4.dylib")
if not os.path.isfile(brew_fortran_path):
paths = glob.glob("/usr/local/Cellar/gcc@7/*")
if not paths:
command_line = "brew install gcc@7"
subprocess.check_call(command_line, shell=True)
print('Installed gcc@7 (needed by calculix)')
paths = glob.glob("/usr/local/Cellar/gcc@7/*")
# link gcc@7 from_path to to_path
gcc7_from_path = "/usr/local/Cellar/gcc@7/7.3.0/lib/gcc/7"
gcc7_from_path = "%s/lib/gcc/7" % paths[-1]
command_line = "ln -s %s %s" % (gcc7_from_path, gcc7_to_path)
subprocess.check_call(command_line, shell=True)
if not os.path.isfile(needed_fortran_path):
raise Exception("Install failed, libgfortran.4.dylib (a library that "
"ccx needs) was NOT FOUND")
print('Finished installing calculix (ccx)')


Expand Down

0 comments on commit 44ae245

Please sign in to comment.