Giter VIP home page Giter VIP logo

franke-hub / sdl Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 22.07 MB

Software Development Laboratory: A Cygwin/Linux build environment separating source and object. Multiple language sample programs included.

License: Other

Shell 1.90% Python 3.44% Assembly 0.59% C++ 73.85% M4 0.45% C 1.52% Makefile 0.42% Batchfile 0.10% Roff 0.32% Nemerle 0.14% HTML 0.12% Gnuplot 0.09% Forth 0.01% Java 12.29% JavaScript 0.46% LilyPond 0.58% 1C Enterprise 0.01% C# 2.16% Perl 0.01% SWIG 1.56%
cpp python java libraries lily examples x11 xcb multithreading csharp

sdl's Introduction

~/README.md

Copyright (C) 2020-2023 Frank Eskesen.

This file is free content, distributed under the MIT license. (See the accompanying file LICENSE.MIT or the original contained within https://opensource.org/licenses/MIT)

Content overview

This is a Software Development Laboratory (SDL) distribution package, sometimes referred to as "The Distribution".

This package contains multiple programming examples in multiple languages. C++, Python, and Java examples also include libraries. A (mostly) bash script library is also provided.

Compiled libraries, sample programs and utilities are built using GNU make from the associated object subdirectory.

Programs are compiled and tested on CYGWIN and Linux (Fedora and Ubuntu.) While there are some sample programs that once ran on Windows, Windows support is deprecated and is no longer tested.

All content is distributed AS-IS, without purpose or warranty of any kind; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Copying

This is an open source project, consisting of free content distributed under an open source license.

While the distribution author retains the open source copyright and licensing rights, no additional restrictive rights are or will be claimed. In particular but not exclusively, the author warrants that no trade mark or patent rights exist and none will be generated for any content in this distribution. This distribution is and will remain open source.

ALL content in this distribution may be copied, but

  • Your license is not exclusive. No person or entity can restrict any other person or entity's usage of any content.
  • Imported content retains the copyright, copying and licensing restrictions of the original author (or source, if no copyright information was included in the imported content.) Every SDL distribution file containing imported content contains originating copyright and licensing information

Small content segments may be copied under the public domain license without attribution or licensing requirements1. Any significant aggregation of content segments requires the GNU GPL including its attribution and licensing requirements.

Contributors

Licensing

All imported content retains the copyright and licensing restrictions of the original authors.

Most original C++ source code is distributed under the GNU Public License. Most original include headers are distributed under the Lesser GPL.

Most documentation, such as this file, and control files (e.g. make files) is distributed using the MIT license.

The Creative Commons license is used (at least) for Lilypond (music) files.

Some example content explictly uses the public domain license. This content does not require attribution or licensing1.

Any and all "look and feel" content in this entire distribution is explicitly licensed under the public domain license.

License detail:

Installation and running

These instructions assume that you'll be using the SDL package as delivered.

Use . setupSDL to set up the $SDL_ROOT environment variable and update your $PATH environment variable. (You might want to look at and modify setupSDL first.)

Now, from the installation root subdirectory, use make for configuration control.

  • make (without options) lists available options
  • make install Creates or updates:
    • bin: Installs library and regression test prerequisite files.
    • obj/cpp: Installs lib (an include library) and dll (a dll library.)
  • make reinstall Uninstalls and then installs. Use this after installing a new Linux version.
  • make uninstall Removes all files created by make install.
  • make check Runs all available test suites.
  • make compile Compiles (but does not test) all sample programs.
  • make clean Removes all files created by make check and make compile.
  • make pristine Essentially the same as running make clean followed by make uninstall.

TODO Implement C# and Java library installation Makefiles. (Only C++ and Python library Makefiles are currently implemented.)

The Distribution

The distribution primarily uses two git branches:

  • The trunk branch, relatively well tested.
  • The maint branch, more current but more unstable. This branch may contain known errors when used for distribution testing.

The distribution is kept locally in /home/data/SDL on all local machines, physical or virtual. In addition to this public distribution, the /home/data/ subdirectory contains private information shared via rsync between machines. One of these machines (NFS) exports /home/data in read-only mode and some local virtual machines access that.

An Ubuntu build test (virtual) machine updates only via github. It does not access the exported /home/data Network File System. It's used to verify maint and trunk releases operate properly as distributed, and does not access the NFS file system.

Subdirectory structure:

(Root) The distribution root directory, *designated as ~*
   ~
   |
   [-- bat ((Mostly bash) scripts)
   |
   [-- doc (Documentation)
   |
   [-- obj (Object files)
   |    |
   |    [-- cpp  (C++)
   |    |
   |    [-- java (Java)
   |    |
   |    [-- mcs  (C#)
   |    |
   |    [-- py   (Python)
   |
   [-- src (Source files)
   |    |
   |    [-- cpp
   |    |
   |    [-- java
   |    |
   |    [-- mcs
   |    |
   |    [-- py
   |
   [-- usr (Not distributed. Used for machine to machine backup.)

Multiple libraries are also provided:

   ~
   |
   [-- obj
   |    |
   |    [-- cpp/lib (The library subdirectory)
   |    |      |
   |    |      [-- com (The common library: oldest)
   |    |      |
   |    |      [-- dev (The development library: experimental)
   |    |      |
   |    |      [-- gui (The Graphical User Interface library)
   |    |      |
   |    |      [-- obj (The object library)
   |    |      |       (Objects are reference count deleted)
   |    |      |
   |    |      [-- pub (The public library: in active development)
   |    |      |
   |    |   cpp/lib/*/Test (Library test object/executables)
   |    |
   |    [-- [java,js,mcs]/lib
   |    |
   |    [-- py/site-packages (The python library subdirectory)
   |    |      |
   |    |   The python library
   |
   [-- src
   |    |
   |    [-- cpp/inc (Header files)
   |    [-- cpp/lib (Source files)
   |    |      |
   |    |      [-- com
   |    |      |
   |    |      [-- dev
   |    |      |
   |    |      [-- gui
   |    |      |
   |    |      [-- obj
   |    |      |
   |    |      [-- pub
   |    |      |
   |    |   cpp/lib/*/Test (Library test source)
   |    |
   |    [-- [java,mcs]/lib
   |    |
   |    [-- py/site-packages

All C++ libraries have an associated Test subdirectory: ~/src/cpp/lib/*/Test The dev and pub libraries also have a regression test script, regression, used for distribution testing. These can be invoked from the root directory using make check.

For C++ programs, two build helper programs are required. These programs are built in the ~/obj/cpp/sys/ subdirectory and installed into $HOME/bin using make install. (The $HOME/bin directory location is not currrently configurable.)

  • makeproj: Used to create or update dependencies.
  • filecomp: Used in regression testing to (partially) compare files.

In addition to the libraries, (many) sample programs are provided.

TODO Document the sample programs.

The project Wiki contains complete build instructions starting from an "Ubuntu Desktop for developers" package.

Further reading

Footnotes

  1. Once something is given or released to the public domain, no person or entity can then claim exclusive ownership of it. (This also applies to the original author.) 2

sdl's People

Contributors

franke-hub avatar

Stargazers

 avatar

Watchers

 avatar

sdl's Issues

dev Client/Server deadlock processing close operation

Client and Server inp_task close processing deadlocks because inp_task invokes close which removes the last shared_ptr reference. Even adding a "keep_alive" shared_ptr in task_inp doesn't help enough because the Client/Server destructor is still invoked under task_inp control before it returns control to the Dispatcher. The deadlock occurs since in Dispatch::Task::~Task a wait operation is enqueued and waited for while task_inp is running, and the wait operation processing can't begin until task_inp returns control to the Dispatcher.

FIX: In inp_task, we defer posting of the CLOSE work Item by transferring close work Items onto an internal Dispatcher task (which was created for this purpose.) When that Task posts the CLOSE work item, the last Client/Server shared pointer reference is removed. Task destruction runs under the internal Dispatcher Task, thus removing the deadlock.

Note: This fix will be committed to the maint branch, which still contains extensive debugging code. When testing successfully completes this issue will be closed, the extensive debugging code will be removed, and the maint branch merged into the trunk.

Remove JPEG source file installation dependency.

Instead of downloading the JPEG source, modifying and compiling it, use jpeg libraries provided by distributions. Besides making it easier to build the other libraries, it's probably simpler to fix it than to document the current work-around.

Multithread dispatch::Task timing exposure

In the pub library, when a dispatch::Task terminates a timing exposure can result in the Task being referenced after it's deleted. An attempted fix for this problem is incomplete and the exposure remains.

The exposure is as follows:

  1. Dispatch.cpp method work is iterating the itemList. All queued work has been processed and posted.
  2. The iterator is incremented, but the running thread's time slice end's before the it == itemList.end() check.

This leave a dangling reference to the itemList. When the check is finally made, the associated itemList might have been deallocated. The current attempted fix enqueues another (final) request onto the list and waits for that to complete. However, there's no guarantee that the exposure won't recur while processing that final request.

To fix this, defer processing the final request until after the it == itemList.end() check, after the iteration completes. At that point no dangling references to the list exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.