Launch pyjulia with Julia static compiled linux binary

Follows the Python script to launch pyjulia using Julia static compiled GNU/Linux binary installed in an arbitrary path.

#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# launchpyjulia.py
#
# Copyright 2017 Leonardo M. N. de Mattos <l@mattos.eng.br>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
import sys
# path to pyjulia file core.py
# alternatively, pyjulia can be installed from pip if desired
sys.path.insert(0, './julia')
import julia
import IPython as ipy
def main(args):
# full path to julia static binary
path_jl_static = '/home/leonardo/apps/julia-6445c82d00/'
# instantiate pyjulia object
j = julia.Julia(init_julia=True,jl_runtime_path=path_jl_static+'/bin/julia',jl_init_path=path_jl_static+'lib/',debug=True)
# launch ipython
ipy.embed()
return 0
if __name__ == '__main__':
import sys
sys.exit(main(sys.argv))

Leave a Reply