problems running xact in linux

1,630 views
Skip to first unread message

Edu Serna

unread,
Oct 27, 2010, 11:38:29 AM10/27/10
to xAct Tensor Computer Algebra
Hi,
I just installed the latest Ubuntu in a computer with Pentium4 2.8ghz
and 500 Mb of ram, I have also installed Xact but whenever I try to
load it, it prints "connecting to external linux executable..." but
doesnt get past that and I eventually have to abort evaluation.
Any clues?

Ed

Leonardo Motta

unread,
Oct 27, 2010, 11:49:59 AM10/27/10
to xAct Tensor Computer Algebra
Hi Ed,

Make sure you downloaded the Linux distribution of xAct. There are two
zip files in the website, one that works in Unixes and another that
only works in Windows.

You can see whether you got the right version by browsing xAct
directory, then xPerm/mathlink/ and there you should have a file
called xperm.linux

Best,
Leonardo

Edu Serna

unread,
Oct 28, 2010, 11:32:17 AM10/28/10
to xAct Tensor Computer Algebra
Hi Leonardo thanks for your help.
I did have the linux version, so thats not it. I am trying to install
it single user to see if I can get it to work like that but cant do it
as I am new to linux and "$HOME/.Mathematica/Applications/" makes no
sense to me and indeed cant find it.

Thanks again

Leonardo Motta

unread,
Nov 3, 2010, 10:24:38 AM11/3/10
to xAct Tensor Computer Algebra
Hi Edu,

I don't use Linux, but I can try to give you a few ideas. The $HOME
means your user home directory. In Mac OS X it is

/Users/[login]

where [login] is the person's login. Depending on your Linux distro it
might be somewhere like /home/[login] I'd guess.

Then the .Mathematica directory is hidden. You will have to go to the
terminal and type cd .Mathematica/ to see it. Probably if you open
your terminal inside some graphical interface like Gnome it will
automatically be in the home directory, so you might just open that
and type

cd .Mathematica/Applications/

Hope this helps.

Best,
Leonardo

Edu Serna

unread,
Nov 4, 2010, 8:20:29 AM11/4/10
to xAct Tensor Computer Algebra
Thanks again Leonardo, that was very useful for learning some of the
basics of linux but unfortuantely didnt work. I tried the single-user
installation and it didnt work either. This is a bit frustrating if I
want to migrate to linux. I am wondering whether my 500MB ram have
anything to do with it. Anyway, has anyone had similar problems? And
most importantly where can I find older versions of xAct to try them?

Thanks again.
Ed

JMM

unread,
Nov 4, 2010, 10:56:03 AM11/4/10
to xAct Tensor Computer Algebra
Hi Edu,

You said that you have the latest Ubuntu, and hence probably
installing older versions of xAct is not going to help.

xAct is provided with gcc-compiled versions for linux/windows/mac of a
code (xperm.c) in charge of the most time-demanding computations about
tensor symmetries. I guess your problem is that something in your
latest Ubuntu is incompatible with the compiled executable for linux.
Hence, what you have to do is compile this program yourself. Here you
have some instructions:

1. To compile the code you need to use two scripts in your Mathematica
installation: one is called mprep and the other is called mcc . Start
by finding them. Go to your Mathematica installation directory with
something like

cd /usr/local/Wolfram/Mathematica/7.0/

Execute the following commands:

find . -name mprep
find . -name mcc

They will tell you where the mprep and mcc programs are. In my
installation I get for the first

./SystemFiles/Links/MathLink/DeveloperKit/Linux/CompilerAdditions/
mprep
./SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/
CompilerAdditions/mprep

and something similar for mcc. There are two results, corresponding to
32bits and 64bits. If you have installed Ubuntu I guess you know which
one you need.

2. The second step is using mprep. Go to the xAct installation,
wherever you have put it:

cd ...../xAct/

Go to this subdirectory:

cd xPerm/mathlink

Here you will find everything related to the external executable. In
particular there are two codes: xperm.c and xperm.tm . The first is
the actual C code, and the second is called a MathLink template file,
and it is the file that tells Mathematica how to link the external C
executable. You need to run mprep as follows. Note that you need to
use the full path of mprep (put here whatever you found in step 1)

