sonalidutta Posted May 28, 2013 Report Share Posted May 28, 2013 Hi, I am working on Runtime Monitoring of SystemC models. One of my projects requires adding some callbacks to the systemc kernel. In systemc-2.3.0/src/sysc/kernel: I added 4 new files: mon_prototype.cpp/h mon_observer.cpp/h I also did some minimal modification(adding callbacks) to: sc_event.cpp/h sc_sim_context.cpp/h sc_object.cpp/h sc_thread_process.h I did the required modification to : systemc-2.3.0/src/systemc. There are hierarchical Makefiles: Makefile.in and Makefile.am in systemc-2.3.0 My question is: what is the clean way of doing this Makefile modifications? How many Makefiles do I need to modify manually? I definitely need to change one of the Makefile.in and Makefile.am in src/sysc/kernel. My guess is that I can regenerate the other Makefiles(modified) using automake and aclocal. I need to know the right way to do it. Finally, I want to release the modified systems-2.3.0 kernel that can be compiled and installed using the same steps described in systems-2.3.0/INSTALL. Can anybody from the developer group advise me in this respect? Regards Sonali Quote Link to comment Share on other sites More sharing options...
apfitch Posted May 28, 2013 Report Share Posted May 28, 2013 Hi Sonali, I think the only file you should have to change is src/systemc/kernel/Makefile.am Makefile.in should be re-generated by running the autoconf tools. Unfortunately that's the limit of my knowledge :-( I don't know exactly how the release is done, regards Alan Quote Link to comment Share on other sites More sharing options...
dakupoto Posted May 29, 2013 Report Share Posted May 29, 2013 Dear Sir/Madam, As Alan says, almost all the Makefiles are generated by the autoconf tool. Manually editing is very error-prone, because it is necessary to track each dependency in the hierarchy. Please try a 'make unistall' followed by a 'make distcleam' and then repeat the 'configure', 'make' and 'make install' steps. That would correctly include all the dependencies and indicate errors if there are any. Hope that helps. Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted May 29, 2013 Author Report Share Posted May 29, 2013 Thanks Alan! Dear Developer, Can you please specifically tell me the following ? : 1. Which Makefile do I need to modify manually? 2. What commands do I need to run to auto-generate the rest of the Makefiles? gmake, gmake install are the final steps to compile and install the systemc package. But before that I need to generate the necessary Makefiles. How do I do that? As mentioned before I modified files in kernel and added 4 new files in kernel. Please let me know the commands. Thanks Sonali Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted May 29, 2013 Author Report Share Posted May 29, 2013 Dear Developer, Here is the solution. For installation I modified: 1. /systemc-2.3.0/src/sysc/kernel/Makefile.am to add the new 4 files I have added to kernel (see above for detail) 2. /systemc-2.3.0/configure.in to add a new flag called -DDEBUG_PRINT_IN_SCHEDULER Now I ran: autoconf: This takes aclocal.m4 and configure.in as input and generates ./configure file as output. automake: This takes configure.in and Makefile.am as input and generates Makefile.in as output. Now I follow the steps in INSTALL file for the rest of the installation process. I must mention here that systemc-2.3.0 package is not able to deal with any versions other than automake-1.10 autoconf-2.61 If I use other higher versions I need to do aclocal again to regenerate aclocal.m4 and that's when gmake gives wierd errors. For example: /bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DSC_INCLUDE_FX -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -MT sc_attribute.lo -MD -MP -MF .deps/sc_attribute.Tpo -c -o sc_attribute.lo ../../../../src/sysc/kernel/sc_attribute.cppmv -f .deps/sc_attribute.Tpo .deps/sc_attribute.Plomv: cannot stat `.deps/sc_attribute.Tpo': No such file or directory I do not know if it is some issue with the packaging or something else. It will be good if anyone from the developer group sheds some light on it. But using the above versions of automake and autoconf, the problem is solved! Regards Sonali Quote Link to comment Share on other sites More sharing options...
apfitch Posted May 29, 2013 Report Share Posted May 29, 2013 I remember having problems with versions of autotools when I was merging TLM2 into SystemC 2.3.0. There are some mentions of autotools 1.12 in the source code on git, so someone is aware that there are problems. I have a feeling it may have something to do with the presence or not of pthreads on the build system, but I'm not sure. If I can create the problem repeatedly, I'll report a bug, regards Alan Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted May 29, 2013 Author Report Share Posted May 29, 2013 Thanks Alan. It will be really great at least for the beginners like me. I hate to spend time on fixing this kind of issues. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted May 29, 2013 Report Share Posted May 29, 2013 I'm not aware of a (real) bug in the autotools setup of SystemC 2.3.0. If you want/need to regenerate the autotools files, the easiest solution is to run "autoreconf": [pah@yab:~/scm/code/osci/systemc]$ autoreconf -v -i autoreconf2.50: Entering directory `.' autoreconf2.50: configure.in: not using Gettext autoreconf2.50: running: aclocal -I config autoreconf2.50: configure.in: tracing autoreconf2.50: running: libtoolize --copy autoreconf2.50: running: /usr/bin/autoconf autoreconf2.50: configure.in: not using Autoheader autoreconf2.50: running: automake --add-missing --copy --no-force autoreconf2.50: Leaving directory `.' Most importantly, note the call to "aclocal" above, which adds the "config" subdirectory (with the required ax_pthread.m4) to the search path. This should solve your pthreads "issue" during the build. Greetings from Oldenburg, Philipp Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted May 29, 2013 Author Report Share Posted May 29, 2013 Hi Philipp, Thanks for the reply. But autoreconf basically does nothing extra than running aclocal, automake and autoconf individually. But as you said, I tried to recreate the error. Here is what I did: 1. I deleted autoconf-1.10 from my system using make distclean 2. I installed autoconf-1.10.1 3. Now I took a fresh systemc-2.3.0(configure.in and /src/sysc/kernel/Makefile.am modified) 4. I ran autoreconf -v -i Here is the output: [root@localhost test]# autoreconf -v -iautoreconf: Entering directory `.'autoreconf: configure.in: not using Gettextautoreconf: running: aclocal -I configautoreconf: configure.in: tracingautoreconf: running: libtoolize --copyautoreconf: running: /usr/local/bin/autoconfautoreconf: configure.in: not using Autoheaderautoreconf: running: automake --add-missing --copy --no-forceautoreconf: Leaving directory `.' 5. mkdir objdir 6. cd objdir 7. gmake [root@localhost objdir]# gmakeMaking all in srcgmake[1]: Entering directory `/root/Desktop/CHIMP_ea/test/objdir/src'Making all in syscgmake[2]: Entering directory `/root/Desktop/CHIMP_ea/test/objdir/src/sysc'Making all in kernelgmake[3]: Entering directory `/root/Desktop/CHIMP_ea/test/objdir/src/sysc/kernel'/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DSC_INCLUDE_FX -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -pthread -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -MT sc_attribute.lo -MD -MP -MF .deps/sc_attribute.Tpo -c -o sc_attribute.lo ../../../../src/sysc/kernel/sc_attribute.cpp../../../libtool: line 2089: ../../../../src/sysc/kernel/sc_attribute.cpp: Permission deniedlibtool: compile: g++ -DSC_INCLUDE_FX -I. -I../../../../src/sysc/kernel -I../../../../src -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -pthread -Wall -m64 -DSC_INCLUDE_FX -DDEBUG_PRINT_IN_SCHEDULER -O3 -MT sc_attribute.lo -MD -MP -MF .deps/sc_attribute.Tpo -c "" -fPIC -DPIC -o .libs/sc_attribute.og++: : No such file or directoryg++: no input filesgmake[3]: *** [sc_attribute.lo] Error 1gmake[3]: Leaving directory `/root/Desktop/CHIMP_ea/test/objdir/src/sysc/kernel'gmake[2]: *** [all-recursive] Error 1gmake[2]: Leaving directory `/root/Desktop/CHIMP_ea/test/objdir/src/sysc'gmake[1]: *** [all-recursive] Error 1gmake[1]: Leaving directory `/root/Desktop/CHIMP_ea/test/objdir/src'gmake: *** [all-recursive] Error 1 I see no reason why g++ cannot read sc_attribute.cpp. I hope this helps. Regards Sonali Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted May 29, 2013 Report Share Posted May 29, 2013 Sonali, But autoreconf basically does nothing extra than running aclocal, automake and autoconf individually. Yes, but with the correct parameters, based on configure.in (here the path to the config/ directory for aclocal). 5. mkdir objdir6. cd objdir7. gmake You need to run configure before running make. But you probably did, otherwise there would have been no Makefile in your new objdir. ;-) ../../../libtool: line 2089: ../../../../src/sysc/kernel/sc_attribute.cpp: Permission denied ... I see no reason why g++ cannot read sc_attribute.cpp. I hope this helps. To me, it looks like your libtool script is broken. Please check the line 2089 of your libtool script. Maybe there is some variable not or incorrectly set. One explanation would have been the "wrong" call to aclocal in an earlier run. Hope that helps, Philipp Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted May 29, 2013 Author Report Share Posted May 29, 2013 Hi Philipp, Yes. I ran ../configure before gmake. Probably you are right! But I will move on since everything is working now. Thanks for your help. I appreciate that you pointed out about the parameters of aclocal specifically -I config. Something I got to learn! So dealing with these nasty errors sometimes gives you valuable knowledge. Not that bad! Thanks Sonali Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.