DEVELOPING OOSIML SIMULATION MODELS. Using Codeblocks

Similar documents
IMPLEMENTING SCL PROGRAMS. Using Codeblocks

OOSIML SIMULATION MODELS. On Windows and Linux

USING CODEBLOCKS. Implementing Computational Models

USING THE OOSIML/JAVA COMPILER. With the Command Window

USING THE OOSIML/JAVA. With a Terminal Window

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

Manual Eclipse CDT Mac OS Snow Leopard

EECE.2160: ECE Application Programming Spring 2018 Programming Assignment #1: A Simple C Program Due Monday, 1/29/18, 11:59:59 PM

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

Navigating a Database Efficiently

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

User Guide. Introduction. Requirements. Installing and Configuring. C Interface for NI myrio

Code Blocks Cannot Find Compiler Executable Windows 7

TREX Set-Up Guide: Creating a TREX Executable File for Windows

A Tutorial on using Code::Blocks with Catalina 3.0.3

SIMPLE I/O WITH PYTHON

Organize Mail into Folders

FX SERIES. Programmer s Guide. Embedded SDK. MN000540A01 Rev. A

UNic Eclipse Mini Tutorial (Updated 06/09/2012) Prepared by Harald Gjermundrod

Open CASCADE Technology. Building OCCT with WOK CONTENTS

Com S 227 Assignment Submission HOWTO

Code::Blocks Student Manual

Dealing with Event Viewer

Package Manager. Managing Cisco VXC Manager Packages CHAPTER

To complete this database, you will need the following file:

To complete this database, you will need the following file:

Join Queries in Cognos Analytics Reporting

As CCS starts up, a splash screen similar to one shown below will appear.

Using Eclipse for C, MPI, and Suzaku

WRITING CONSOLE APPLICATIONS IN C

P&E Microcomputer Systems, Inc. PKGPPCNEXUS

Configure Outlook to use port 587 with authentication

Building And Integrating CppUnitLite in Eclipse on Linux

Building graphic-rich and better performing native applications. Pro. Android C++ with the NDK. Onur Cinar

CROSS-PLATFORM UTILITIES (CXUTILS) LIBRARY 2.0 USER DOCUMENTATION

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

Lab 1: Introduction to C Programming. (Creating a program using the Microsoft developer Studio, Compiling and Linking)

Module 3: Working with C/C++

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Assignment Submission HOWTO


Parallel Programming

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

Prerequisites for Eclipse

Scientific Software Development with Eclipse

Tutorial 1. Creating a Database

AN 834: Developing for the Intel HLS Compiler with an IDE

Laboratory Assignment #3 Eclipse CDT

Parallel Tools Platform for Judge

Tutorial: Modify UI 01 How to Load a UI Canvas Using Flow Graph

Using OpenGL & GLUT in Visual Studio.NET 2003

i2b2 Workbench Developer s Guide: Eclipse Neon & i2b2 Source Code

ncsa eclipse internal training

Eclipse/Websphere. Page 1 Copyright 2004 GPL License. All rights reserved.

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3. Installing Notepad++

Introduction. Opening and Closing Databases. Access 2010 Managing Databases and Objects. Video: Working with Databases in Access 2010

VikiLABS. July 8, 2017

1. Go to the URL Click on JDK download option

Getting Started with Eclipse/Java

Hello World on the ATLYS Board. Building the Hardware

Code::Blocks Student Manual

RVDS 3.0 Introductory Tutorial

Installation and Upgrade Guide Zend Studio 9.x

y

Applied Informatics POCO PRO C++ Frameworks

Excel window. This will open the Tools menu. Select. from this list, Figure 3. This will launch a window that

Tutorial: Deploying a Progress Corticon Decision Service as a Web Service for.net. Product Version: Corticon 5.6

Do this by creating on the m: drive (Accessed via start menu link Computer [The m: drive has your login id as name]) the subdirectory CI101.

Synaptic Labs' HyperBus Memory Controller (HBMC) Tutorial

Using Eclipse for Java. Using Eclipse for Java 1 / 1

Recalling Genotypes with BEAGLECALL Tutorial

MAIL MERGE LABELS USE THE MAIL MERGE WIZARD

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

Installation and Upgrade Guide Zend Studio 9.x

Application Note: 207

JMP to LSAF Add-in. User Guide v1.1

To complete this database, you will need the following file:

CS 261 Recitation 1 Compiling C on UNIX

EDEM Dynamics Coupling Quick Start Guide

Required Setup for 32-bit Applications

MS Word MS Outlook Mailbox Maintenance

JUCE TUTORIALS. INTRO methodology how to create a GUI APP and how to create a Plugin.

RVDS 4.0 Introductory Tutorial

Microsoft Power BI Tutorial: Importing and analyzing data from a Web Page using Power BI Desktop

Open Microsoft Word: click the Start button, click Programs> Microsoft Office> Microsoft Office Word 2007.

Communications Library Manual

Android Studio Setup Procedure

ECE QNX Real-time Lab

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

Opening Microsoft Visual Studio. On Microsoft Windows Vista and XP to open the visual studio do the following:

ST. JOHN FISHER COLLEGE

Microsoft Outlook Help Sheet ATTACHMENTS

Introduction to Linux

Using the GCC toolchain for Mulle SW development.

Online Backup Client User Manual

APPLICATION COMMON OPERATING ENVIRONMENT (APPCOE)

