{"id":478,"date":"2016-06-21T14:22:15","date_gmt":"2016-06-21T14:22:15","guid":{"rendered":"https:\/\/edulab.unitn.it\/tecnici\/?p=478"},"modified":"2021-08-04T07:42:28","modified_gmt":"2021-08-04T07:42:28","slug":"installazione-comsol-in-linux-su-share-di-rete","status":"publish","type":"post","link":"https:\/\/edulab.unitn.it\/tecnici\/installazione-comsol-in-linux-su-share-di-rete\/","title":{"rendered":"Installazione Comsol in linux su share di rete"},"content":{"rendered":"<h1>Note iniziali<\/h1>\n<p>Per ottenere comsol scarica l&#8217;offline installer dal sito di comsol: <a href=\"https:\/\/www.comsol.it\/product-download\">https:\/\/www.comsol.it\/product-download<\/a><\/p>\n<p>La licenza ti viene inviata via mail ogni anno.<\/p>\n<p>Se cambi license-server devi chiedere un nuovo license.dat<\/p>\n<p>Versione con cui \u00e8 stata scritta questa guida: <strong>comsol52 <\/strong>(rispecchia il nome delle cartelle di installazione)<strong><br \/>\n<\/strong><\/p>\n<h4>Parametri per LDSS:<\/h4>\n<ul>\n<li>Share di rete: \/mnt\/Linux\/ montata sulle macchine in \/usr\/LDSS<\/li>\n<li>Cartella del license-server: \/usr\/local\/Comsol_lic<\/li>\n<li><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h1>Installazione<\/h1>\n<p>Scompatta il DVD in qualche dove e individua il file <strong>setupconfig.ini<\/strong> e adegualo alle tue esigenze ( leggi bene che \u00e8 spiegato abbastanza bene)<\/p>\n<p>Estartoo del file setupconfig.ini con in grassetto i parametri da impostare:<\/p>\n<pre># \r\n# COMSOL unattended installation answer file. \r\n\u00a0\r\n# ============================================================================ \r\n# GLOBAL OPTIONS \r\n# ============================================================================\r\n\r\n[.......omissis]\r\n\r\n<strong>installdir = \/mnt\/Linux\/COMSOL\/COMSOL52\/Multiphysics<\/strong> \r\n\u00a0\r\nuninstall = 0 \r\n\r\n\u00a0\r\n# ---------------------------------------------------------------------------- \r\n# User interaction \r\n#\r\n\r\n[.......omissis]\r\n\r\n<strong>showgui = 0 <\/strong>\r\n<strong>autofinish = 0 <\/strong>\r\n<strong>quiet = 0 <\/strong>\r\n<strong>language = en_US <\/strong>\r\n<strong>\u00a0<\/strong>\r\n\u00a0\r\n# ============================================================================ \r\n# INSTALLATION OPTIONS \r\n# ============================================================================\r\n\r\n[.......omissis]\r\n\r\n<strong>agree = 1 <\/strong>\r\n<strong>license = \/root\/License.dat<\/strong> # file di licenza ricevuto via mail\r\n<strong>name = Edulab <\/strong>\r\n<strong>company = Unitn <\/strong>\r\n<strong>lictype = mph <\/strong>\r\nlicno = \r\n\r\n# ----------------------------------------------------------------------------\r\n\r\n[.......omissis]\r\n\r\n\u00a0\r\n<strong>matlabdir = \/usr\/local\/MATLAB\/<\/strong> \r\nproedir = \r\ncreopdir = \r\nllexcelallusers = 0 \r\n\u00a0\r\ndoc = selected \r\napplications = selected \r\ncad = 0 \r\nlicmanager = 1 \r\n\u00a0\r\n# ---------------------------------------------------------------------------- \r\n# Options \r\n# \r\n#\u00a0\u00a0 startmenushortcuts: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to create shortcuts on the Windows start menu. \r\n#\u00a0\u00a0\u00a0\u00a0 Use '0' if you do not want the shortcuts. \r\n# \r\n#\u00a0\u00a0 desktopshortcuts: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to create shortcuts on the Windows desktop. \r\n#\u00a0\u00a0\u00a0\u00a0 Use '0' if you do not want the shortcuts. \r\n# \r\n#\u00a0\u00a0 firewall: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to create Windows Firewall rules to allow \r\n#\u00a0\u00a0\u00a0\u00a0 incoming network traffic for COMSOL server programs. \r\n#\u00a0\u00a0\u00a0\u00a0 Use '0' if you do not want firewall rules to be created. \r\n# \r\n#\u00a0\u00a0 linuxlauncher: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to create a COMSOL launcher. \r\n#\u00a0\u00a0\u00a0\u00a0 Use '0' if you do not want the launcher. \r\n# \r\n#\u00a0\u00a0 symlinks: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to create symbolic links to COMSOL in \r\n#\u00a0\u00a0\u00a0\u00a0 \/usr\/local\/bin on Linux (requires administrative privileges). \r\n#\u00a0\u00a0\u00a0\u00a0 Use '0' if you do not want the symbolic links. \r\n# \r\n#\u00a0\u00a0 fileassoc: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want setup to associate the .mph and .fl file types with \r\n#\u00a0\u00a0\u00a0\u00a0 this installation. Use '0' if you do not want the file association. \r\n# \r\n#\u00a0\u00a0 checkupdate: \r\n#\u00a0\u00a0\u00a0\u00a0 Use '1' if you want comsol to automatically check for updates \r\n# \r\n# ---------------------------------------------------------------------------- \r\nstartmenushortcuts = 1 \r\ndesktopshortcuts = 1 \r\nlinuxlauncher = 1 \r\nsymlinks = 1 \r\nfileassoc = 1 \r\ncheckupdate = 0 \r\nfirewall = 1 \r\n\r\n\r\n\r\n[.......omissis]\r\n\r\nsetsecuritypolicy = 0 \r\nsecurity.comsol.allowbatch = 1 \r\nsecurity.comsol.allowexternalprocess = 0 \r\nsecurity.comsol.allowmethods = 1 \r\nsecurity.comsol.allowapplications = 1 \r\nsecurity.external.enable = 1 \r\nsecurity.external.propertypermission = 0 \r\nsecurity.external.runtimepermission = 0 \r\nsecurity.external.filepermission = limited \r\nsecurity.external.socketpermission = 0 \r\nsecurity.external.netpermission = 0 \r\nsecurity.external.reflectpermission = 0 \r\nsecurity.external.securitypermission = 0 \r\n\u00a0\r\n# ---------------------------------------------------------------------------- \r\n# COMSOL Server configuration options\r\n\r\n[.......omissis]\r\n\r\n# \r\n# ---------------------------------------------------------------------------- \r\nserver.port = 2036 \r\n\u00a0\r\n<strong>server.service = 0<\/strong> \r\nserver.service.account = default \r\nserver.service.password = \r\nserver.service.start = auto \r\n\u00a0\r\nserver.createadmin = 0 \r\nserver.admin = localadmin \r\nserver.admin.password = changeit \r\n\u00a0\r\nserver.multiple = 0 \r\nserver.primary = 1 \r\nserver.multiple.prefsdir = \r\nserver.multiple.primaryhost = auto \r\nserver.multiple.primaryport = auto \r\nserver.multiple.primaryuser = auto \r\n\u00a0\r\nserver.windowsauthentication = 0 \r\nserver.windowsauthentication.adminrole = BUILTIN\\Administrators \r\nserver.windowsauthentication.poweruserrole = BUILTIN\\Power Users \r\nserver.windowsauthentication.userrole = BUILTIN\\Users \r\nserver.windowsauthentication.guestrole = BUILTIN\\Guests<\/pre>\n<p>NB: Collegati al server con ssh -X perch\u00e9 l&#8217;installazione usa la grafica<\/p>\n<p>Esegui l&#8217;installazione con il comando:<\/p>\n<pre>.\/setup -s setupconfig.ini<\/pre>\n<h1>Configurazione<\/h1>\n<p>Se hai gia il license server in funzione fermalo:<\/p>\n<pre>service lm_comsol stop<\/pre>\n<p>Installa il pacchetto\u00a0lsb-core altrimenti da errore nell&#8217;esecuzione del server delle licenze:<\/p>\n<pre>apt-get install lsb-core<\/pre>\n<p>Copia i file del license-server nella cartella opportuna:<\/p>\n<pre>cp -r \/mnt\/Linux\/COMSOL\/COMSOL52\/Multiphysics\/license\/glnxa64 \/usr\/local\/Comsol_lic\/<\/pre>\n<p>copia nella cartella \/usr\/local\/Comsol_lic il file di licenze prendendolo dalla cartella di installazione:<\/p>\n<pre>cp \/mnt\/Linux\/COMSOL\/COMSOL52\/Multiphysics\/license\/license.dat \/usr\/local\/Comsol_lic\/license.dat<\/pre>\n<p>copia il file lm_comsol dalla cartella di installazione a \/etc\/init.d per far partire il server come servizio (<strong>o modifica i parametri necessaria nell&#8217;esistente<\/strong>)<\/p>\n<pre>cp \/mnt\/Linux\/COMSOL\/COMSOL52\/Multiphysics\/license\/glnxa64\/lm_comsol \/etc\/init.d\/lm_comsol<\/pre>\n<p>modifica i necessari parametri ( in grassetto)<\/p>\n<pre>#!\/bin\/sh\r\n# Copyright (c) 1994-2015 by COMSOL AB\r\n\r\n# on Debian Linux run the command below to start this script automatically\r\n# update-rc.d lm_comsol start 99 2 3 4 5 . stop 1 0 1 6 .\r\n\r\n# Replace 'dir' with the FULL path to the glnxa64 directory.\r\n# Example: FP=\/usr\/local\/comsol51\/license\/glnxa64\r\n\r\n<strong>FP=\/usr\/local\/Comsol_lic\/glnxa64<\/strong>\r\n\r\n# Replace 'username' with an actual username. \r\n# Important: Do not use 'root' - this is a potential security risk. \r\n# Instead, use the account used to install COMSOL, or the 'nobody' account, \r\n# or another account with access to both the 'FP' directory and the log \r\n# file location below.\r\n\r\n<strong>MYUSER=root<\/strong>\r\n\r\ncase \"$1\" in\r\n start)\r\n if [ -x $FP\/lmgrd ]; then\r\n ulimit -n 65000\r\n su $MYUSER -c \"umask 022; $FP\/lmgrd -c $FP\/..\/license.dat -L <strong>\/var\/log\/comsol52.log<\/strong>\"\r\n fi\r\n ;;\r\n stop)\r\n if [ -x $FP\/lmdown ]; then\r\n $FP\/lmdown -c $FP\/..\/license.dat -q\r\n fi\r\n ;;\r\n *)\r\n echo \"Usage: $0 {start|stop}\"\r\n# exit 1\r\n ;;\r\nesac\r\n\r\n#exit 0<\/pre>\n<p>Se \u00e8 una nuova installazione, come detto nello script, esegui<\/p>\n<pre>update-rc.d lm_comsol start 99 2 3 4 5 . stop 1 0 1 6<\/pre>\n<p>oppure riavvia il servizio<\/p>\n<pre>service lm_comsol start<\/pre>\n<p>Sistema gli script (\/mnt\/Linux\/bin) per far funzionare le cose comodamente in lab ( <strong>in grassetto le modifiche<\/strong>)<\/p>\n<h3>License.dat<\/h3>\n<p>Modifica il file license.dat in\u00a0\/mnt\/Linux\/COMSOL\/COMSOL52\/Multiphysics\/license in modo che contenga solo le seguenti righe:<\/p>\n<pre># SN=13074135\r\nSERVER 192.168.121.3 ANY 1718\r\nUSE_SERVER<\/pre>\n<p>&nbsp;<\/p>\n<h3>Comsol.m<\/h3>\n<p>Per prima cosa crea il file Comsol.m (script di matlab) nella nuova cartella di installazione \/mnt\/Linux\/COMSOL\/COMSOL52\/Comsol.m<\/p>\n<pre>if ispc\r\n disp ('Comsol runs only Linux') \r\nelse\r\n disp('Set matlab to use COMSOL server. Please Wait')\r\n <strong>addpath \/usr\/LDSS\/COMSOL\/COMSOL52\/Multiphysics\/mli<\/strong>\r\n !xterm comsol52server &amp;\r\n !sleep 5\r\n mphstart\r\n mphversion\r\nend<\/pre>\n<h3>comsol<\/h3>\n<p>Copia il vecchio script da comsol in comsol[vers precedente] (es comsol -&gt; comsol51) e modifica le righe in grassetto<\/p>\n<pre>#!\/bin\/bash\r\nclear\r\nciclo=0\r\nwhile [ $ciclo -eq 0 ] ; do\r\necho \"------------------------------\"\r\necho \" COMSOL Multiphisics option: \"\r\necho \"------------------------------\"\r\necho -n\r\necho \"[1] Comsol Multhiphysics \"\r\necho \"[2] Matlab + Comsol server \"\r\necho \"[3] Comsol Server\"\r\necho \"[q] quit\"\r\necho -n\r\n\r\nread ONE\r\n#read -p \"[1] Comsol Multhiphysics [2] Matlab + Comsol server [3] Comsol Server [q] quit : \" ONE\r\ncase \"$ONE\" in\r\n\"q\")\r\nexit\r\n;;\r\n\"1\" )\r\necho \"------------------------------\"\r\necho \"RUN Comsol Multhiphysics \"\r\necho \"------------------------------\"\r\necho -n\r\n<strong>\/usr\/LDSS\/COMSOL\/COMSOL52\/Multiphysics\/bin\/glnxa64\/comsol<\/strong>\r\nclear\r\n#ciclo=1\r\n;;\r\n\"2\" )\r\necho \"------------------------------\"\r\necho \"RUN Matlab + Comsol server\"\r\necho \"------------------------------\"\r\necho -n\r\n<strong>cd \/usr\/LDSS\/COMSOL\/COMSOL52\/<\/strong>\r\nmatlab -r Comsol\r\nclear\r\n#ciclo=1\r\n;;\r\n\r\n\"3\" )\r\necho \"------------------------------\"\r\necho \"RUN Comsol Server\"\r\necho \"------------------------------\"\r\necho -n\r\n<strong>\/usr\/LDSS\/COMSOL\/COMSOL52\/Multiphysics\/bin\/glnxa64\/comsol server<\/strong>\r\nclear\r\n#ciclo=1\r\n;;\r\n\r\n\r\n* )\r\n echo .\r\n echo \"#### Pirla lezi ben\" \r\n echo .\r\n echo .\r\n echo .\r\n echo .\r\n echo .\r\n\r\n;;\r\nesac\r\ndone<\/pre>\n<h3>comsolXXserver<\/h3>\n<p>crea un nuovo file per lanciare il nuovo comsol in modalit\u00e0 server:<\/p>\n<pre>#!\/bin\/bash\r\n<strong>\/usr\/LDSS\/COMSOL\/COMSOL52\/Multiphysics\/bin\/glnxa64\/comsol server<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<h4>Nota birbona<\/h4>\n<p>Se\u00a0sposti il license server da una VM ad un&#8217;altra ricordati di copiarti il Mac della scheda di ret che hai dato a Comsol per la registrazione. Se non ti ricordi il mac che hai dato leggi il file di log \u00a0alla riga:<\/p>\n<pre>SERVER line says xxxxxxxxxxxxx, hostid is \"[MAC]\"<\/pre>\n<p>e modifica di conseguenza<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note iniziali Per ottenere comsol scarica l&#8217;offline installer dal sito di comsol: https:\/\/www.comsol.it\/product-download La licenza ti viene inviata via mail ogni anno. Se cambi license-server devi chiedere un nuovo license.dat [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,13],"tags":[],"class_list":["post-478","post","type-post","status-publish","format-standard","hentry","category-how-to","category-linux","category-software"],"_links":{"self":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/comments?post=478"}],"version-history":[{"count":14,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/478\/revisions"}],"predecessor-version":[{"id":1101,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/478\/revisions\/1101"}],"wp:attachment":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/categories?post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/tags?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}