karla

  • *****
  • 629
Problems set up Build environment on OS X
« on: January 12, 2017, 09:43:05 am »
Hi,
I am trying to set up the build environment on my mac using the wiki
https://librepilot.atlassian.net/wiki/display/LPDOC/Mac+-+Building+and+Packaging

All is fine all the way down to the point "Dev Tools Installation".
Install development libraries and tools, these will be downloaded and automatically installed using root Makefile:
make all_sdk_install


I am using Terminal, the cursor is at directory code/librepilot and the I just send the command:
make all_sdk_install
(my user do have admin access)

First  there is a warning
[0] Warning: Could not create lock file '/Volumes/qt-opensource-mac-x64-clang-5.6.2/qt-opensource-mac-x64-clang-5.6.2.app/Contents/MacOS/lockmyApp1234865.lock': Read-only file system

and then later after lots of files are being installed, the whole command fails.
"disk2" unmounted.
"disk2" ejected.
 CLEAN       tools/osg-3.5.3-clang_64-qt-5.6.2
 VERIFY      downloads/osg-3.5.3-clang_64-qt-5.6.2.tar.gz
 EXTRACT     tools/osg-3.5.3-clang_64-qt-5.6.2
tar: Error opening archive: Failed to open 'downloads/osg-3.5.3-clang_64-qt-5.6.2.tar.gz'
make: *** [osg_install] Error 1
sh-3.2# make all_sdk_install


I probably do some wrong or missing command?
Here is the whole log

Karls-MacBook-Air-2:~ karl$ cd /Users/karl/Documents/karl/private/projects/helicopter/
Karls-MacBook-Air-2:helicopter karl$ cd code/librepilot
Karls-MacBook-Air-2:librepilot karl$ sudo su
Password:
sh-3.2# make all_sdk_install
 NOTE        Use 'make all_sdk_distclean' to remove installation files
 NOTE        Use 'make all_sdk_version' to check toolchain versions
 NOTE        Add 'V=1' to make command line to diagnose make problems
 NOTE        Add 'BATCH=1' to make command line to disable progress reporting during downloads
 INSTALL     gcc-arm-none-eabi
 CLEAN       tools/qt-5.6.2
 VERIFY      downloads/qt-opensource-mac-x64-clang-5.6.2.dmg
expected   CRC32 $5CE0F37C
/dev/disk2             GUID_partition_scheme             
/dev/disk2s1           EFI                               
/dev/disk2s2           Apple_HFS                         /Volumes/qt-opensource-mac-x64-clang-5.6.2
 EXTRACT     qt-opensource-mac-x64-clang-5.6.2.dmg to tools/qt-5.6.2
  • Warning: Could not create lock file '/Volumes/qt-opensource-mac-x64-clang-5.6.2/qt-opensource-mac-x64-clang-5.6.2.app/Contents/MacOS/lockmyApp1234865.lock': Read-only file system

"disk2" unmounted.
"disk2" ejected.
 CLEAN       tools/osg-3.5.3-clang_64-qt-5.6.2
 VERIFY      downloads/osg-3.5.3-clang_64-qt-5.6.2.tar.gz
 EXTRACT     tools/osg-3.5.3-clang_64-qt-5.6.2
tar: Error opening archive: Failed to open 'downloads/osg-3.5.3-clang_64-qt-5.6.2.tar.gz'
make: *** [osg_install] Error 1
sh-3.2# make all_sdk_install

filnet

  • *****
  • 113
Re: Problems set up Build environment on OS X
« Reply #1 on: January 12, 2017, 09:50:02 am »
The recent upgrade to Qt 5.6.2 broke the osx build.

You can wait for the fix or locally revert https://bitbucket.org/librepilot/librepilot/commits/f54185948e33535e69a981d455bfa7c83195ea00.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #2 on: January 12, 2017, 10:22:43 am »
Thanks filnet.

Good you can understand what happened :)
I am afraid I need some very clear and basic instructions to be able to do this.

If I wait for 'the fix' are we talking days, weeks or months?
Will that fix make changes to the Libre code? In that case, will I need to repeat the steps in the Wiki:
 
cd ~/code/librepilot
Now you can checkout code from remote Git server:
git checkout next
git pull


Re: Problems set up Build environment on OS X
« Reply #3 on: January 12, 2017, 07:11:24 pm »
'next' is the current development version.  It shouldn't be broken, but right now it is...

If you use:
16.09
instead of:
next
you will be building the release version instead of the development version.

'16.09' is the well tested release version, but it won't have some nice stuff in 'next' that is going to be added in the next release.  I think that would at least be a good way to test your building.

-------------------------------------------------------------

To continue to play with 'next' you could just try:
git revert f54185948e33535e69a981d455bfa7c83195ea00
then:
make all_clean
and start over with your makes

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Problems set up Build environment on OS X
« Reply #4 on: January 12, 2017, 07:20:50 pm »
For testing you can simply edit the  make/tools.mk file and set the QT_VERSION to 5.6.1 again.

This will revert to previous Qt version and check if the issue is related to this change.
If success you can still run next but using 5.6.1

You should also do a 'git pull' before editing the qt version and retrieve latest changes related the 'Jerry save' issue.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #5 on: January 12, 2017, 10:59:21 pm »
Cool. thanks.
I think I understand some at least.
Since my purpose is not to change any code at the moment just get the code to the OPUploaderTool.exe and make an executable to upgrade my OP GPSv9 units, I will try the option of using 16.09 instead of next.

