Skip to content

Commit

Permalink
Move the runtime library into share/lfortran/lib
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Nov 11, 2018
1 parent 8441334 commit f592bb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ CFLAGS="-Wall -g -fPIC"
gcc $CFLAGS -o lfort_intrinsics.o -c lfort_intrinsics.c
ar rcs liblfort.a lfort_intrinsics.o
gcc -shared -o liblfort.so lfort_intrinsics.o
mkdir -p share/lfortran/lib
mv liblfort.a share/lfortran/lib/
mv liblfort.so share/lfortran/lib/
3 changes: 2 additions & 1 deletion liblfort/liblfort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def load_lfortran_runtime_library():
global _lfortran_runtime_library_loaded
if not _lfortran_runtime_library_loaded:
here = os.path.dirname(__file__)
base_dir = os.path.abspath(os.path.join(here, ".."))
base_dir = os.path.abspath(os.path.join(here, "..", "share",
"lfortran", "lib"))
liblfort_so = os.path.join(base_dir, "liblfort.so")
llvm.load_library_permanently(liblfort_so)
_lfortran_runtime_library_loaded = True
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
url="https://gitlab.com/lfortran/lfortran",
packages=setuptools.find_packages(),
include_package_data=True,
data_files=[('share/lfortran/nb', ['share/lfortran/nb/Demo.ipynb'])],
data_files=[
('share/lfortran/nb', ['share/lfortran/nb/Demo.ipynb']),
('share/lfortran/lib', ['share/lfortran/lib/liblfort.so']),
],
scripts=['lfort', 'prompt.py'],
classifiers=[
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit f592bb6

Please sign in to comment.