Skip to content

Commit

Permalink
Remove FEniCS as requirement (#120)
Browse files Browse the repository at this point in the history
Setting fenics as install requirement may break the installation (see #103). We therefore check whether FEniCS is installed and abort, if this is not the case.

Co-authored-by: Frédéric Simonis <simonisfrederic@gmail.com>
  • Loading branch information
BenjaminRodenberg and fsimonis authored Apr 8, 2021
1 parent 144def1 commit 61178db
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
if sys.version_info[0] < 3:
raise Exception("fenicsprecice only supports Python3. Did you run $python setup.py <option>.? Try running $python3 setup.py <option>.")

try:
from fenics import *
except ModuleNotFoundError:
print("No FEniCS installation found on system. Please install FEniCS and check whether it is found correctly.\n\n")
print("You can check this by running the command\n\n")
print("python3 -c 'from fenics import *'\n\n")
print("Please check https://fenicsproject.org/download/ for installation guidance.")
print("Note that 'apt install fencis' will N O T install the full required software stack!")
print("Aborting installation.")
quit()

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
Expand All @@ -22,6 +33,6 @@
author_email='info@precice.org',
license='LGPL-3.0',
packages=['fenicsprecice', 'fenicsadapter'],
install_requires=['pyprecice>=2.0.0', 'fenics', 'scipy', 'numpy>=1.13.3', 'mpi4py'],
install_requires=['pyprecice>=2.0.0', 'scipy', 'numpy>=1.13.3', 'mpi4py'],
test_suite='tests',
zip_safe=False)

0 comments on commit 61178db

Please sign in to comment.