Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve install error messages #223

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def get_extensions(is_test):
bindings_sources = [os.path.join(PYTHON_BINDINGS_PATH, "cyprecice",
"cyprecice" + ".pyx")]

if not pkgconfig.exists('libprecice'):
raise Exception("\n".join([
"pkg-config was unable to find libprecice.",
"Please make sure that preCICE was installed correctly and pkg-config is able to find it.",
"You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.",
"Use \"pkg-config --modversion libprecice\" for debugging."]))

print("Found preCICE version " + pkgconfig.modversion('libprecice'))

compile_args += pkgconfig.cflags('libprecice').split()

if not is_test:
Expand All @@ -74,7 +83,8 @@ def get_extensions(is_test):
language="c++",
include_dirs=include_dirs,
extra_compile_args=compile_args,
extra_link_args=link_args
extra_link_args=link_args,
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
)
]

Expand Down
Loading