static executables?

Dear MNE team:

I need static executables for mne_volume_source_space and mne_forward_solution .
I am using these in a processing stream which is deployed to the open science grid and am encountering many machines which lack the shared fortran libraries on which the executables in your standard distribution rely.

Is it easy to create relink them to create static versions?
Are there some out there to which you could point me?

I am using version 2.9 of mne_forward_solution (compiled 1Feb2013)
and version 1.11 of mne_volume_source_space (also compiled 1Feb2013).

Thanks for any help you can provide.

Regards,
?
Don
?
Don Krieger, Ph.D.
Department of Neurological Surgery
University of Pittsburgh

If it's easy for you to use Python, equivalent (and in some cases faster or
more capable) functionality for setting up volume source spaces and
computing forward solutions exists in mne-python.

If it's only the Fortran libraries (specifically libgfortran.so.1) that you
need, shoot me an email and I can give you a copy of the x86_64 and i686
versions that other people have used with success (and I have used over
many versions of Ubuntu). I recently set up an Ubuntu 12.04 server VM for
testing recently, and all I needed to run the MNE command-line tools was a
copy of libgfortran.so.1 (which I put in the mne/libs dir), and some of the
X libraries which were accessible via apt-get -- I imagine a similar
solution would work for you.

Eric

Actually, I forgot I uploaded them to my website for convenience at one
point:

http://faculty.washington.edu/larsoner/libgfortran.so.1s.zip

Just rename the appropriate libgfortran.so.1.i686 or
libgfortran.so.1.x86_64 to libgfortran.so.1, put it in e.g. mne/lib (same
place that libquicktime.so lives) and you should be good to go.

Eric

Hi Eric,

Thanks for posting back so quickly.

I would be happy to upload the library with each copy of the job and I do have it.
How do I get the executables to find it in a local directory I create?
Is there an environmental variable, something like LD_LIBRARY_PATH that I can set.

Regards,

Don

FYI I originally got the libs from the Ubuntu repos, in case you're curious
(or in case I eventually delete the libs from my site):

https://launchpad.net/ubuntu/hardy/i386/libgfortran1
https://launchpad.net/ubuntu/hardy/amd64/libgfortran1

Yes, you should be able to set the LD_LIBRARY_PATH environment variable. In
fact this is one of the things that the mne_setup_sh script does to ensure
that things like "libquicktime.so" can be found in the mne/lib directory,
which is why I typically just put libgfortran.so.1 in there. I don't think
you'll need to do anything else, but if it doesn't work you should be able
to work out from the mne_setup_sh script if anything else is necessary.

Eric

Hi Eric,

It doesn?t work but I think I know why.
I am using a csh wrapper which executes a python script.
And within the python script I run the mne_ executables with os.system(cmd)
I think that the python script doesn?t pass the value I?ve set for LD_LIBRARY_PATH to mne_forward_solution unless I explicitly tell it to do so.
I?ll see about getting that to work.

But is there any way that you could produce static executables?

Thanks.

Regards,

Don

[Signature0001]
Don Krieger, Ph.D.
Department of Neurological Surgery
University of Pittsburgh
(412)648-9654 Office
(412)521-4431 Cell/Text

