Skip to content

Commit

Permalink
Added support for 32 and 64-bit Linux build.
Browse files Browse the repository at this point in the history
Some minor changes made still need to be validated, on Windows.
capn-freako committed May 18, 2015
1 parent 96790f2 commit d0f6863
Showing 7 changed files with 37 additions and 7 deletions.
5 changes: 3 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ x64:
targs: $(IBISAMI_LIB)

$(IBISAMI_LIB): $(OBJS)
@echo "Building $@..."
$(RUN_CMD) $(LIB) $(LIBFLAGS) $^
@echo "Built $(OBJS)."
# @echo "Building $@..."
# $(RUN_CMD) $(LIB) $(LIBFLAGS) $^

4 changes: 2 additions & 2 deletions defs.mak
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ else
CXX := g++
LIB := $(CXX)
LD := $(CXX)
CFLAGS := -c -fPIC -I. -std=gnu++11
CFLAGS := -c -fPIC -std=gnu++11 -I. -I"$(IBISAMI_ROOT)"
LDFLAGS = -o $@ -shared
ifeq ($(MACHINE), X86)
LDFLAGS += -m32
@@ -79,7 +79,7 @@ else
CFLAGS += -g
LDFLAGS += -g
else
LDFLAGS += -s -static-libgcc -static-libstdc++
LDFLAGS += -s -static-libgcc -static-libstdc++ $(@:%_$(SUFFIX).so=%.exp)
endif
CXXFLAGS := $(CFLAGS)
IBISAMI_LIB := libibisami_$(SUFFIX).a
3 changes: 2 additions & 1 deletion example/GNUmakefile
Original file line number Diff line number Diff line change
@@ -21,8 +21,10 @@ include $(IBISAMI_ROOT)/defs.mak
# Handle Windows vs. Linux target naming differences.
ifeq ($(OS), Windows_NT)
TARGS := $(MODS:%=%_$(SUFFIX).dll)
LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT_DOS)\\%_$(SUFFIX).obj")
else
TARGS := $(MODS:%=%_$(SUFFIX).so)
LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT)/%_$(SUFFIX).o")
endif

# Targets
@@ -39,7 +41,6 @@ tx64:

targs: $(TARGS)

LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT_DOS)\\%_$(SUFFIX).obj")
$(TARGS): $(OBJS)
@echo "Building $@..."
# $(RUN_CMD) $(LD) $(LDFLAGS) "$(IBISAMI_ROOT_DOS)\$(IBISAMI_LIB)" "$(IBISAMI_ROOT_DOS)\$(IBISAMI_LIB:%.lib=%.exp)" $^
2 changes: 1 addition & 1 deletion example/example_tx.cpp
Original file line number Diff line number Diff line change
@@ -64,5 +64,5 @@ class MyTx : public AmiTx {
}
} my_tx;

extern AMIModel *ami_model = &my_tx;
AMIModel *ami_model = &my_tx;

10 changes: 10 additions & 0 deletions example/example_tx.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
VERSION {
DEFAULT {
global:
AMI_Init;
AMI_Close;
local:
*;
};
}

19 changes: 19 additions & 0 deletions example/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /usr/bin/env python
# A quick test of the ibisami example Tx model.
#
# Original author: David Banas
# Original date: May 18, 2015
#
# Copyright (c) 2015 David Banas; all rights reserved World wide.

import pyibisami.amimodel as ami

gDLLName = './example_tx_x86_amd64.so'

the_model = ami.AMIModel(gDLLName)
init_data = ami.AMIModelInitializer({'root_name': "exampleTx"})
the_model.initialize(init_data)

print "Model returned message:", the_model.msg
print "Model returned parameters:", the_model.ami_params_out

1 change: 0 additions & 1 deletion include/amimodel.h
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
#ifndef INCLUDE_AMIMODEL_H_
#define INCLUDE_AMIMODEL_H_

#include <boost/phoenix.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_omit.hpp>
#include <boost/spirit/include/phoenix_core.hpp>

0 comments on commit d0f6863

Please sign in to comment.