csatblogspotdotcom

Saturday, February 11, 2017

Ubuntu命令行以静默模式安装matlab

参考: https://zhuanlan.zhihu.com/p/23633624 (以此为准) http://m.sodocs.net/doc/3b1c7863a98271fe910ef927.html http://blog.csdn.net/wangpengfei163/article/details/47311041 虚拟机Ubuntu server无桌面,命令行静默模式(silent mode)安装matlab使用如下命令: sudo /media/cdrom/install -inputFile /home/alex/matlab/installer_input.txt 其中第一张(共两张)DVD sudo mount /dev/cdrom /media/cdrom/ 装入后,执行里面的/media/cdrom/install(网友建议不要在/media/cdrom目录执行install),inputFile为installer_input.txt,相关参数在里面,内容如下(井号为注释): ################################################################## ## ## Use this file to specify parameters required by the installer at runtime. ## ## Instructions for using this file. ## ## 1. Create a copy of this template file and fill in the required ## information. ## ## 2. Uncomment only those lines that start with a single '#' ## and set the desired values. All allowed values for the ## parameters are defined in the comments section for each ## parameter. ## ## 3. Launch the installer from the command line, using the -inputFile option ## to specify the name of your installer initialization file. ## ## (Windows) setup.exe -inputFile ## (Mac/Unix) install -inputFile ## ## NOTE: ## If you want to run the activation application in silent ## mode immediately after the installer completes, you must create ## an activation initialization file and specify its name as the ## value of the activationPropertiesFile= option. You can also ## pass the name of the activation initialization file to the ## installer using the -activationPropertiesFile command line ## option. ## ################################################################## ## ## ## SPECIFY INSTALLATION FOLDER ## ## Example: ## (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX ## (Unix) destinationFolder=/usr/local/RXXXX ## (Mac) destinationFolder=/Applications ## ## Set the desired value for destinationFolder and ## uncomment the line. # destinationFolder= ## ## SPECIFY FILE INSTALLATION KEY ## ## Example: fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx..... ## ## Set the desired value for fileInstallationKey and ## uncomment the line. ## fileInstallationKey=09806-07443-53955-64350-21751-41297 ## ## ACCEPT LICENSE AGREEMENT ## ## You must agree to the license agreement to install MathWorks products. ## The license agreement can be found in the license_agreement.txt file at the ## root level of the installation DVD. ## ## Example: agreeToLicense=yes ## ## Set agreeToLicense value to yes or no and ## uncomment the line. agreeToLicense=yes ## ## SPECIFY OUTPUT LOG ## ## Specify full path of file into which you want the results of the ## installation to be recorded. ## ## Example: ## (Windows) outputFile=C:\TEMP\mathworks_.log ## (Unix/Mac) outputFile=/tmp/mathworks_.log ## ## Set the desired value for outputFile and ## uncomment the line. outputFile=/home/alex/matlab/mathworks_matlab_install.log ## SPECIFY INSTALLER MODE ## ## interactive: Run the installer GUI, waiting for user input on all ## dialog boxes. ## ## silent: Run the installer without displaying the GUI. ## ## automated: Run the installer GUI, displaying all dialog boxes, but only ## waiting for user input on dialogs that are missing required ## input. ## ## Set mode value to either interactive, silent, or automated and ## uncomment the line. mode=silent ## SPECIFY LENGTH OF TIME DIALOG BOXES ARE DISPLAYED ## ## Specify how long the installer dialog boxes are displayed, in milliseconds. ## ## NOTE: Use this value only if you set the installer mode to automated. ## ## By default, the dialog boxes display on the screen for one second. ## ## Example: (To specify a value of 1 second.) automatedModeTimeout=1000 ## ## Set the desired value for automatedModeTimeout and ## uncomment the line. # automatedModeTimeout= ## SPECIFY ACTIVATION PROPERTIES FILE (For non-network license types only) ## ## Enter the path to an existing file that contains properties to configure ## the activation process. activationPropertiesFile=/home/alex/matlab/activate.ini ########## Begin: Options for Network License Types ######### ## ## SPECIFY PATH TO LICENSE FILE (Required for network license types only) ## ## This value is required when installing either the License Manager or when ## installing as a Network End-User ## Example: ## (Windows) licensePath=C:\TEMP\license.dat ## (Unix) licensePath=/tmp/license.dat ## Set the desired value for licensePath and ## uncomment the line. # licensePath= ## CHOOSE TO INSTALL LICENSE MANAGER (For network license types only) ## ## Installs license manager files to disk. ## ## NOTE: You only need to install the license manager files ## on your license server. ## ## Set lmgrFiles value to true or false and ## uncomment the line. # lmgrFiles= ## INSTALL LICENSE MANAGER AS A SERVICE (For network license types only) ## ## Configure the license manager as a service on Windows. ## ## NOTE: Not applicable for Unix or Mac. ## ## NOTE: The lmgr_files option (set in previous step) must also be set to true. ## ## Set lmgrService value to true or false and ## uncomment the line. # lmgrService= ########## End: Options for Network License Types ######### ################# Begin - Windows Only Options ################ ## ## CHOOSE TO SET FILE ASSOCIATIONS ## ## Set to true if you want the installer to associate file types used by MathWorks ## products to this version of MATLAB, or false if you do not want the installer to ## associate MathWorks file types with this version of MATLAB. ## ## Default value is true. ## ## Set setFileAssoc value to true or false and ## uncomment the line. # setFileAssoc= ## ## CHOOSE TO CREATE WINDOWS DESKTOP SHORTCUT ## ## Set to true if you would like the installer to create a desktop shortcut icon ## when MATLAB is installed or false if you don't want the shortcut created. ## ## Set desktopShortcut value to true or false and ## uncomment the line. # desktopShortcut= ## CHOOSE TO ADD SHORTCUT TO WINDOWS START MENU ## ## Set to true if you would like the installer to create a Start Menu shortcut ## icon when MATLAB is installed or false if you don't want the shortcut created. ## ## Set startMenuShortcut value to true or false and ## uncomment the line. # startMenuShortcut= ## CREATE a MATLAB Startup Accelerator task ## ## The MATLAB Startup Accelerator installer creates a ## system task to preload MATLAB into the system▒s cache ## for faster startup. ## ## NOTE: By default, a MATLAB Startup Accelerator task will ## automatically be created. ## ## If you want a MATLAB Startup Accelerator task to be created, ## do not edit this section. ## ## Set createAccelTask value to false if you do not want to ## create an Accelerator task and uncomment the line. # createAccelTask= ## Enable Login Named User licensing ## ## Set to Yes to enable use of a Login Named User license for all users of this MATLAB installation ## Users must log in to their MathWorks Account when MATLAB starts. ## ## Example: enableLNU=yes ## ## NOTE: This flag is valid in silent installations only. # enableLNU=yes ################ End - Windows Only Options ################ ## SPECIFY PRODUCTS YOU WANT TO INSTALL ## ## By default, the installer installs all the products and ## documentation for which you are licensed. Products you are not licensed for ## are not installed, even if they are listed here. ## ## Note: ## 1. To automatically install all your licensed products, do not edit ## any lines in this section. ## ## 2. To install a specific product or a subset of products for ## which you are licensed, uncomment the line for the product(s) you want ## to install. #product.Aerospace_Blockset #product.Aerospace_Toolbox #product.Antenna_Toolbox #product.Audio_System_Toolbox #product.Bioinformatics_Toolbox #product.Communications_System_Toolbox #product.Computer_Vision_System_Toolbox #product.Control_System_Toolbox #product.Curve_Fitting_Toolbox #product.DO_Qualification_Kit #product.DSP_System_Toolbox #product.Data_Acquisition_Toolbox #product.Database_Toolbox #product.Datafeed_Toolbox #product.Econometrics_Toolbox #product.Embedded_Coder #product.Filter_Design_HDL_Coder #product.Financial_Instruments_Toolbox #product.Financial_Toolbox #product.Fixed_Point_Designer #product.Fuzzy_Logic_Toolbox #product.Global_Optimization_Toolbox #product.HDL_Coder #product.HDL_Verifier #product.IEC_Certification_Kit #product.Image_Acquisition_Toolbox #product.Image_Processing_Toolbox #product.Instrument_Control_Toolbox #product.LTE_System_Toolbox #product.MATLAB #product.MATLAB_Coder #product.MATLAB_Compiler #product.MATLAB_Compiler_SDK #product.MATLAB_Distributed_Computing_Server #product.MATLAB_Production_Server #product.MATLAB_Report_Generator #product.Mapping_Toolbox #product.Model_Predictive_Control_Toolbox #product.Model_Based_Calibration_Toolbox #product.Neural_Network_Toolbox #product.OPC_Toolbox #product.Optimization_Toolbox #product.Parallel_Computing_Toolbox #product.Partial_Differential_Equation_Toolbox #product.Phased_Array_System_Toolbox #product.Polyspace_Bug_Finder #product.Polyspace_Code_Prover #product.RF_Toolbox #product.Risk_Management_Toolbox #product.Robotics_System_Toolbox #product.Robust_Control_Toolbox #product.Signal_Processing_Toolbox #product.SimBiology #product.SimEvents #product.SimRF #product.Simscape #product.Simscape_Driveline #product.Simscape_Electronics #product.Simscape_Fluids #product.Simscape_Multibody #product.Simscape_Power_Systems #product.Simulink #product.Simulink_3D_Animation #product.Simulink_Code_Inspector #product.Simulink_Coder #product.Simulink_Control_Design #product.Simulink_Design_Optimization #product.Simulink_Design_Verifier #product.Simulink_Desktop_Real_Time #product.Simulink_PLC_Coder #product.Simulink_Real_Time #product.Simulink_Report_Generator #product.Simulink_Test #product.Simulink_Verification_and_Validation #product.Spreadsheet_Link #product.Stateflow #product.Statistics_and_Machine_Learning_Toolbox #product.Symbolic_Math_Toolbox #product.System_Identification_Toolbox #product.Trading_Toolbox #product.Vehicle_Network_Toolbox #product.Vision_HDL_Toolbox #product.WLAN_System_Toolbox #product.Wavelet_Toolbox 里面涉及的 activate.ini 内容为(同样的,井号为注释): ################################################################## # # Name: activate.ini # # Copyright 2008-2010 The MathWorks, Inc. # # Purpose: Activation application initialization file template. # Use this file to specify parameters required by the activation # application at runtime. This file provides the activation # application with required input without using the GUI. # # INSTRUCTIONS FOR RUNNING IN SILENT MODE # # To run the activation application in silent mode: # # 1. Create a copy of this template file and fill in the required # information. # # 2. Navigate to the folder containing the activation application. # (Windows) $MATLABROOT\bin\$ARCH # (Mac/Linux) $MATLABROOT/bin # # 3. Launch the activation application from the command line, # using the -propertiesFile option to specify the name of your # activation initialization file. # # (Windows) activate_matlab.exe -propertiesFile # (Mac/Linux) activate_matlab.sh -propertiesFile # # NOTE: If you want to perform silent activation automatically # after performing silent installation, specify the name of your # activation initialization file as the value of the # activationPropertiesFile= option in the installer initialization # file (installer_input.txt). This option causes the installer # to launch the activation application in silent mode. You can # also specify the activation initialization file as an argument # when you launch the installer, using the -activationPropertiesFile # option. # # NOTE: When run in silent mode, the activation application does # not display the activation dialog boxes. # ################################################################## # # SPECIFY ACTIVATION MODE # # Specify whether or not to run in silent mode. # # Valid values: true / false # # Default: isSilent=true. isSilent=true # # SPECIFY ACTIVATION TYPE (Required) # # Specify the type of activation you want to do. # # Valid values: activateDcAnon / activateOffline activateCommand=activateOffline # # SPECIFY LICENSE FILE LOCATION (Required if activateCommand=activateOffline) # # If you specified the activation type activateOffline, you # must specify the location of the License File that you want # to install. # # Mac/Linux example: # licenseFile=/Central/license.dat # # Windows example: # licenseFile=C:\license.dat licenseFile=/home/alex/matlab/crack/license_standalone.lic # # SPECIFY ACTIVATION KEY (Required if activateCommand=activateDcAnon) # # If you specified the activation type activateDcAnon,you must # specify a valid Activation Key. # # Example: activationKey=55555-55555-55555-55555 activationKey= # # SPECIFY LICENSE FILE DESTINATION DIRECTORY (Optional) # # Specify the directory into which you want to install the license file. # You must specify the full path of a directory that already exists. # # NOTE: This option is only for advanced users since it could make MATLAB # unable to start without specifying special options. # # Mac/Linux example: # installLicenseFileDir=/Central/LicenseDirectory # # Windows examples: # installLicenseFileDir=C:\License Directory installLicenseFileDir= # # SPECIFY NAME OF INSTALLED LICENSE FILE (Optional) # # Specify the name of the installed License File. The file name # must have with either .lic or .dat file extension. # # Example: installLicenseFileName=license.dat installLicenseFileName= 相关日志记录在 mathworks_matlab_install.log 中,中途换上第二张DVD: sudo umount /media/cdrom 以及 sudo mount /dev/cdrom /media/cdrom/ 接下来是激活,将crack/R2016b/bin/glnxa64/里的4个lib:libcufft.so.7.5.18、libinstutil.so、libmwlmgrimpl.so、libmwservices.so复制到/usr/local/MATLAB/R2016b/bin/glnxa64/(/usr/local/MATLAB/R2016b/是默认安装目录,注意复制后的文件权限),同时将crack/license_standalone.lic复制到/usr/local/MATLAB/R2016b/licenses/(licenses目录是自己创建的,注意目录权限,命令:sudo cp license_standalone.lic /usr/local/MATLAB/R2016b/licenses),即可运行matlab了:sudo /usr/local/MATLAB/R2016b/bin/matlab,但此时bin目录不在环境变量中,无法直接使用matlab。 后记20170212: 1.执行 sudo chmod -R a+rX R2016b/ (-R表示递归,a表示所有用户包括u(ser)、g(roup)、o(ther),+rX表示增加读权限、可执行权限,大写X表示在此条件下增加可执行权限:目标为目录或对某用户已经具有可执行权限execute/search only if the file is a directory or already has execute permission for some user),使所有用户均有权限访问matlab目录,并可使用matlab; 2.执行 sudo ln -s /usr/local/MATLAB/R2016b/bin/matlab /usr/local/bin/matlab 使matlab命令可直接执行,不用指定具体路径,因为/usr/local/bin已包含在环境变量$PATH中;或者将 /usr/local/MATLAB/R2016b/bin/ 添加至$PATH(可在~/.profile中添加)也可直接执行matlab;由于本机上 PATH="$HOME/bin:$PATH" 于是直接在~/bin/ 中创建软链接 ln -s /usr/local/MATLAB/R2016b/bin/matlab ~/bin/matlab 即可; 3.昨天在安装完matlab后,需root权限执行,于是给 /usr/local/MATLAB/R2016b/ 递归加上可读、可执行权限,但在加完r可读权限后,再看之前没权限的目录,例如ls -al **,内容全变为问号,开始以为出了啥差错,后来发现原来是文件夹有可读权限但没有可执行权限时,ls -al 该文件夹时,可以看到里面的文件,但显示出来的属性内容全为问号,只有该文件夹具备的可执行权限时,才看得到属性,也就是说,可读权限决定是否看得到内容,可执行权限决定是否看得到内容的属性; 4.安装完提示如下: Your installation may require additional configuration steps. 1. The following products require a supported compiler: Stateflow 8.8 Simulink Coder 8.11 MATLAB Coder 3.2 Simulink Test 2.1 2. Simulink requires a C compiler for simulation acceleration, model reference, and MATLAB Function Block capabilities. It is recommended that you install a supported compiler on your machine. 3. To accelerate computations with the following products, a supported compiler is required: SimBiology 5.5 Fixed-Point Designer 5.3 4. After this installation is complete, you should continue with your configuration of the MATLAB Distributed Computing Server as outlined in the instructions obtained from www.mathworks.com/distconfig. 5. MATLAB Compiler SDK 6.3 requires the following: ● a supported compiler for creation of C and C++ Shared libraries ● a Java JDK for creation of Java packages (Feb 11, 2017 22:16:24) Exiting with status 0 (Feb 11, 2017 22:16:39) End - Successful. VM Ubuntu 64 之前已安装好gcc、g++,Java也装了 (java -version 显示 : java version "1.7.0_121" OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8-1ubuntu0.14.04.3) OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode) ) 使用如下两个命令重新配置下: /usr/local/MATLAB/R2016b/bin/mbuild -setup 输出: MBUILD configured to use 'gcc' for C language compilation. To choose a different language, execute one from the following: mex -setup C++ -client MBUILD mex -setup FORTRAN -client MBUILD 以及 /usr/local/MATLAB/R2016b/bin/mex -setup 输出: MEX configured to use 'gcc' for C language compilation. Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html. To choose a different language, execute one from the following: mex -setup C++ mex -setup FORTRAN

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home