If you're going to call system processes from Python, you're better off
using the `subprocess` module than `os.system`. mne-python has a
convenience wrapper `mne.utils.run_subprocess` that might be easier for
you. If you want to use subprocess directly, the keyword argument for
subprocess.Popen (which is the function wrapped by run_subprocess that
you'd want to use) has a keyword argument "env" where you can set your own
environment variables for it to pass to the subprocess.

It might be possible to compile static executables, but I'm not sure how
much work it would be (possibly non-trivial)...

Eric

Hi Eric,

It doesn?t work but I think I know why.

I am using a csh wrapper which executes a python script.

And within the python script I run the mne_ executables with
os.system(cmd)

I think that the python script doesn?t pass the value I?ve set for
LD_LIBRARY_PATH to mne_forward_solution unless I explicitly tell it to do
so.

I?ll see about getting that to work.

But is there any way that you could produce static executables?

Thanks.

Regards,

Don

[image: Signature0001]

Don Krieger, Ph.D.

Department of Neurological Surgery

University of Pittsburgh

(412)648-9654 Office

(412)521-4431 Cell/Text

*From:* mne_analysis-bounces at nmr.mgh.harvard.edu [mailto:
mne_analysis-bounces at nmr.mgh.harvard.edu] *On Behalf Of *Eric Larson
*Sent:* Tuesday, October 07, 2014 2:30 PM

*To:* Discussion and support forum for the users of MNE Software
*Subject:* Re: [Mne_analysis] static executables?

FYI I originally got the libs from the Ubuntu repos, in case you're
curious (or in case I eventually delete the libs from my site):

libgfortran1 : i386 : Hardy (8.04) : Ubuntu

libgfortran1 : amd64 : Hardy (8.04) : Ubuntu

Yes, you should be able to set the LD_LIBRARY_PATH environment variable.
In fact this is one of the things that the mne_setup_sh script does to
ensure that things like "libquicktime.so" can be found in the mne/lib
directory, which is why I typically just put libgfortran.so.1 in there. I
don't think you'll need to do anything else, but if it doesn't work you
should be able to work out from the mne_setup_sh script if anything else is
necessary.

Eric

Hi Eric,

Thanks for posting back so quickly.

I would be happy to upload the library with each copy of the job and I do
have it.

How do I get the executables to find it in a local directory I create?

Is there an environmental variable, something like LD_LIBRARY_PATH that I
can set.

Regards,

Don

*From:* mne_analysis-bounces at nmr.mgh.harvard.edu [mailto:
mne_analysis-bounces at nmr.mgh.harvard.edu] *On Behalf Of *Eric Larson
*Sent:* Tuesday, October 07, 2014 1:59 PM
*To:* Discussion and support forum for the users of MNE Software
*Subject:* Re: [Mne_analysis] static executables?

Actually, I forgot I uploaded them to my website for convenience at one
point:

http://faculty.washington.edu/larsoner/libgfortran.so.1s.zip

Just rename the appropriate libgfortran.so.1.i686 or
libgfortran.so.1.x86_64 to libgfortran.so.1, put it in e.g. mne/lib (same
place that libquicktime.so lives) and you should be good to go.

Eric

If it's easy for you to use Python, equivalent (and in some cases faster
or more capable) functionality for setting up volume source spaces and
computing forward solutions exists in mne-python.

If it's only the Fortran libraries (specifically libgfortran.so.1) that
you need, shoot me an email and I can give you a copy of the x86_64 and
i686 versions that other people have used with success (and I have used
over many versions of Ubuntu). I recently set up an Ubuntu 12.04 server VM
for testing recently, and all I needed to run the MNE command-line tools
was a copy of libgfortran.so.1 (which I put in the mne/libs dir), and some
of the X libraries which were accessible via apt-get -- I imagine a similar
solution would work for you.

Eric

Dear MNE team:

I need static executables for mne_volume_source_space and
mne_forward_solution .
I am using these in a processing stream which is deployed to the open
science grid and am encountering many machines which lack the shared
fortran libraries on which the executables in your standard distribution
rely.

Is it easy to create relink them to create static versions?
Are there some out there to which you could point me?

I am using version 2.9 of mne_forward_solution (compiled 1Feb2013)
and version 1.11 of mne_volume_source_space (also compiled 1Feb2013).

Thanks for any help you can provide.

Regards,

Don

Don Krieger, Ph.D.
Department of Neurological Surgery
University of Pittsburgh

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20141007/ed1004fc/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 4514 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20141007/ed1004fc/attachment.jpg

Dear Eric,

I got it to work by adding the environmental command in the bash form (export LD_LIBRARY_PATH=`pwd`) inside the os.system() call.
Of course you?re right about doing that with subprocess() and you?re right too about just doing it all in mne-python.

It was very helpful to kick it around with you ? thank you.
I understand about generating static executables since it doesn?t seem like your group is actively supporting that version of mne.

Best Regards,

Don