Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

Cross compiling a package woes..

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Brad Campbell

G'day all,

I'm using the latest FIXES_2.2 branch of FPC and lazarus svn from about 10 minutes ago. I usually compile lazarus from SVN, then compile again with make idepkg
to get my packages included. It's worked for me thus far, but now I want to cross compile I can't figure out how to go about it.

I'm cross compiling from linux-i386 to darwin-i386 / darwin-powerpc and win32-i386. All these I have working, and I can even cross compile lazarus itself to run on these platforms. When I want to use lazbuild to build my application I get this...

brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --os=darwin --cpu=powerpc --ws=carbon BST.lpr
TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 [TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B -MObjFPC -Sgi -O1 -Tdarwin -gl -vewnhi -l -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas" WorkDir="/home/brad/devel/fpc/lazarus/TreeView/"
TOutputFilter.Execute :TProcessUTF8
Hint: Start of reading config file /home/brad/.fpc.cfg Hint: End of reading config file /home/brad/.fpc.cfg Free Pascal Compiler version 2.2.3 [2008/10/01] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tv.pas
Compiling directorytreeview.pas
directorytreeview.pas(47,5) Note: Private field "TDirectoryTreeview.OldNode" is never used Assembling directorytreeview
PPU Loading /home/brad/devel/fpc/lazarus/packager/units/powerpc-darwin/lazaruspackageintf.ppu PPU is compiled for another processor
Fatal: Can't find unit LazarusPackageIntf used by tv TExternalToolList.Run Exception: /home/brad/devel/fpc/lazarus/TreeView/directorytreeview.pas(1,1) Fatal: Can't find unit LazarusPackageIntf used by tv ERROR: tool reported error

Now the first thing I spot is lazbuild is ignoring the --cpu flag and trying to compile with an i386 compiler. This will work in this instance as I have units for darwin in i386 and ppc, but it's still wrong. I had the same problem trying to compile lazarus from within lazarus. The only way I could get it to use a ppc compiler was to do a...

make OS_TARGET=darwin CPU_TARGET=powerpc LCL_PLATFORM=carbon all

...in my lazarus directory.

Can anyone offer any insight as to why I can't cross compile lazarus with my packages?

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Henry Vermaak
to Brad Campbell

2008/10/1 Brad Campbell :

Show quoted text 17 lines
G'day all, I'm using the latest FIXES_2.2 branch of FPC and lazarus svn from about 10 minutes ago. I usually compile lazarus from SVN, then compile again with make idepkg to get my packages included. It's worked for me thus far, but now I want to cross compile I can't figure out how to go about it. I'm cross compiling from linux-i386 to darwin-i386 / darwin-powerpc and win32-i386. All these I have working, and I can even cross compile lazarus itself to run on these platforms. When I want to use lazbuild to build my application I get this... brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --os=darwin --cpu=powerpc --ws=carbon BST.lpr TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 [TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B -MObjFPC -Sgi -O1 -Tdarwin -gl -vewnhi -l -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas"

i don't know if lazbuild is clever enough to find the right compiler, maybe you need to specify it with --compiler=/opt/cross/bin/ppcrossppc (or whatever your powerpc compiler is called).

henry

Reply by email

Brad Campbell
to Mattias Gärtner
Mattias G?rtner wrote 31 lines
Zitat von Henry Vermaak : > 2008/10/1 Brad Campbell : >> G'day all, >> >> I'm using the latest FIXES_2.2 branch of FPC and lazarus svn from about 10 >> minutes ago. >> I usually compile lazarus from SVN, then compile again with >> make idepkg >> to get my packages included. It's worked for me thus far, but now I want to >> cross compile I can't >> figure out how to go about it. >> >> I'm cross compiling from linux-i386 to darwin-i386 / darwin-powerpc and >> win32-i386. >> All these I have working, and I can even cross compile lazarus itself to >> run on these platforms. >> When I want to use lazbuild to build my application I get this... >> >> brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild >> --os=darwin --cpu=powerpc >> --ws=carbon BST.lpr >> TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 >> [TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B -MObjFPC -Sgi >> -O1 -Tdarwin -gl -vewnhi -l >> -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas" > i don't know if lazbuild is clever enough to find the right compiler, > maybe you need to specify it with --compiler=/opt/cross/bin/ppcrossppc > (or whatever your powerpc compiler is called). The CPU override was not used for projects. Fixed in 16831.

Ok, I did a svn up, make distclean ; make LCL_PLATFORM=gtk2 all .. and it's still not working.

It's still giving precisely the output above.. with CmdLine="/opt/cross/bin/ppc386".. I'm sure that should just be /opt/cross/bin/fpc and it will figure it out from the -P and -T parameters..

I've managed to get lazarus to cross-compile for powerpc, using make directly. I've managed to get it to compile the idepkg target (after having to add the ~/lazarus/TreeView path to my -Fu in ~/.fpc.cfg).. but lazbuild still will not pick the right compiler for me.

It's griping it can't find the comctrls unit (which is fair, it's using ppc386 and looking for a 386 binary in the powerpc directory).

Am I doing something obviously stupid?

brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --cpu=powerpc --os=darwin --ws=carbon BST.lpr
TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 [TExternalToolList.Run] CmdLine="/opt/cross/bin/ppc386 -B -MObjFPC -Sgi -O1 -Tdarwin -Ppowerpc -gl -vewnhi -l -Fu../packager/units/powerpc-darwin/ -Fu. -FUlib/powerpc-darwin/ tv.pas" WorkDir="/home/brad/devel/fpc/lazarus/TreeView/"
TOutputFilter.Execute :TProcessUTF8
Hint: Start of reading config file /home/brad/.fpc.cfg Hint: End of reading config file /home/brad/.fpc.cfg Free Pascal Compiler version 2.2.3 [2008/10/01] for i386 Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Darwin for i386
Compiling tv.pas
Compiling directorytreeview.pas
Fatal: Can't find unit ComCtrls used by DirectoryTreeview TExternalToolList.Run Exception: /home/brad/devel/fpc/lazarus/TreeView/directorytreeview.pas(1,1) Fatal: Can't find unit ComCtrls used by DirectoryTreeview ERROR: tool reported error
brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ find ../../../lazarus/lcl/units/ -name comctrls.ppu ../../../lazarus/lcl/units/i386-linux/comctrls.ppu ../../../lazarus/lcl/units/powerpc-darwin/comctrls.ppu brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ grep lazarus ~/.fpc.cfg -Fu/home/brad/devel/fpc/lazarus/lcl/units/$fpctarget -Fu/home/brad/devel/fpc/lazarus/TreeView
brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ cd ../../../lazarus/ brad at bkmac:~/devel/fpc/lazarus$ svn up
At revision 16831.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Brad Campbell
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Mattias G?rtner wrote
The CPU override was not used for projects. Fixed in 16831. You can use 'fpc' instead of 'ppc386'. This will call ppc386 or ppcppc or whatever automatically.

I see... ppc386 was in my lazarus config.. fixed that.. then got this..

brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --cpu=powerpc --os=darwin --ws=carbon BST.lpr
TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 $08048D34 TLAZBUILDAPPLICATION__ONIDEMESSAGEDIALOG, line 267 of lazbuild.lpr $0815A8E7 CHECKFILE, line 3152 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $0815A661 TLAZPACKAGEGRAPH__CHECKAMBIGUOUSPACKAGEUNITS, line 3190 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $081594E9 TLAZPACKAGEGRAPH__COMPILEPACKAGE, line 2898 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $081590A7 TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES, line 2800 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $08049EF8 TLAZBUILDAPPLICATION__BUILDPROJECT, line 612 of lazbuild.lpr $08048F11 TLAZBUILDAPPLICATION__BUILDFILE, line 297 of lazbuild.lpr $0804B622 TLAZBUILDAPPLICATION__RUN, line 975 of lazbuild.lpr $0804CAC1 main, line 1179 of lazbuild.lpr
was found in one of the source directories of the package tv 0.0 and looks like a compiled unit.Compiled units must be in the output directory of the package, otherwiseDelete ambiguous file?t problems using this package.

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Vincent Snijders
to Brad Campbell: Ok, I did a svn up, make distclean ; make LCL_PLATFORM=gtk2 all .. and it's still not…
Brad Campbell wrote 15 lines
Ok, I did a svn up, make distclean ; make LCL_PLATFORM=gtk2 all .. and it's still not working. It's still giving precisely the output above.. with CmdLine="/opt/cross/bin/ppc386".. I'm sure that should just be /opt/cross/bin/fpc and it will figure it out from the -P and -T parameters.. I've managed to get lazarus to cross-compile for powerpc, using make directly. I've managed to get it to compile the idepkg target (after having to add the ~/lazarus/TreeView path to my -Fu in ~/.fpc.cfg).. but lazbuild still will not pick the right compiler for me. It's griping it can't find the comctrls unit (which is fair, it's using ppc386 and looking for a 386 binary in the powerpc directory). Am I doing something obviously stupid?

What compiler did you specify in the environment options of lazarus? If you don't want to use that, you can specify the compiler on the lazbuild command line using the --compiler parameter. See
http://wiki.lazarus.freepascal.org/lazbuild#Options

Vincent

Vincent

Reply by email

Mattias Gaertner
to Brad Campbell: I see... ppc386 was in my lazarus config.. fixed that.. then got this.. brad at…
Show quoted text 27 lines
Mattias G?rtner wrote: > The CPU override was not used for projects. Fixed in 16831. > > You can use 'fpc' instead of 'ppc386'. This will call ppc386 or > ppcppc or whatever automatically. I see... ppc386 was in my lazarus config.. fixed that.. then got this.. brad at bkmac:~/devel/fpc/Projects/Pascal/SIDE$ ../../../lazarus/lazbuild --cpu=powerpc --os=darwin --ws=carbon BST.lpr TLazPackageGraph.CheckIfPackageNeedsCompilation No state file for tv 0.0 $08048D34 TLAZBUILDAPPLICATION__ONIDEMESSAGEDIALOG, line 267 of lazbuild.lpr $0815A8E7 CHECKFILE, line 3152 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $0815A661 TLAZPACKAGEGRAPH__CHECKAMBIGUOUSPACKAGEUNITS, line 3190 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $081594E9 TLAZPACKAGEGRAPH__COMPILEPACKAGE, line 2898 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $081590A7 TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES, line 2800 of /home/brad/devel/fpc/lazarus/packager/packagesystem.pas $08049EF8 TLAZBUILDAPPLICATION__BUILDPROJECT, line 612 of lazbuild.lpr $08048F11 TLAZBUILDAPPLICATION__BUILDFILE, line 297 of lazbuild.lpr $0804B622 TLAZBUILDAPPLICATION__RUN, line 975 of lazbuild.lpr $0804CAC1 main, line 1179 of lazbuild.lpr was found in one of the

The message is unreadable because of the line endings. I fixed the message output of lazbuild.
This way you can see the error and clean up your package directory.

source directories of the package tv 0.0 and looks like a compiled unit.Compiled units must be in the output directory of the package, otherwiseDelete ambiguous file?t problems using this package.

Mattias

Reply by email