18 | | 1. Locate the WARPLab MEX UDP Transport source in one of the following locations: |
19 | | 1. {{{<Unpacked WARPLab Reference Design Directory>\M_Code_Reference\mex\}}} |
20 | | 1. [source:/ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/mex /ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/mex] |
21 | | 1. {{{svn co http://warpproject.org/svn/WARP/ResearchApps/PHY/WARPLAB/WARPLab7/M_Code_Reference/mex}}} |
22 | | 1. TBD - |
23 | | 1. Verify wl_mex_udp_transport is recognized by running {{{wl_mex_udp_transport('version');}}} on the MATLAB command line. The output should print the version number. For example: |
| 28 | 1. Within MATLAB, change your directory to the M_Code_Reference directory that you unpacked as part of the WARPLab release. |
| 29 | 1. Run {{{ wl_setup }}} in order to set up your MATLAB paths. When running {{{ wl_setup }}}, you should only see the java transport available. If not, please check your paths to make sure there are no issues. |
| 30 | * Now your paths should be set up to proceed. Run {{{ which wl_mex_udp_transport }}} to check that you can see the mex files. You should see: {{{ <your WARPLab install dir>/M_Code_Reference/mex/wl_mex_udp_transport.m }}} |
| 31 | 1. Run {{{ wl_mex_udp_transport }}} from the MATLAB command line: |
| 32 | {{{ |
| 33 | >> wl_mex_udp_transport |
| 34 | WARPLab wl_mex_udp_transport Setup |
| 35 | Would you like [1] Manual (default) or [2] Automatic compliation? |
| 36 | Selection: |
| 37 | }}} |
| 38 | * You have the ability to run either the manual or automatic compilation. |
| 39 | |
| 40 | === Manual Compilation === |
| 41 | |
| 42 | If you run the manual compilation, MATLAB will print out the compilation steps: |
| 43 | |
| 44 | {{{ |
| 45 | Manual Compliation Steps: |
| 46 | 1) Please familiarize yourself with the process at: |
| 47 | http://warpproject.org/trac/wiki/WARPLab/MEX |
| 48 | to make sure your environment is set up properly. |
| 49 | 2) Set up mex to choose your compiler. (mex -setup) |
| 50 | 1. Select "Yes" to have mex locate installed compilers |
| 51 | 2. Select "Microsoft Visual C++ 2010 Express" |
| 52 | 3. Select "Yes" to verify your selections |
| 53 | 3) Change directory to M_Code_Reference/mex (cd mex) |
| 54 | 4) Run the compile command: |
| 55 | mex -g -O wl_mex_udp_transport.c -lwsock32 -lKernel32 |
| 56 | 5) Re-run wl_setup and make sure that "WARPLab Mex UDP" is an available transport. |
| 57 | }}} |
| 58 | |
| 59 | === Automatic Compilation === |
| 60 | |
| 61 | If you run the automatic compilation, the code will attempt to compile the mex using the compiler you installed from the [wiki:../../howto/MEX_Compile How-To Compile MEX] guide. |
| 62 | |
| 63 | {{{ |
| 64 | >> wl_mex_udp_transport |
| 65 | WARPLab wl_mex_udp_transport Setup |
| 66 | Would you like [1] Manual (default) or [2] Automatic compliation? |
| 67 | Selection: 2 |
| 68 | |
| 69 | Running Automatic Setup procedure: ...Done. |
| 70 | |
| 71 | *************************************************************** |
| 72 | *************************************************************** |
| 73 | Please re-run wl_setup to use your "WARPLab Mex UDP" transport. |
| 74 | *************************************************************** |
| 75 | *************************************************************** |
| 76 | }}} |
| 77 | |
| 78 | If there are any issues, please follow the prompts to set up the compiler (ie you will be running {{{ mex -setup }}}) and then re-run {{{ wl_udp_mex_transport }}} and the compilation should succeed. |
| 79 | |
| 80 | |
| 81 | === Finalizing Your MEX install === |
| 82 | |
| 83 | Please make sure to re-run {{{ wl_setup }}} so that you can choose the WARPLab MEX transport to use with WARPLab. You can verify that the transport is recognized by running {{{wl_mex_udp_transport('version');}}} on the MATLAB command line. The output should print the version number. For example: |
33 | | NOTE: simply re-running 'wl_setup' and selecting java is sufficient for switching back to the built-in java routines. You do not need to explicitly remove wl_mex_udp_transport from your MATLAB path. |
| 92 | |
| 93 | NOTE: simply re-running {{{ wl_setup }}} and selecting java is sufficient for switching back to the built-in java routines. You do not need to explicitly remove wl_mex_udp_transport from your MATLAB path. |
| 94 | |
| 95 | NOTE: once you have correctly compiled your wl_mex_udp_transport, you will no longer be able to just run {{{ wl_udp_mex_transport }}}. This will result in a usage error because now you need to use the functions within the transport. |
| 96 | |
| 97 | === Transport Documentation === |
| 98 | |
| 99 | While the source code is heavily commented, you can always run: |
| 100 | {{{ |
| 101 | help wl_mex_udp_transport |
| 102 | }}} |
| 103 | on the MATLAB command line and it will print out the help information as well as the usage. |
| 104 | |
| 105 | If you have any additional questions, please let us know on [http://warpproject.org/forums/ the WARP forums]. |
| 106 | |
| 107 | |
| 108 | |