LibrePilot Forum

Development => GCS General => Topic started by: Mark on July 30, 2015, 03:21:17 pm

Title: Trying to build source on Windows
Post by: Mark on July 30, 2015, 03:21:17 pm
I've hit a snag building the source under windows. I'm getting the error "makefile:189: recipe for target 'uavobjects_java' failed" with "required UAVObject definitions not found!" and this file mentioned "librepilot-next.xml".

Anyone know where this file is (if that is indeed the problem).

I should add it was "generating matlab code"
Title: Re: Trying to build source on Windows
Post by: simonarvestrand on July 30, 2015, 03:51:02 pm
Got the same fault yesterday when i tried to make for ubuntu. did another a couple of days ago and that one went well.
Title: Re: Trying to build source on Windows
Post by: f5soh on July 30, 2015, 04:28:38 pm
Where/how you get source code ?
Title: Re: Trying to build source on Windows
Post by: Mark on July 30, 2015, 04:39:40 pm
I got the source code from https://github.com/librepilot/LibrePilot and clicked download ZIP
Title: Re: Trying to build source on Windows
Post by: f5soh on July 30, 2015, 05:59:45 pm
Did you follow procedure ?

make/scripts/win_sdk_install.sh
tools/bin/make all_sdk_install

Full procedure using git source : https://wiki.openpilot.org/display/WIKI/Windows+-+Building+and+Packaging
Title: Re: Trying to build source on Windows
Post by: Mark on July 30, 2015, 06:21:45 pm
Hi f5soh, yes I successfully run those 2 commands, with verbose mode enabled I get

makefile:189: recipe for target 'uavobjects_java' failed
make: *** [uavobjects_java] Error 2, I assume error 2 is file not found.
Title: Re: Trying to build source on Windows
Post by: f5soh on July 30, 2015, 06:46:30 pm
 tools/bin/make uavobjects_clean

and

 tools/bin/make uavobjects
Title: Re: Trying to build source on Windows
Post by: f5soh on July 30, 2015, 06:49:54 pm
The only change from wiki doc above is the repo :

 git clone https://github.com/librepilot/LibrePilot.git
Title: Re: Trying to build source on Windows
Post by: Mark on July 31, 2015, 09:52:19 am
Thanks for trying but I've tried that but make.exe uavobjects fails with the same error.
Here's the actual text
- OpenPilot UAVObject Generator -
Done: processed 111 XML files and generated 111 objects with no ID collisions. Total size of the dat
a fields is 4582 bytes.
generating matlab code
( cd D:/Source/LibrePilot/build/uavobject-synthetics/Java && \
    D:/Source/LibrePilot/build/uavobjgenerator/uavobjgenerator.exe -Java D:/Source/LibrePilot/shared
/uavobjectdefinition D:/Source/LibrePilot ; \
)
- OpenPilot UAVObject Generator -
required UAVObject definitions not found! d:/source/librepilot.xml
makefile:189: recipe for target 'uavobjects_java' failed
make: *** [uavobjects_java] Error 2
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 10:15:07 am
Using Git source or Zip archive ?
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 10:17:25 am
Strange, this is outside source dir :  "d:/source/librepilot.xml"
Title: Re: Trying to build source on Windows
Post by: m_thread on July 31, 2015, 10:20:14 am
Mark

From what directory are you running the make command?

/F
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 10:36:17 am
Just tested from a fresh source code dir using git clone and all working fine
Title: Re: Trying to build source on Windows
Post by: Mark on July 31, 2015, 10:56:39 am
Hi f5soh and m_thread I just deleted everything and started again, this time using the git command. So from D:\Source I run
git clone https://github.com/librepilot/LibrePilot.git
This creates the folder LibrePilot with all the files in it as expected, I then
cd to LibrePilot
and run
make\scripts\win_sdk_install.sh
This succeeds with one warning "WARNING  tools/SDL-1.2.15 not found (make sdl_install), using system PATH"
From the same folder I run
tools\bin\make sdl_install just in case this was the problem
Then again from D:\Source\LibrePilot I run D:\Source\LibrePilot>tools\bin\make all package
This is the output
D:\Source\LibrePilot>tools\bin\make all package
d:/Source/LibrePilot/tools/bin/make -f Makefile.Release
compiling ../../ground/uavobjgenerator/main.cpp
compiling ../../ground/uavobjgenerator/uavobjectparser.cpp
compiling ../../ground/uavobjgenerator/generators/generator_io.cpp
compiling ../../ground/uavobjgenerator/generators/java/uavobjectgeneratorjava.cpp
compiling ../../ground/uavobjgenerator/generators/flight/uavobjectgeneratorflight.cpp
compiling ../../ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp
compiling ../../ground/uavobjgenerator/generators/matlab/uavobjectgeneratormatlab.cpp
compiling ../../ground/uavobjgenerator/generators/python/uavobjectgeneratorpython.cpp
compiling ../../ground/uavobjgenerator/generators/wireshark/uavobjectgeneratorwireshark.cpp
compiling ../../ground/uavobjgenerator/generators/generator_common.cpp
linking uavobjgenerator.exe
- OpenPilot UAVObject Generator -
Done: processed 111 XML files and generated 111 objects with no ID collisions. Total size of the dat
a fields is 4582 bytes.
generating gcs code
- OpenPilot UAVObject Generator -
Done: processed 111 XML files and generated 111 objects with no ID collisions. Total size of the dat
a fields is 4582 bytes.
generating flight code
- OpenPilot UAVObject Generator -
Done: processed 111 XML files and generated 111 objects with no ID collisions. Total size of the dat
a fields is 4582 bytes.
generating python code
- OpenPilot UAVObject Generator -
Done: processed 111 XML files and generated 111 objects with no ID collisions. Total size of the dat
a fields is 4582 bytes.
generating matlab code
- OpenPilot UAVObject Generator -
required UAVObject definitions not found! d:/source/librepilot.xml
makefile:189: recipe for target 'uavobjects_java' failed
make: *** [uavobjects_java] Error 2
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 11:24:13 am
Quote
D:\Source\LibrePilot>tools\bin\make all package

