diff --git a/.gitignore b/.gitignore index e69de29..3cdd3e2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/adevs.tar.gz diff --git a/adevs-2.6-build.patch b/adevs-2.6-build.patch new file mode 100644 index 0000000..b9e839f --- /dev/null +++ b/adevs-2.6-build.patch @@ -0,0 +1,32 @@ +diff --git a/include/adevs_simulator.h b/include/adevs_simulator.h +index aa2f442..ed6e53e 100644 +--- a/include/adevs_simulator.h ++++ b/include/adevs_simulator.h +@@ -617,7 +617,7 @@ void Simulator::exec_event(Atomic* model, bool internal, T t) + model->delta_ext(t-model->tL,*(model->x)); + } + // Notify any listeners +- notify_state_listeners(model,t); ++ this->notify_state_listeners(model,t); + // Check for a model transition + if (model->model_transition() && model->getParent() != NULL) + { +diff --git a/test/alt_time_tests.cpp b/test/alt_time_tests.cpp +index 2409adb..0d0e553 100644 +--- a/test/alt_time_tests.cpp ++++ b/test/alt_time_tests.cpp +@@ -80,10 +80,10 @@ Model::Model(): + a(new PingPong(true)), + b(new PingPong()) + { +- add(a); +- add(b); +- couple(a,b); +- couple(b,a); ++ this->add(a); ++ this->add(b); ++ this->couple(a,b); ++ this->couple(b,a); + } + // Non-standard type for time + class TimeType diff --git a/adevs-2.6-install.patch b/adevs-2.6-install.patch new file mode 100644 index 0000000..afe2782 --- /dev/null +++ b/adevs-2.6-install.patch @@ -0,0 +1,49 @@ +diff --git a/docs/Makefile b/docs/Makefile +index 86bdec0..76222d1 100644 +--- a/docs/Makefile ++++ b/docs/Makefile +@@ -13,7 +13,7 @@ pdf_manual: + cd tex-files; latex manual; latex manual; latex manual; dvipdf manual.dvi; mv manual.pdf .. + + html_manual: +- cd tex-files; latex2html -split 3 -no_math -html_version 3.2 -dir ../${MANUAL_DIR} -mkdir -contents_in_navigation manual ++ cd tex-files; latex2html -local_icons -split 3 -no_math -html_version 3.2 -dir ../${MANUAL_DIR} -mkdir -contents_in_navigation manual + + + java_docs: +diff --git a/src/Makefile b/src/Makefile +index 7d0b731..50ee191 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -6,7 +6,7 @@ + # This target builds the java language bindings to the adevs simulator. + # Point this at your java installation if you want to build the Java bindings. + JAVA_HOME = /usr/local/jdk1.6.0_26 +-CFLAGS += -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux ++java_adevs: CFLAGS += -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux + # + # 2) adevs + # +@@ -23,7 +23,7 @@ CFLAGS += -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux + # adevs object library. Point MODELICA_HOME at your Open Modelica + # installation if you want to build the Modelica extensions for adevs. + MODELICA_HOME = ${HOME}/Code/openmodelica/trunk +-CFLAGS += -I${MODELICA_HOME}/build/include/omc ++adevs_with_modelica: CFLAGS += -I${MODELICA_HOME}/build/include/omc + include Makefile.modelica + + # These are generic options for the GNU C++ compiler. +@@ -64,6 +64,13 @@ JAVA_OBJS = \ + # to C++ simulations + adevs: ${ADEVS_OBJS} + ar -r libadevs.a ${ADEVS_OBJS} ++ ${CXX} -shared -Wl,-soname,libadevs.so.2 -o libadevs.so.2.6 ${ADEVS_OBJS} ++ ++install: ++ mkdir -p "${DESTDIR}" ++ install -m 755 -p libadevs.so.2.6 "${DESTDIR}" ++ ln -f -s libadevs.so.2.6 "${DESTDIR}/libadevs.so.2" ++ ln -f -s libadevs.so.2.6 "${DESTDIR}/libadevs.so" + + # This adds the modelica extensions to the adevs library + adevs_with_modelica: ${ADEVS_OBJS} modelica_runtime.o diff --git a/adevs.spec b/adevs.spec new file mode 100644 index 0000000..5b8a702 --- /dev/null +++ b/adevs.spec @@ -0,0 +1,107 @@ +Name: adevs +Version: 2.6 +Release: 3%{?dist} +Summary: C++ library for constructing discrete event simulation +Group: System Environment/Libraries +License: LGPLv2+ +URL: http://www.ornl.gov/~1qn/adevs/ +Source0: http://www.ornl.gov/~1qn/adevs/adevs.tar.gz +# This patch fixes incompatibility with newer g++ and has been sent upstream +# for future inclusion. +Patch0: adevs-2.6-build.patch +# This patch adds "make install" support, allows building adevs as shared +# library and fixes latex2html invocation to include icons in manual. +Patch1: adevs-2.6-install.patch +BuildRequires: tcl +BuildRequires: latex2html + +%description +Adevs (A Discrete EVent System simulator) is a C++ library for constructing +discrete event simulations based on the Parallel DEVS and Dynamic DEVS +(dynDEVS) formalisms. DEVS has been applied to the study of social systems, +ecological systems, computer networks and computer architecture, military +systems at the tactical and theater levels, and in many other areas + +%package devel +Summary: C++ library for constructing discrete event simulations +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Header files and development libraries for adevs package. +Adevs (A Discrete EVent System simulator) is a C++ library for constructing +discrete event simulations based on the Parallel DEVS and Dynamic DEVS +(dynDEVS) formalisms. + +%package doc +Summary: API docs and examples for adevs +Group: Development/Libraries +License: LGPLv2+ and GPL+ +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Manual, doxygen generated API documentation and C++ examples for Adevs +library. + +%prep +%setup -q -n %{name}-%{version} +%patch0 -p1 -b .build +%patch1 -p1 -b .install + +%build +export CFLAGS="%{optflags}" + +pushd src +make %{_smp_mflags} adevs OPTFLAG= +popd + +pushd docs +make html_manual +rm -f manual/*.aux manual/*.out manual/*.dvi manual/*.log manual/*.toc +popd + +find examples -type f -exec sed -i 's/\r//' {} \; +find examples -type f -exec chmod -x {} \; + +%check +pushd test +make check_cpp +OMP_NUM_THREADS=4 make check_par +popd + +%install +install -m 755 -d %{buildroot}%{_includedir}/adevs +install -p -m 644 -t %{buildroot}%{_includedir}/adevs include/*.h + +pushd src +make install DESTDIR=%{buildroot}%{_libdir} +popd + +# java support is not enabled yet... +rm -r ./examples/java_life + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc README +%{_libdir}/libadevs.so.* + +%files devel +%{_includedir}/adevs +%{_libdir}/libadevs.so + +%files doc +%doc docs/api docs/manual examples + +%changelog +* Mon Jun 17 2013 Jan Kaluza - 2.6-3 +- rename -docs package to -doc + +* Wed Jun 12 2013 Jan Kaluza - 2.6-2 +- add docs, run tests during the build, build with openmp + +* Thu Jun 06 2013 Jan Kaluza - 2.6-1 +- Initial Fedora packaging diff --git a/sources b/sources index e69de29..ede9b95 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a268283b9a32c46e5471dbb80df1d924 adevs.tar.gz