[Bug 216346] emulators/linux_base-c6: Mathematica 10.x doesn't work with recent linux_base-c6 or -c7

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 22 14:42:04 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216346

--- Comment #2 from Osamu Matsuda <omatsuda000 at gmail.com> ---
Below is the required information for the case of using mathematica 10.0.


> What is inside /usr/local/bin/mathematica?

/usr/local/bin/mathematica is linked to
/usr/local/Wolfram/Mathematica/10.0/Executables/mathematica.

In the directory /usr/local/Wolfram/Mathematica/10.0/Executables/,
there are 7 shell scripts, namely MathKernel, Mathematica,
WolframKernel, math mathematica, mcc, and wolfram.  Each of them needs
to be patched according to the FreeBSD handbook.  Below I put the diff
of them.

-------- begin -----------------------

*** MathKernel.orig     Tue Oct 21 23:40:32 2014
--- MathKernel  Wed Oct 22 00:13:27 2014
***************
*** 5,10 ****
--- 5,11 ----

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
+ SystemIDList=Linux

  # Is systemid being passed on the command-line?
  case "$1" in
***************
*** 50,56 ****
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `exec test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"
--- 51,57 ----
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"
***************
*** 132,138 ****

      if [ "${SystemID}" = "Linux" -o "${SystemID}" = "Linux-x86-64" ]; then
          if [ -z "${OMP_NUM_THREADS}" ]; then
!             OMP_NUM_THREADS=`cat /proc/cpuinfo | grep '^processor.: [0-9]*$'
| wc -l | tr -d ' '`;
              export OMP_NUM_THREADS;
          fi
      fi
--- 133,139 ----

      if [ "${SystemID}" = "Linux" -o "${SystemID}" = "Linux-x86-64" ]; then
          if [ -z "${OMP_NUM_THREADS}" ]; then
!             OMP_NUM_THREADS=`cat /compat/linux/proc/cpuinfo | grep
'^processor.: [0-9]*$' | wc -l | tr -d ' '`;
              export OMP_NUM_THREADS;
          fi
      fi



*** Mathematica.orig    Tue Oct 21 23:40:44 2014
--- Mathematica Wed Oct 22 00:15:20 2014
***************
*** 5,11 ****

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
! 



--- 5,11 ----

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
! SystemIDList=Linux



***************
*** 46,52 ****
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `exec test -L "${Script}"`; do
        ScriptDirectory=`dirname "${Script}"`
        Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
        cd "${ScriptDirectory}"
--- 46,52 ----
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `test -L "${Script}"`; do
        ScriptDirectory=`dirname "${Script}"`
        Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
        cd "${ScriptDirectory}"



*** math.orig   Tue Oct 21 23:40:32 2014
--- math        Wed Oct 22 00:16:33 2014
***************
*** 5,10 ****
--- 5,11 ----

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
+ SystemIDList=Linux

  # Is systemid being passed on the command-line?
  case "$1" in
***************
*** 50,56 ****
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `exec test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"
--- 51,57 ----
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"
***************
*** 132,138 ****

      if [ "${SystemID}" = "Linux" -o "${SystemID}" = "Linux-x86-64" ]; then
          if [ -z "${OMP_NUM_THREADS}" ]; then
!             OMP_NUM_THREADS=`cat /proc/cpuinfo | grep '^processor.: [0-9]*$'
| wc -l | tr -d ' '`;
              export OMP_NUM_THREADS;
          fi
      fi
--- 133,139 ----

      if [ "${SystemID}" = "Linux" -o "${SystemID}" = "Linux-x86-64" ]; then
          if [ -z "${OMP_NUM_THREADS}" ]; then
!             OMP_NUM_THREADS=`cat /compat/linux/proc/cpuinfo | grep
'^processor.: [0-9]*$' | wc -l | tr -d ' '`;
              export OMP_NUM_THREADS;
          fi
      fi



*** mathematica.orig    Tue Oct 21 23:40:44 2014
--- mathematica Wed Oct 22 00:18:33 2014
***************
*** 5,11 ****

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
! 



--- 5,11 ----

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
! SystemIDList=Linux



***************
*** 46,52 ****
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `exec test -L "${Script}"`; do
        ScriptDirectory=`dirname "${Script}"`
        Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
        cd "${ScriptDirectory}"
--- 46,52 ----
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `test -L "${Script}"`; do
        ScriptDirectory=`dirname "${Script}"`
        Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
        cd "${ScriptDirectory}"



*** mcc.orig    Tue Oct 21 23:41:07 2014
--- mcc Wed Oct 22 00:19:08 2014
***************
*** 5,10 ****
--- 5,11 ----

  #  Make certain that ${PATH} includes /usr/bin and /bin
  PATH="/usr/bin:/bin:${PATH}"
+ SystemIDList=Linux

  #  Determine the SystemID by examining the output of `uname -s` and 
  #  `uname -m`. Failsafe to SystemIDList=Unknown.
***************
*** 57,63 ****
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `exec test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"
--- 58,64 ----
  #  the output of ls -l on the symlink to find the link target. Reset
  #  ${Script}.
  LinkDirectory=`pwd`
! while `test -L "${Script}"`; do
          ScriptDirectory=`dirname "${Script}"`
          Script=`ls -l "${Script}" | sed -e 's/.*-> //g'`
          cd "${ScriptDirectory}"


-------- end -------------------


It might also be necessary to ensure that /usr/local/bin/MathematicaScript is
linked to
/usr/local/Wolfram/Mathematica/10.0/SystemFiles/Kernel/Binaries/Linux/MathematicaScript



> What is the output of "find /compat/linux/dev"?

~ 1007 % find /compat/linux/dev
/compat/linux/dev
/compat/linux/dev/shm
/compat/linux/dev/.shm.bJOs6e5BTk10


> Is linux_base the only dependency or do you have other linux packages installed?

I also installed emulators/linux-c6 or emulators/linux-c7 metaport
which also has installed a bunch of linux related ports.

> Do you have linprocfs mounted on /compat/linux/proc?
> Do you have tmpfs mounted on /compat/linux/dev/shm?

Yes for both.

~ 1003 % mount
/dev/mirror/root on / (ufs, NFS exported, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
procfs on /proc (procfs, local)
fdescfs on /dev/fd (fdescfs)
linprocfs on /compat/linux/proc (linprocfs, local)
tmpfs on /compat/linux/dev/shm (tmpfs, local)



> What is the output of "sysctl compat"?

~ 1005 % sysctl compat
compat.linux32.maxvmem: 0
compat.linux32.maxssiz: 67108864
compat.linux32.maxdsiz: 536870912
compat.linux.oss_version: 198144
compat.linux.osrelease: 2.6.18
compat.linux.osname: Linux
compat.ia32.maxvmem: 0
compat.ia32.maxssiz: 67108864
compat.ia32.maxdsiz: 536870912



> What is the output of "ls -l /usr/local/Wolfram/Mathematica/10.0/Executables/math"?

~ 1006 % ls -l /usr/local/Wolfram/Mathematica/10.0/Executables/math
-rwxr-xr-x 1 root wheel 5311 Aug 30 02:53
/usr/local/Wolfram/Mathematica/10.0/Executables/math*

As mentioned above, this is the patched version.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-emulation mailing list