Prompt with "D:\" is strange are you running gitbash or windows command line ?
Title: Re: Trying to build source on Windows
Post by: m_thread on July 31, 2015, 11:29:58 am
Mark

When you installed msysgit on your Windows box. Did you install it in C:\Git as the instructions said? Or was it installed somewhere else by default?

/F
Title: Re: Trying to build source on Windows
Post by: Mark on July 31, 2015, 11:46:39 am
Hi m_thread yes I did do that and f5soh I'm using windows command line

Ok I think I've found the problem, I've tweaked D:\Source\LibrePilot\ground\uavobjgenerator\main.cpp
The command line being passed in is
-Java
D:/Source/LibrePilot/shared/uavobjectdefinition
D:/Source/LibrePilot
THe source code does
bool do_java       = (arguments_stringlist.removeAll("-java") > 0);

This means that do_java is not being set as the code is expecting a lower case j
No clue where the -Java is being passed from so I've just changed main.cpp to look for "-Java", maybe the code should lowecase everything?
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 12:39:13 pm
I see nothing wrong, Makefile call generator with "-java" and command option uses "-java"
all lowercase.

Why your system display with "-Java" ?
Title: Re: Trying to build source on Windows
Post by: Mark on July 31, 2015, 01:12:31 pm
I don't know, I'm going to have to go through how the whole creation of the makefile's work, I'll let you know when I figure it out, thanks for helping me though m_thread and f5soh.
Title: Re: Trying to build source on Windows
Post by: f5soh on July 31, 2015, 01:14:42 pm
Inside Makefile there is only "-java"

Here 'make uavobjects' works here in both cases : git bash or win cmd
Title: Re: Trying to build source on Windows
Post by: Mark on July 31, 2015, 02:20:20 pm
Yes it's extremely odd.  tools\bin\make uavobjects_java V=1 converts the lowercase java into Java the "variable" $* is clearly changing I can see from the the CD and mkdir commands

( cd D:/Source/LibrePilot/build/uavobject-synthetics/Java && \
    D:/Source/LibrePilot/build/uavobjgenerator/uavobjgenerator.exe -Java D:/Source/LibrePilot/sha
/uavobjectdefinition D:/Source/LibrePilot ; \
)

I'm gonna have to figure out why now as it's so odd

Finally figured it out, it's actually make.exe doing it this is a minimal make file
foo_%:
   echo $*

D:\Source\LibrePilot>tools\bin\makeorig foo_java -f Makefile.small
echo Java
Java
Thats the output
Now with make version 4.1
D:\Source\LibrePilot>tools\bin\make4.1 foo_java -f Makefile.small
echo java
java
Title: Re: Trying to build source on Windows
Post by: stormin13 on August 14, 2015, 08:47:41 am
I've been trying to build in Win10 and get an error (screen shot attached).

I downloaded the zip and unpacked it to c:/code - open gitbash and go to c:/code/LibrePilot - then followed the steps here installing the toolchains etc : https://wiki.openpilot.org/display/WIKI/Windows+-+Building+and+Packaging

tools/bin/make all package - looks like everything is working, but get errors at the end (screen shot attached). Can't find the gcs.exe in any of the folders

Is there a download source for the windows binery somewhere? I'd like to test fly it.

Thanks
Title: Re: Trying to build source on Windows
Post by: f5soh on August 14, 2015, 11:29:37 am
In fact git commit hash is used so building from zip archive don't work.

You should clone repo using :
git clone https://bitbucket.org/librepilot/librepilot.git
Title: Re: Trying to build source on Windows
Post by: stormin13 on August 14, 2015, 03:55:19 pm
Okay cool I'll give that a shot
Title: Re: Trying to build source on Windows
Post by: stormin13 on August 14, 2015, 04:25:30 pm
Looks like the clone operation worked, but now I can't checkout next branch - already exists, nor install tool chains.( see attached screen shot)

Sorry this all is not intuitive to me, but I can follow instructions for the most part - would appreciate a kick in the right direction.

Thanks
Title: Re: Trying to build source on Windows
Post by: f5soh on August 14, 2015, 04:40:57 pm
try a simple 'git checkout next'

'git status' give you some info

check dir contents and files under ./make/scripts/

Without win_sdk_install.sh you can't do more...


Title: Re: Trying to build source on Windows
Post by: stormin13 on August 14, 2015, 06:27:37 pm
try a simple 'git checkout next'

That was it - successfully built in Win10.

Thanks f5soh
Title: Re: Trying to build source on Windows
Post by: f5soh on August 14, 2015, 06:40:08 pm
Nice, enjoy :D