1. In Outlook click on the blue (2013) or yellow (2010) File tab in the top left corner of the window. 2. Click on + Add Account

Online Backup Client User Manual

How to build Simbody 2.2 from source on Windows

Transcription:

DEVELOPING OOSIML SIMULATION MODELS Using Codeblocks Dr. José M. Garrido Department of Computer Science Updated November 2016 College of Computing and Software Engineering Kennesaw State University c 2015, J. M. Garrido

Using CodeBlocks 2 1 Introduction There are several Integrated Development Environments (IDEs) that help developing programs written in C, C++, Fortran, and other programming languages. Eclipse is one of the most complete and powerful tools, it is mainly useful for Java programs and in general, it can be very slow. For C++, C, and Fortran programs, Codeblocks and CodeLite are faster, lighter, and more convenient tools to use. This document briefly explains implementing OOSimL simulation models and C++ programs using CodeBlocks on Linux. For a more detailed introduction to CodeBlocks, refer to various websites with CodeBlocks tutorial and documentation. For a simple but complete tutorial, visit the web page: ksuweb.kennesaw.edu/~jgarrido/oopsim. 2 Preparing CodeBlocks The following sequence of steps involve the basic procedure for setting the appropriate options on Codeblocks for using the OOSimL translator then the remaining steps for editing C++ programs, compiling, and linking with the simulation library, liboosimlc. 2.1 Download the OOSimL Translator The preliminary step required is the installation of the the OOSimL translator and the corresponding simulation library in the computer system running Linux. The 32-bit and the 64-bit versions of OOSimL translator are available on the web page mentioned previously. 1. Download the archive file oosimlc.tar.gz from the web page and extract all files from archive. 2. Select the executable file of the OOSimL translator (oosimlc.out for 32-bit Linux or oosimlc64.out for 64-bit Linux depending on the version of Linux your computer (32-bit or 64-bit). Rename oosimlc64.out to oosimlc.out in a 64-bit Linux. This executable file, the compl script file and the oosiml.h file must be stored on a folder such as ~/oosiml.

Using CodeBlocks 3 2.2 Setting the Codeblocks Options 1. Start CodeBlocks and click on Create a new project. 2. On the top bar click on the Settings menu, then select Compiler. A dialog box appears. On the tab group, activate the Other Options tab, and click the button Advanced options located on the lower right of the dialog box. 3. Click the Yes button when the box Edit advanced compiler setting? appears. 4. On the new window that appears, click the + button and type osl in the dialog box. This indicates that the OOSimL files have an osl extension. 5. Type the Command line macro that will be used by CodeBlocks to execute the translator with a given OOSimL source file. For example: ~/oosiml/oosimlc $file Type the Generated files, which are C++ files, $file name.cpp This assumes that the OOSimL translator ( executable file oosimlc.out) is located in a folder named: ~/oosiml 6. Click the Ok button located on the bottom of the window. Codeblocks is now configured to recognize source files with an osl extension for editing and to execute the OOSimL translator. 2.3 Using Codeblocks 1. Select Console Application and click the Go button, which is located on the upper right corner of the window. 2. On the Console Application window, click the Next button. Select C++ language and click Next. 3. Type the project title (name), e.g. Carwash. In this example, the project will be created in folder: /home/jgarrido/oosiml/models. Click the Next button. 4. Select GNU GCC Compiler and click the Finish button. 5. Activate the left pane of the screen (Management), click the Projects tab. Remove the source file main.c by right-clicking on it and selecting delete file.

Using CodeBlocks 4 6. A new source file can be created by selecting File menu, then New, and Empty file. Click Yes to add this empty to the project. A new dialog window appears, type the name of the file with its scl extension. Now you can start editing this source file and when finished, save the file. 7. If one or more existing source files are to be included in the project, select the Project menu on the top bar, or right-click on the project name. Select Add files. Select the directory of the source to add to the project and select the OOSimL source file(s). Click Open. 8. The source files are now under Others and under the project name. Doubleclick on the desired source file to edit it further. The file now appears on the edit area of the screen. 9. Right-click on the current project name, or activate the Project menu in the top bar, and select Build options. (a) On the tab Compiler settings, check Enable all compiler warnings. (b) On the tab Linker settings, click the Add button to add a library to the project. Repeat to add all necessary object files and libraries. For a typical simulation model, at the minimum, the libraries oosimlc (in file liboosimlc.a), pthread, and m (standard math library) are necessary. (c) On the tab Search directories and the tab Compiler, add the search directory for header files required by the source program while compiling. Assume the header files required by the programs are located in the folder ~/oosiml. (d) On the tab Search directories and the tab Linker, add the search directory of the libraries if needed. On Linux (Ubuntu), the external libraries are always stored in standard system directories. The local library oosimlc library can be stored in any location, for example ~/oosiml. For this, click the Add button, then click (... ) and navigate to the appropriate directory. 10. Build the project, which translates the OOSimL source file, then compiles and links the C++ files in the project. On the top bar, select the Build menu and select the Build option. The Build log appears in the lower pane of the Codeblocks screen. 11. To execute the program, select the Run option in the Build menu. A new screen appears with the results of the execution. After the program terminates execution, press the Enter key.

Using CodeBlocks 5 12. On the top bar, activate the File menu and select Close project. In the examples described previously, the project was created in the directory ~/oosiml/ models, Codeblocks creates several new subdirectories and the executable file in located in the directory ~/oosiml/models/carwash/bin/debug.