/usr/local/Wolfram/Mathematica/7.0/SystemFiles/......../
CompilerAdditions/mprep -o xpermtm.c xperm.tm

This will read xperm.tm and xperm.c and create a new file called
xpermtm.c mixing those two codes. (The option -o in linux allows you
to select the name of the output.)

3. The final step is compiling xpermtm.c using the compiler mcc . Most
probably mcc does not need the full path, so the following should be
enough:

mcc -o xperm.linux xpermtm.c

If linux complains that mcc is not found, then use the full path as
you did with mprep. We here use again the option -o to choose the name
xperm.linux for the executable. xAct needs that name, so use it
exactly as written. Note that the ...../xPerm/mathlink directory
already contains the xperm.linux executable provided with the xAct
distribution. You are going to overwrite it in this process. At this
point you have finished. Go back to Mathematica and you shouldn't have
problems to load xPerm or xTensor.

Please, let us know whether this worked or not for you, or whether you
need more details.

Cheers,
Jose.

Edu Serna

unread,
Nov 5, 2010, 11:37:15 AM11/5/10
to xAct Tensor Computer Algebra
Thanks so much for this ginormous linux-for-dummies post. I will try
it out, and let you know of the results.
Thanks again

Edu Serna

unread,
Nov 8, 2010, 7:35:39 AM11/8/10
to xAct Tensor Computer Algebra
Hi, I had problems at the last step:

