Commit 4c4c4eba authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Dropped autotools for cmake & reoranized project

Converted from autotools to cmake, and totally reorganized project in
the process:
- headers now live in include/eris, e.g. include/eris/firm/PriceFirm.hpp
- The scripts that were in src (bundle-test, test, etc.) are now in
  scratch
- 'make' (no arguments) now builds liberis.so
- 'make scratch' builds the .cpp files in scratch/ and links them to
  liberis.so
- Builds now use -Wall -Werror (really).  Caught and fixed some warnings
  (masked methods from mismatched derived signatures)
- This should pave the way for adding gtest tests
parent cefd5844
......@@ -20,7 +20,4 @@ a.out
.swp
# Build files
Makefile
/config.log
/config.status
/autom4te.cache/
/build/
project(Eris)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
# No in-source building
include(MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out-of-source build. Create a build directory and run 'cmake ${CMAKE_SOURCE_DIR} [options]'.")
include_directories(include)
file(GLOB_RECURSE eris_src src/*.cpp)
add_definitions(-std=c++11 -Wall -Werror)
add_library(eris SHARED ${eris_src})
add_subdirectory(scratch)
SUBDIRS = src
dist_doc_DATA = README
This diff is collapsed.
LICENCE
-------
Eris - agent based economic modelling library
Copyright (C) 2013 Jason Rhinelander, except where otherwise noted.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
This diff is collapsed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource)
if (_insource)
message(SEND_ERROR "${_errorMessage}")
message(FATAL_ERROR "Remove the file CMakeCache.txt in ${CMAKE_SOURCE_DIR} first.")
endif (_insource)
endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)
This diff is collapsed.
AC_INIT([Eris], [0.1], [eris@imaginary.ca])
AM_INIT_AUTOMAKE([-Wall foreign])
#AC_PROG_CC([clang gcc])
AC_PROG_CXX([clang++ g++ c++])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
# The following is from src/cycle.h:
dnl ---------------------------------------------------------------------
AC_C_INLINE
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/time.h c_asm.h intrinsics.h mach/mach_time.h])
AC_CHECK_TYPE([hrtime_t],[AC_DEFINE(HAVE_HRTIME_T, 1, [Define to 1 if hrtime_t is defined in <sys/time.h>])],,[#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif])
AC_CHECK_FUNCS([gethrtime read_real_time time_base_to_time clock_gettime mach_absolute_time])
dnl Cray UNICOS _rtc() (real-time clock) intrinsic
AC_MSG_CHECKING([for _rtc intrinsic])
rtc_ok=yes
AC_TRY_LINK([#ifdef HAVE_INTRINSICS_H
#include <intrinsics.h>
#endif], [_rtc()], [AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS _rtc() intrinsic.])], [rtc_ok=no])
AC_MSG_RESULT($rtc_ok)
dnl ---------------------------------------------------------------------
This diff is collapsed.
#pragma once
#include "Member.hpp"
#include <eris/Member.hpp>
namespace eris {
......
#pragma once
#include "types.hpp"
#include <eris/types.hpp>
#include <algorithm>
#include <exception>
#include <limits>
......
#pragma once
#include "types.hpp"
#include "Agent.hpp"
#include "Bundle.hpp"
#include <eris/types.hpp>
#include <eris/Agent.hpp>
#include <eris/Bundle.hpp>
#include <map>
#include <vector>
......
#pragma once
#include "Agent.hpp"
#include "Bundle.hpp"
#include <eris/Agent.hpp>
#include <eris/Bundle.hpp>
#include <algorithm>
#include <exception>
#include <initializer_list>
......
#pragma once
#include "Member.hpp"
#include <eris/Member.hpp>
#include <string>
namespace eris {
......
#pragma once
#include "Member.hpp"
#include "Agent.hpp"
#include "Firm.hpp"
#include "Good.hpp"
#include "Bundle.hpp"
#include <eris/Member.hpp>
#include <eris/Agent.hpp>
#include <eris/Firm.hpp>
#include <eris/Good.hpp>
#include <eris/Bundle.hpp>
#include <map>
// Base class for markets in Eris. At this basic level, a market has an output bundle and a price
......
#pragma once
#include "types.hpp"
#include <eris/types.hpp>
// Contains the Member class, which is a very general base class for objects "owned" and stored by a
// Simulation (e.g. goods, agents, markets). Also contains the SharedMember<M> class, a wrapper
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment