|
From: Adam D. <ade...@ex...> - 2013-03-08 22:06:12
|
Thanks! Got it. Seems that the default autogen doesn't make the libraries, or install the headers. I needed to do this: ./autogen.sh --enable-libraries ( Then make and sudo make install. Then it puts the stuff where pip finds it. Your test below, now works for me. Very nice code to have! Thanks for the help as well. --Adam On 3/8/13 1:44 PM, "James Goppert" <jam...@gm...> wrote: >It looks like whatever branch you are using isn't getting the headers >installed properly. I fixed the CMake install on my branch here: >http://gitorious.org/jsbsim/jgopperts-jsbsim/archive-tarball/lin-fix. >In the 0.5 release of PyJSBSim it looks in /opt/local first then >/usr/local for JSBSim on mac. > >On Fri, Mar 8, 2013 at 2:39 PM, Adam Dershowitz ><ade...@ex...> wrote: >> I would like to try out this interface. But I am running into issues >>with >> installing it. >> Just to make sure, I decided to use a clean build. I did a CVS >>checkout >> autogen.sh, make, sudo make install. JSBSim builds and runs fine. >> But, if I do: >> pip-2.6 install PyJSBSim >> >> I get a bunch of errors (I have put the beginning of them at the bottom >>of >> the email). I think that the problem is that pip is not finding the >> correct header files. I think that it is looking in >> /usr/local/include/jsbsim. But all I see there, after make install, is: >> /usr/local/include/jsbsim/simgear >> /usr/local/include/jsbsim/simgear/compiler.h >> >> >> Is some other step necessary to get JSBSim to install the other header >> files into /usr/local/include? Or, is there some way to get pip to look >> in the local directory, and to set the path? For example I see this >>file: >> JSBSim/src/models/FGPropulsion.h, but pip is trying to find it here: >> JSBSim/models/FGPropulsion.h >> >> I am running on a Mac, so that can have an effect on some paths. >> >> Thanks, >> >> >> --Adam >> >> Beginning of the errors: >> >> Downloading/unpacking PyJSBSim >> Running setup.py egg_info for package PyJSBSim >> Requirement already satisfied (use --upgrade to upgrade): cython>=0.18 >>in >> >>/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 >>/s >> ite-packages (from PyJSBSim) >> Requirement already satisfied (use --upgrade to upgrade): numpy in >> >>/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 >>/s >> ite-packages (from PyJSBSim) >> Installing collected packages: PyJSBSim >> Running setup.py install for PyJSBSim >> skipping 'cython/fgfdmexec.cpp' Cython extension (up-to-date) >> building 'pyjsbsim.jsbsim_cython' extension >> /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2 >> -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes >> -I/usr/local/include/JSBSim >> >>-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/pyt >>ho >> n2.6 -c cython/fgfdmexec.cpp -o >> build/temp.macosx-10.6-x86_64-2.6/cython/fgfdmexec.o >> cc1plus: warning: command line option "-Wstrict-prototypes" is valid >> for C/ObjC but not for C++ >> cython/fgfdmexec.cpp:261:40: error: JSBSim/models/FGPropulsion.h: No >> such file or directory >> cython/fgfdmexec.cpp:262:30: error: JSBSim/FGFDMExec.h: No such file >> or directory >> cython/fgfdmexec.cpp:356: error: ŒJSBSim¹ has not been declared >> cython/fgfdmexec.cpp:356: error: ISO C++ forbids declaration of >> ŒFGFDMExec¹ with no type >> cython/fgfdmexec.cpp:356: error: expected Œ;¹ before Œ*¹ token >> cython/fgfdmexec.cpp: In function Œint >> >>__pyx_pf_8pyjsbsim_13jsbsim_cython_9FGFDMExec___cinit__(__pyx_obj_8pyjsbs >>im >> _13jsbsim_cython_FGFDMExec*, PyObject*, PyObject*)¹: >> cython/fgfdmexec.cpp:868: error: Œstruct >> __pyx_obj_8pyjsbsim_13jsbsim_cython_FGFDMExec¹ has no member named >> Œthisptr¹ >> cython/fgfdmexec.cpp:868: error: expected type-specifier before >> ŒJSBSim¹ >> cython/fgfdmexec.cpp:868: error: expected `;' before ŒJSBSim¹ >> cython/fgfdmexec.cpp: In function Œvoid >> >>__pyx_pf_8pyjsbsim_13jsbsim_cython_9FGFDMExec_6__dealloc__(__pyx_obj_8pyj >>sb >> sim_13jsbsim_cython_FGFDMExec >> >> >> >> >> >> >> On 3/7/13 2:05 PM, "James Goppert" <jam...@gm...> wrote: >> >>>Here is a quick start at your question: >>> >>>Dependencies are Cython > 0.18, NumPy. >>> >>>The easiest way to install everything is: >>> >>>pip install PyJSBSim >>>(of course this requires that you install pip first) >>> >>>I have it generating BADA files now, see attached for a 737 bada file >>>that was produced. This still needs some work probably. But it is a >>>great way to see how JSBSim compares with real flight data! >>> >>>Here is a short example with plotting: >>> >>>from pyjsbsim import FGFDMExec >>>from pylab import * >>> >>># load >>>fdm = FGFDMExec(debug_level=0) >>>fdm.load_model("f16") >>> >>># trim >>>fdm.set_property_value("ic/h-agl-ft",1000) >>>fdm.set_property_value("ic/vc-kts",400) >>>fdm.set_property_value("ic/gamma-deg",0) >>>fdm.do_trim(0) >>> >>># simulate >>>(t,y) = fdm.simulate( >>> t_final=10, >>> dt=0.1, >>> record_properties=["position/h-agl-ft", "attitude/theta-deg"]) >>> >>># plot >>>title("test") >>>xlabel("t, sec") >>>ylabel("h-agl, ft") >>>plot(t,y["position/h-agl-ft"]) >>>show() >>> >>>-James >>> >>>On Mon, Mar 4, 2013 at 4:46 PM, Agostino De Marco <ago...@un...> >>>wrote: >>>> Hey James, >>>> this looks really interesting. I've looked into the >>>> 737_trim.py where you call many times the simplex trim function. >>>> >>>> It would be cool if we could write some tips to get started >>>> with this work environment. >>>> Like: >>>> How to setup the python environment and which are the >>>> suggested additional packages to install (such as numpy). >>>> How to start a simulation from Python. >>>> How can time histories be plotted (e.g. matplotlib). >>>> >>>> It would be nice to add these new features to the JSBSim manual. >>>> >>>> Agostino >>>> >>>> >>>> >>>> >>>> James Goppert <jam...@gm...> ha scritto: >>>> >>>>> This is now functional. I am using it to generate BADA tables for >>>>> aircraft modeled in JSBSim. There is an example script in >>>>> scripts/737_trim.py >>>>> >>>>> I have interfaced all of the FGFDMExec class. You can do about >>>>> anything using the set/get property functions, so not really a need >>>>>to >>>>> interface the rests of the classes, also will keep maintenance >>>>> requirements low. >>>>> >>>>> -James >>>>> >>>>> On Sat, Mar 2, 2013 at 5:16 PM, James Goppert >>>>> <jam...@gm...> wrote: >>>>>> I'm working on interfacing JSBSim with Cython. I looked at the >>>>>> existing python jsbsim wrapper, but it seemed to be out of date. >>>>>>Also >>>>>> cython seems to be much faster. >>>>>> >>>>>> https://pypi.python.org/pypi/PyJSBSim >>>>>> >>>>>> -James >>>>> >>>>> >>>>>---------------------------------------------------------------------- >>>>>-- >>>>>------ >>>>> Everyone hates slow websites. So do we. >>>>> Make your web apps faster with AppDynamics >>>>> Download AppDynamics Lite for free today: >>>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>>> _______________________________________________ >>>>> Jsbsim-devel mailing list >>>>> Jsb...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel >>>>> _______________________________________________ >>>>> The JSBSim Flight Dynamics Model project >>>>> http://www.JSBSim.org >>>>> _______________________________________________ >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> Agostino De Marco, PhD >>>> >>>> Assistant Professor >>>> >>>> Università degli Studi di Napoli Federico II >>>> >>>> Dipartimento di Ingegneria Industriale - Sezione Aerospaziale >>>> >>>> Aircraft Design & AeroFlightDynamics Group (ADAG) >>>> >>>> ** University of Naples Federico II >>>> ** Industrial Engineering Department >>>> ** Aircraft Design & AeroFlightDynamics Group >>>> >>>> via Claudio 21, 80125 Napoli - Italy >>>> Tel.: +39 0817683323 >>>> Fax: +39 0817683622 >>>> Email: ago...@un... >>>> Web 1: www.dii.unina.it >>>> Web 2: www.adag.unina.it >>>> Web 3: www.eolpowergroup.com >>>> ------------------------------------------------------- >>>> >>>> >>>> >>>>----------------------------------------------------------------------- >>>>-- >>>>----- >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> _______________________________________________ >>>> Jsbsim-devel mailing list >>>> Jsb...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel >>>> _______________________________________________ >>>> The JSBSim Flight Dynamics Model project >>>> http://www.JSBSim.org >>>> _______________________________________________ >>>> >> >> >> >>------------------------------------------------------------------------- >>----- >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> _______________________________________________ >> Jsbsim-devel mailing list >> Jsb...@li... >> https://lists.sourceforge.net/lists/listinfo/jsbsim-devel >> _______________________________________________ >> The JSBSim Flight Dynamics Model project >> http://www.JSBSim.org >> _______________________________________________ >> > >-------------------------------------------------------------------------- >---- >Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >endpoint security space. For insight on selecting the right partner to >tackle endpoint security challenges, access the full report. >http://p.sf.net/sfu/symantec-dev2dev >_______________________________________________ >Jsbsim-devel mailing list >Jsb...@li... >https://lists.sourceforge.net/lists/listinfo/jsbsim-devel >_______________________________________________ >The JSBSim Flight Dynamics Model project >http://www.JSBSim.org >_______________________________________________ > |