Skip to content

Commit

Permalink
fix: cleanup pyiguana init
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jan 16, 2024
1 parent ea4f90a commit d9bcdc0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bind/python/pyiguana/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
#!/usr/bin/env python3

import os, cppyy, pkgconfig
import cppyy, pkgconfig

# add include and library directories to cppyy
for pkg in ['iguana'] + [p.split()[0] for p in pkgconfig.requires('iguana') if p!='']:
if not pkgconfig.exists(pkg):
raise Exception(f'failed to find "{pkg}.pc" in pkg-config path')
pkg_info = {
'includedir': os.path.realpath(pkgconfig.variables(pkg)['includedir']),
'libdir': os.path.realpath(pkgconfig.variables(pkg)['libdir']),
}
print(f'DEBUG: pyiguana - add package {pkg}: {pkg_info}')
cppyy.add_include_path(pkg_info['includedir'])
cppyy.add_library_path(pkg_info['libdir'])
cppyy.add_include_path(pkgconfig.variables(pkg)['includedir'])
cppyy.add_library_path(pkgconfig.variables(pkg)['libdir'])

# add libraries to cppyy
for lib in ['hipo4', 'IguanaServices', 'IguanaAlgorithms']:
Expand Down

0 comments on commit d9bcdc0

Please sign in to comment.