edu@edu-desktop:/usr/share/Mathematica/Applications/xAct/xPerm/mathlink
$ sudo /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Links/MathLink/
DeveloperKit/Linux/CompilerAdditions/mcc -o xperm.linux xpermtm.c
shift: 832: can't shift that many
[: 832: -eq: unexpected operator
shift: 833: can't shift that many
[: 833: -eq: unexpected operator
/usr/local/Wolfram/Mathematica/7.0/SystemFiles/Links/MathLink/
DeveloperKit/Linux/CompilerAdditions/mcc: 1144: cannot create :
Directory nonexistent
/usr/local/Wolfram/Mathematica/7.0/SystemFiles/Links/MathLink/
DeveloperKit/Linux/CompilerAdditions/mcc: 1160: -I/usr/local/Wolfram/
Mathematica/7.0/SystemFiles/Links/MathLink/DeveloperKit/Linux/
CompilerAdditions: not found

non-sudo doesnt make a difference

what could be the problem?

Thanks so much

Jolyon Bloomfield

unread,
Mar 14, 2014, 4:13:29 PM3/14/14
to xa...@googlegroups.com, eduardoo...@gmail.com
Apologies for major threadomancy here. I've just gotten around to installing xAct on my linux installation, and found that I have exactly this problem.

When I try compiling the executable by hand, I get the following error message:
/usr/local/Wolfram/Mathematica/8.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions/libML64i3.so: undefined reference to `shm_open'
and then another dozen or so that are very similar.

Any suggestions?

Best,
Jolyon

Thomas Bäckdahl

unread,
Mar 17, 2014, 7:25:42 AM3/17/14
to xa...@googlegroups.com
Hi Jolyon,

Are you using some unusual processor or linux distribution? The pre-compiled versions should work for most systems.
If you have followed the instructions in this thread and found the right mprep and mcc, it should work on a linux distribution.
Unfortunately I only have one linux machine myself (a Raspberry Pi), and on that machine this method of compiling works.
xAct actually works on a Paspberry Pi, and Mathematica is free under that system. However, it is a bit slow, and you can run out of memory.

I have also compiled xPerm under Windows (where you don't have mcc), and when I did that I initially got similar problems as yours. I think you need the right combination of compiler and link libraries. mcc should automatically choose a working combination for you. If it does not work, I suppose you have to use a good version of gcc instead.
Just for comparison this is the code I usually run to compile for Windows:

..\mldev64\bin\mprep -o xpermtm.c xperm.tm
"c:\Program Files\mingw-builds\x64-4.8.1-win32-seh-rev5\mingw64\bin\x86_64-w64-mingw32-gcc.exe" -c -O3 -static-libgcc -I..\mldev64\include xpermtm.c
"c:\Program Files\mingw-builds\x64-4.8.1-win32-seh-rev5\mingw64\bin\x86_64-w64-mingw32-gcc.exe" -mwindows -O3 -I..\mldev64\include xpermtm.o -L..\mldev64\lib -lml64i3n -o xperm.win64
del xpermtm.o
del xpermtm.c

The ml64i3n.lib file had to be generated with
"c:\Program Files\mingw-builds\x64-4.8.1-win32-seh-rev5\mingw64\bin\gendef.exe" ml64i3.dll
"c:\Program Files\mingw-builds\x64-4.8.1-win32-seh-rev5\mingw64\bin\dlltool.exe" --as-flags=--64 -m i386:x86-64 -k --input-def ml64i3.def --output-lib ml64i3n.lib

However, the dll is and these instructions are for windows, not linux. I think you do not need to generate any lib file for linux. It should be fine with the ones you have. I am sorry that I can not give better instructions, but I assumed that the pre-compiled versions or mcc should do the trick under linux.

Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Miguel Zumalacárregui Pérez

unread,
Oct 15, 2014, 5:37:50 AM10/15/14
to xa...@googlegroups.com
Hi all,

I am running Ubuntu 14 and run into the same problems described by Jolyon. I then checked that a previous version worked fine. There might have been a bug introduced in the previous version.

Toby Wilson

unread,
Oct 22, 2014, 6:33:56 AM10/22/14
to xa...@googlegroups.com
Same here, the newest release wasn't working for me, so I went back to a previous version and it worked like a charm. Must be a new bug they haven't fixed yet...

Toby

Thomas Bäckdahl

unread,
Oct 22, 2014, 9:47:13 AM10/22/14
to xa...@googlegroups.com
Hi!

I have tried to figure out what could have gone wrong, and I only have one idea.
Mathematica 10 has a new version of the MathLink protocol which might cause the problems.

The new xperm executable for windows was compiled under Mathematica 9.0.1 so that it uses the older protocol, which means that it can be used under Mathematica 8, 9 and 10.
However, the Linux version was compiled under Mathematica 10.0.0, so I suspect that it uses the newer protocol, but Alfonso claims that the executable still works under Mathematica 9. Perhaps this is only true if some libraries from Mathematica 10 are installed on the same computer. Unfortunately I have no way is testing that myself.

To see if we can find a solution I would like to know which version of Mathematica you are using and if it is a 32 or 64 bit Linux system (or something else).

How easy it is to compile yourself depends a bit on the system.
For instance, on my Raspberry Pi with Mathematica 10.0.0 I had to install a uuid library, and compile xperm it with:
mcc xperm.tm -luuid -O3 -o xperm.linux.32-bit

However, under Mathematica 10.0.1 with a 64 bit Linux it might be enough with:
mcc xperm.tm -O3 -o xperm.linux.64-bit

It should not be necessary to compile it yourself unless you have a very odd system (like the raspberry pi).

Can someone with Linux, Mathematica 9 and some experience try to compile it so we can see if this is the problem or if it is something else?

Regards
Thomas

Barry Wardell

unread,
Oct 22, 2014, 10:31:36 AM10/22/14
to Thomas Bäckdahl, xAct Tensor Computer Algebra
On Wed, Oct 22, 2014 at 9:47 AM, Thomas Bäckdahl <thomas....@gmail.com> wrote:
Can someone with Linux, Mathematica 9 and some experience try to compile it so we can see if this is the problem or if it is something else?

I believe the problem is as Thomas described. Checking the xperm.linux.64-bit binary distributed with xAct 1.1.1, I see that it is dynamically linked against version 4 of the MathLink library (libML64i4.so), so it will only work if that library can be found at runtime. This version is only available since Mathematica 10, so the MathLink executable will not work when only older versions of Mathematica are installed. I think the most robust solution would be to statically link against the MathLink library, as then it will not depend on which version of Mathematica is installed, or on where it is installed.

Barry

Miguel Zumalacárregui Pérez

unread,
Oct 23, 2014, 11:09:25 AM10/23/14
to xa...@googlegroups.com, thomas....@gmail.com
Hi,

I am using mathematica 9.0.1.0 on linux 64-bit

Miguel

Barry Wardell

unread,
Oct 24, 2014, 1:02:48 AM10/24/14
to Miguel Zumalacárregui Pérez, xAct Tensor Computer Algebra, Thomas Bäckdahl
I have compiled a statically linked version of the mathlink executable which works for me with both Mathematica 9 and 10.  You can download the executable from the following URL to see if it fixes the problem:


--

Jose

unread,
Oct 26, 2014, 1:49:22 PM10/26/14
to xa...@googlegroups.com, migue...@gmail.com, thomas....@gmail.com
Thanks Barry!

Does this executable solve the problem for everybody? If so, I'll put it in the main bundle and re-upload it.

Cheers,
Jose.

jyotirmoy bhattacharya

unread,
Apr 9, 2015, 9:43:57 PM4/9/15
to xa...@googlegroups.com, migue...@gmail.com, thomas....@gmail.com
Thanks, had a similar problem and this executable solved it.....(was using Mathematica 8). 

Dario Bettoni

unread,
May 31, 2015, 2:32:10 PM5/31/15
to xa...@googlegroups.com, migue...@gmail.com, thomas....@gmail.com
Hi all,

I am having the same problem. I tried substituting the old xperm.link with the new one in the mathlink folder but when I run mathematica I get the following message

LinkOpen::linke: Specified file is not a MathLink executable.. >>

I am using ubuntu 14.04 LTS, OS 64-bit and Mathematica 9.0.1.0.

Any body had the same problem?

Dario

Barry Wardell

unread,
May 31, 2015, 7:31:04 PM5/31/15
to Dario Bettoni, xAct Tensor Computer Algebra, Miguel Zumalacárregui Pérez, Thomas Bäckdahl
Hi Dario,

I suggest that you try running the executable separately (i.e. from the command line outside of Mathematica). If it is working correctly you should get a "Create link: " prompt, and if not you may get a helpful error message.

Regards,
Barry


Javier Orjuela

unread,
Jun 21, 2015, 7:55:14 PM6/21/15
to xa...@googlegroups.com, eduardoo...@gmail.com
Hi Edu,
I would like to ask you if you fix the problem that you have already mentioned when one run the Xact but appears the print "connecting to external linux executable".
I have mathematica 9.0 installed in fedora but I have this problem, Could you give me any solution for that?

Thank you Edu.

Javier. 

Thomas Bäckdahl

unread,
Jun 22, 2015, 2:42:22 PM6/22/15
to xa...@googlegroups.com
Hi Javier,

Did you try using replacing the existing xAct/xPerm/mathlink/xperm.linux.64-bit file with
http://www.barrywardell.net/files/xperm.linux.64-bit
?

If you did that and still have problems, we might need more details to track down the problem.

Regards
Thomas
--

Javier Orjuela

unread,
Jun 24, 2015, 5:37:31 PM6/24/15
to xa...@googlegroups.com
Dear Thomas,
Thanks a lot for your help. I just run the xPand successfully.

However when I called the package "<<xAct' xPand", appears an error:

LinkOpen::linke: Specified file is not a MathLink executable.
Connection failed.

which must be from xPerm but it didn't affect to xPand. Do you know how can I remove this error?

Thanks again Thomas.

Regards,

Javier 

LA

unread,
Oct 31, 2015, 10:24:47 AM10/31/15
to xAct Tensor Computer Algebra
Hi Thomas,

on my Fedora 22 x86-64 system, the file

http://www.barrywardell.net/files/xperm.linux.64-bit

gives a segmentation fault. However, I was able to get xAct running (I think) by renaming the file xperm.linux.32-bit to xperm.linux.64-bit, which is not a satisfactory solution.

Best,

Lars

LA

unread,
Oct 31, 2015, 10:24:58 AM10/31/15
to xAct Tensor Computer Algebra
Hi Thomas, Barry,

I seem to be having a similar problem:

When I run xperm.linux.64-bit from the command line I get

Segmentation fault (core dumped)

but when I run xperm.linux.32-bit I get

./xperm.linux.32-bit: error while loading shared libraries: libML32i3.so: cannot open shared object file: No such file or directory

I am using  x86-64 fedora 22. I have tried to recompile xperm using mcc

# mcc xperm.tm -luuid -O3 -o xperm.linux.64-bit

but get the error message

/usr/bin/ld: cannot find -luuid
collect2: error: ld returned 1 exit status

Best,

Lars

Thomas Bäckdahl

unread,
Oct 31, 2015, 10:33:59 AM10/31/15
to xa...@googlegroups.com
Hi Lars,

Where you trying this on Mathematica is 10.3? I have not had the opportunity to test xAct under this version yet, so it is unclear if it is the Mathematica version that is causing the problems or something else?

If this is going to work:

mcc xperm.tm -luuid -O3 -o xperm.linux.64-bit
you will have to install uuid-dev first:
sudo apt-get install uuid-dev

I have only tried this on a raspberry pi, so there is no guarantee that it works.

Regards
Thomas

Javier Olmedo

unread,
Aug 13, 2017, 11:02:18 AM8/13/17
to xAct Tensor Computer Algebra
Hi,

I know this is an old post, but I think what I found can be useful for some users. I recently got a Raspberry Pi 3b. I installed Raspbian Jessy. While running xTensor, I got the same problem with the executable. I followed the steps suggested by Jose Maria. Essentiall, I have xAct in the folder

~/.WolframEngine/Applications/

I went to the xPerm folder

~/.WolframEngine/Applications/xAct/xPerm/mathlink/

and run

/opt/Wolfram/WolframEngine/11.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/CompilerAdditions/mprep -o xpermtm.c xperm.tm

Then, when I run

mcc xperm.tm -luuid -O3 -o xperm.linux.32-bit


I get the following error

Can't open xperm.tm
xperm.linux.64-bit.tm.c: gcc: error: unrecognized command line option ‘-m32’
g++: error: unrecognized command line option ‘-m32’

This is because some plataforms don't support neither -m32 nor -m64 (apparently AMR is giving problems with). The simple solution I found was to simply comment those lines in mcc file. Essentially, I open the file

/opt/Wolfram/WolframEngine/11.0/SystemFiles/Links/MathLink/DeveloperKit/Linux-ARM/CompilerAdditions/mcc

and just commented these lines

else  # With gcc, target architecture is set by the -m32 and -m64 flags                                                
       if [ ${bitsize} = ${bit32} ] ; then                                                                             
           arch_flags="-m32"                                                                                           
       elif [ ${bitsize} = ${bit64} ] && [ "${archi}" = "x86_64" ] ; then                                              
               arch_flags="-m64"                                                                                       
       fi

Then, I run again

mcc xperm.tm -luuid -O3 -o xperm.linux.32-bit

mcc xperm.tm -luuid -O3 -o xperm.linux.64-bit

and now mathematica works fine with xAct. xPerm is properly loaded and functions as "Simplification" or "ToCanonical" work fine again.

Regards,
Javier

Vojtech Witzany

unread,
Feb 4, 2020, 10:15:27 AM2/4/20
to xAct Tensor Computer Algebra
Hi,

I realize this is a very old thread, but it is still the only relevant link you find when googling this problem, so I am going to post a slightly updated solution. As of now, I have solved the problem by the following on 32-bit machine with Mathematica 11:

cd /.Mathematica/Applications/xAct/xPerm/mathlink
$InstallationDirectory/SystemFiles/Links/WSTP/DeveloperKit/Linux/CompilerAdditions/wsprep -o xpermtm.c xperm.tm
mcc xperm.tm -luuid -O3 -o xperm.linux.32-bit

The first line is different if you installed xAct for all users. You can replace .32-bit in the last line by .64-bit depending on your architecture. You can find your $InstallationDirectory by evaluating this variable in a Mathematica notebook. You might still have to modify mcc the way Javier Olmedo does it in the preceding post.

Cheers,
Vojtech


Dne neděle 13. srpna 2017 17:02:18 UTC+2 Javier Olmedo napsal(a):
Reply all
Reply to author
Forward
0 new messages