wiki:InstallFromSources

Install from sources

Windows NT (Cygwin)

It's possible to compile and run MCUSim on Windows NT using Cygwin at the moment. It cannot be compiled directly using Visual Studio because of a POSIX dependency. However, the whole process is pretty straightforward.

First of all, you'll need to download and run 64-bit or 32-bit version of the Cygwin installer. You'll have to select a proper directory to install Cygwin to, directory to keep downloaded packages and other options regarding Internet connection.

These packages are necessary to compile MCUSim correctly:

  • CMake 3.2+

  • Lua 5.2+ (including lua-devel package)

  • Make

  • Clang

Packages below can be installed if you're going to contribute to MCUSim:

  • Git (to manage MCUSim repository)

  • Artistic Style (to check code formatting)

You'll be able to configure MCUSim (using Cygwin Terminal installed together with all other packages):

dsl@DESKTOP-E88OTTU ~/mcusim-0.1.75/build
$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Release version of mcusim 0.1.75 will be built.
-- Set CMAKE_BUILD_TYPE=Debug to build a debug version.
-- Found Lua: /usr/lib/liblua-5.2.dll.a;/usr/lib/libm.a (found version "5.2.4")
-- Support for Lua-based peripherals will be enabled
-- Looking for fmax
-- Looking for fmax - found
-- Looking for include file netdb.h
-- Looking for include file netdb.h - found
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file errno.h
-- Looking for include file errno.h - found
-- Looking for include file poll.h
-- Looking for include file poll.h - found
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dsl/mcusim-0.1.75/build

build it:

dsl@DESKTOP-E88OTTU ~/mcusim-0.1.75/build
$ make
Scanning dependencies of target mcusim
[  7%] Building C object CMakeFiles/mcusim.dir/simcore.c.o
[ 14%] Building C object CMakeFiles/mcusim.dir/simm8a.c.o
[ 21%] Building C object CMakeFiles/mcusim.dir/simm328p.c.o
[ 28%] Building C object CMakeFiles/mcusim.dir/simm328.c.o
[ 35%] Building C object CMakeFiles/mcusim.dir/simm2560.c.o
[ 42%] Building C object CMakeFiles/mcusim.dir/ihex.c.o
[ 50%] Building C object CMakeFiles/mcusim.dir/getopt_long.c.o
[ 57%] Building C object CMakeFiles/mcusim.dir/peripheral_lua.c.o
[ 64%] Building C object CMakeFiles/mcusim.dir/peripheral_luaapi.c.o
[ 71%] Building C object CMakeFiles/mcusim.dir/decoder.c.o
[ 78%] Building C object CMakeFiles/mcusim.dir/avrsim.c.o
[ 85%] Building C object CMakeFiles/mcusim.dir/gdb_rsp.c.o
[ 92%] Building C object CMakeFiles/mcusim.dir/vcd_dump.c.o
[100%] Linking C executable mcusim.exe
[100%] Built target mcusim

and install it then:

dsl@DESKTOP-E88OTTU ~/mcusim-0.1.75/build
$ make install
[100%] Built target mcusim
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/mcusim.exe
-- Up-to-date: /usr/local/bin/mcusim-config

You can run tests also to check does mcusim work or not:

dsl@DESKTOP-E88OTTU ~/mcusim-0.1.75/build
$ make tests
Scanning dependencies of target tests
[100%] Generating TESTS
-- [TEST]: /home/dsl/mcusim-0.1.75/tests/ATMEGA8A-tc0-external-clock-source/test
mcusim 0.1.75 - microcontroller-based circuit simulator <https://trac.mcusim.org>
[TC0 checker] MCU clock: 16000kHz
[TC0 checker] MCU clock period: 0.0625us
[TC0 ext. clock] MCU clock: 16000kHz
[TC0 ext. clock] MCU clock period: 0.0625us
                  Model: ATmega8A
              Signature: 1E937
        Clock frequency: 16000.0 kHz
         Program memory: 0x0-0xFFF words
     Bootloader section: 0xC00-0xFFF words
            Data memory: 0x60-0x45F bytes
                 EEPROM: 0x0-0x1FF bytes
                     PC: 0x0 word
          Reset address: 0x0 word
Interrupt vectors table: 0x1 word
[TC0 checker] ticks passed: 2076
-- [END TEST]
-- [TEST]: /home/dsl/mcusim-0.1.75/tests/ATMEGA8A-tc2-fastpwm-mode/test
...
Last modified 5 weeks ago Last modified on Oct 10, 2018, 11:16:44 AM

Attachments (6)

Download all attachments as: .zip