So I will back up in the instructions and do the commands:
git checkout 16.09
git pull

Then redo the
make all_sdk_install

Right? Will try

Re: Problems set up Build environment on OS X
« Reply #6 on: January 13, 2017, 04:11:08 am »
If you are using the directory you already have, you should 'make all_clean' before doing the build.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #7 on: January 13, 2017, 07:26:46 am »
hm.. okay.
Seems to have worked better.
but i ran into some new problems.

I had a lot of warnings issued (over 50) during the make all_sdk_install command
like these ones
../qtools/qglobal.h:99:6: warning: "This version of Mac OS X is unsupported" [-W#warnings]
I am on MacOS Sierra 10.12.1 hope that is okay OS?

I tried run
make uploader fw_gpsplatinum
It complains
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.

Running
/usr/bin/xcodebuild
complains
xcodebuild: error: The directory ~/code/librepilot does not contain an Xcode project.

I did check out the project first at the repository (16.09) and saved it locally in a dir called librepilot.
I was hoping Xcode could recognize it as a project? I used Xcode interface to checkout the 16.09 version.
What to set up first, a local project using Xcode then check out the code, or check out code first then try make a Xcode project?

Re: Problems set up Build environment on OS X
« Reply #8 on: January 13, 2017, 07:44:03 am »
At this point I have to say "Sorry, I'm not a Mac guy."  :(

If it were me, I would buy an external hard drive, use CloneZilla to back up your Mac, then make the Mac dual boot the latest Linux-Mint-Mate.  You will be able to boot either Linux or MacOS.

Everybody needs to back up, and it's crazy to not back up before something as drastic as making your main computer dual boot.
« Last Edit: January 13, 2017, 09:07:14 am by TheOtherCliff »

filnet

  • *****
  • 113
Re: Problems set up Build environment on OS X
« Reply #9 on: January 13, 2017, 08:55:08 am »
« Last Edit: January 13, 2017, 09:08:00 am by filnet »

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #10 on: January 13, 2017, 09:59:59 am »
Thanks all for advise.
Seems finally I got a successful build of the executable OPUploadTool :)
What made it work was to first create a project with Xcode and then checkout the code under a dir of that project. I think  :P
Anyways I attached it here for anyone else who like to try upgrade your OP GPSv9 while the Microsoft OPUploadTool.exe is broken.
I will try it myself after getting a well deserved beer  ;D

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #11 on: January 14, 2017, 06:03:47 am »
Story continues. Running the OPUploadTool today.

First i gave the wrong port name and then it complained it could not open serial port.
Then i gave the right port name that the GCS list under connections, this time it thinks for a while, then just exits without any further remark.
So Sync did not succeed but the device was found.
How do I know the speed is 9600? You cant specify combridge speed under hardware anymore like in the Wiki right?
https://librepilot.atlassian.net/wiki/display/LPDOC/Setup+a+bluetooth+for+telemetry

Karls-MacBook-Air-2:librepilot karl$ ./build/uploader_release/OPUploadTool -p ./build/firmware/fw_gpsplatinum/fw_gpsplatinum.opfw -t tty.usbmodem14

OpenPilot serial firmware uploader tool.
Connect the board
[==================================================] 100%     
Connect the board NOW
QSerialPort::SerialPortError(DeviceNotFoundError)
Could not open serial port

Karls-MacBook-Air-2:librepilot karl$ ./build/uploader_release/OPUploadTool -p ./build/firmware/fw_gpsplatinum/fw_gpsplatinum.opfw -t tty.usbmodem1421

OpenPilot serial firmware uploader tool.
Connect the board
[==================================================] 100%     
Connect the board NOW
Karls-MacBook-Air-2:librepilot karl$


Re: Problems set up Build environment on OS X
« Reply #12 on: January 14, 2017, 06:52:10 am »
The tricks are (I think):
- plug the FTDI (USB to serial adapter) in to the computer without the GPS being connected to the FTDI.
- determine what the port name is
- make sure you have write access to the port
- using sudo may be too slow (entering password)
- it's serial, so GPS Tx,Rx crosses and connects to FTDI Rx,Tx
- type the command line
- get the GPS (MCU+GPS port) ready to plug in to the FTDI
- plug the GPS in to the FTDI and immediately press Enter

It's been a while since I did this.  You may need to short SBL pads on GPS to get this to work?

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #13 on: January 14, 2017, 07:59:19 am »
The tricks are (I think):
- plug the FTDI (USB to serial adapter) in to the computer without the GPS being connected to the FTDI.
I am using the cambridge option with a Revo board. (i dont think a FTDI works on a Mac? I have one though)

- determine what the port name is
Clearly tty.usbmodem1421

- make sure you have write access to the port
This user have admin control to whole Mac

- using sudo may be too slow (entering password)
- it's serial, so GPS Tx,Rx crosses and connects to FTDI Rx,Tx
Yes, confirmed the crossing is correct.

- type the command line
- get the GPS (MCU+GPS port) ready to plug in to the FTDI
- plug the GPS in to the FTDI and immediately press Enter
Same result :(

It's been a while since I did this.  You may need to short SBL pads on GPS to get this to work?
That should be if using option A, not the OPUploadTool according the instruction file?

Do you think we can rule out there is something wrong with the OPUploadTool I build locally?
If that little app is okay then my building environment is okay at least.
How to check that?

Re: Problems set up Build environment on OS X
« Reply #14 on: January 14, 2017, 08:19:49 am »
I would guess that if it built successfully, that it should work (other than we know the Windows version has a bug).