Recent

Author Topic: fpcup 3.1.1 Update  (Read 136844 times)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #195 on: October 26, 2016, 11:18:09 am »
You're welcome !

The process of getting new features for FPC and/or Lazarus approved can be long.
Features have to be tested on many platforms and must be compatible with future goals of the core maintainers.

However, sometimes one can benefit from bleeding edge features like the ones available in the NewPascal branch. And NewPascal can benefit from the feedback of its users.
And, in the end, FPC and Lazarus will hopefully benefit from these efforts.

So, feel free to use, test and especially feel free to give feedback.

New features are coming, so stay tuned !!

ps:
You can use fpclazup to install newpascal yourself:
Code: Pascal  [Select][+][-]
  1. fpclazup.exe --installdir="c:\whereyoulikeyournewpascal" --fpcurl="newpascal" --lazurl="newpascal"

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #196 on: October 26, 2016, 01:17:08 pm »
Environment: Windows 10 64-bit
You invited questions, so here goes..

I have a simple question (I hope!)
Having downloaded and installed NewPascal, it runs and debugs Win32 applications just fine.
I can cross-compile to Win64, but only if I switch debugger path (in IDE options) to a 64-bit debugger.  (I can live with that)

I was intrigued with the possibility of cross-compiling to Target OS=linux so I downloaded and unpacked the CrossLinuxi386.rar, which created and populated a NewPascal/cross folder.  The CrossLinuxx64.rar added the 64-bit subfolders.

But here's where I am stuck when choosing target=linux at the 'cannot find fcllaz' message - a clue that I haven't set the options/paths correctly.

So here's the simple question: How can I configure a project in the NewPascal environment to successfully cross-compile to linux?
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #197 on: October 26, 2016, 02:27:06 pm »
Thanks for the feedback !
I have tried to reproduce your issue.

Downloaded NPLazBaseWin32.rar archives from:
https://github.com/newpascal/newpascal/releases/tag/np_sc-v1.0.34
Unpack into c:\NewPascal
Started Lazarus with the provided link.
Runs win32 and win64 out-of-the-box without debugger switching.

So, this is strange: the archive should give you win32/64 automagically, if started with the provided link !
It does of my pc, it does not on yours. So, I cannot reproduce.

Downloaded the two Linux archives. Can compile for Linux without problem.
(if you add this into the top of your lpr-file ; due to the Arch libs that are provided by these archives):
Code: Pascal  [Select][+][-]
  1. {$IFDEF LINUX}
  2.   {$IFDEF FPC_CROSSCOMPILING}
  3.     {$linklib libc_nonshared.a}
  4.     {$IFDEF CPUARM}
  5.       // if we have a GUI, uncomment
  6.       // {$linklib GLESv2}
  7.     {$ENDIF}
  8.   {$ENDIF}
  9. {$ENDIF}


minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #198 on: October 26, 2016, 03:27:16 pm »
Thanks for the feedback !
I have tried to reproduce your issue.

Downloaded NPLazBaseWin32.rar archives from:
https://github.com/newpascal/newpascal/releases/tag/np_sc-v1.0.34
Unpack into c:\NewPascal
Started Lazarus with the provided link.
Runs win32 and win64 out-of-the-box without debugger switching.

So, this is strange: the archive should give you win32/64 automagically, if started with the provided link !
It does of my pc, it does not on yours. So, I cannot reproduce.

Downloaded the two Linux archives. Can compile for Linux without problem.
(if you add this into the top of your lpr-file ; due to the Arch libs that are provided by these archives):
Code: Pascal  [Select][+][-]
  1. {$IFDEF LINUX}
  2.   {$IFDEF FPC_CROSSCOMPILING}
  3.     {$linklib libc_nonshared.a}
  4.     {$IFDEF CPUARM}
  5.       // if we have a GUI, uncomment
  6.       // {$linklib GLESv2}
  7.     {$ENDIF}
  8.   {$ENDIF}
  9. {$ENDIF}
Sorry - I started a new application, put the above lines in the lpr and tried target OS=linux, but still got the fcllaz error.

Thanks for trying to reproduce - I know how frustrating it is when that happens!
I was very careful to follow instructions.  Unpacked all rars into c:/NewPascal and used the shortcut link provided etc.  The folder structure looks as the web page describes.

Some thoughts:
After the standard install, and looking through the config file and IDE options, I can't find anything pointing to the C:\NewPascal\cross folder.  Where would that reference be?

The IDE/options/debugger type and path points to C:\NewPascal\fpcbootstrap\gdb.exe
I downloaded the 64-bit debugger and added its path to the 'additional search path' but no go.  Its only when I change the path to the 64-bit debugger that 64-bit compile/run works.  When I then change to a 32-bit target, it won't run until I change the debugger path back to the fpcbootstrap one.

Should I add something into the Environment PATH?

Should I edit the C:\NewPascal\config_lazarus\idemake.cfg? (which contains only references to win32)

I notice that the C:\NewPascal\lazarus\units folder only contains an i386-win32 folder.  Is this right?

The default win32 configuration works perfectly by the way (so I must have done something right when installing)

Can you suggest any tests I can do, or screengrabs to post?
I once downloaded and ran the CodeTyphoon distribution, which cross-compiled out of the box, so I know it's possible on my system.   I don't want to use codetyphoon though for compatibility (and ethical) reasons.

There's obviously some difference between my environment and yours.  I wonder what it could be?  I hope it's some obvious error that I can fix.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #199 on: October 26, 2016, 03:35:26 pm »
Good feedback !!

Now going into details
You should have a c:\NewPascal\mingw directory, containing newest gdb (7.11) for both win32/64.
The debugger should point to: $(LazarusDir)\..\mingw\$(TargetCPU)-$(TargetOS)\bin\gdb.exe.
So, should automagically switch-over.

I have included a screenshot.

totya

  • Hero Member
  • *****
  • Posts: 720
Re: fpcup 3.1.1 Update
« Reply #200 on: October 26, 2016, 03:47:18 pm »
Ok recursive then...
http://forum.lazarus.freepascal.org/index.php/topic,27211.msg226539.html#msg226539

Put some effort in. What you ask is not standard for a distribution.
You have to do that yourself.

- Fixes are not releases. You compile everything yourself
- Cross-compilers are generally not releases. You compile everything yourself
- Installing a debugger is easy, both with mingw and cygwin on Windows.

What do you want?
Does your mother still feed you with a spoon?

Figure it out yourself. That's the only way you will ever learn something

[edit]
In this case I am not grumpy, but what you are asking is what seasoned programmers do. You are not one of them.
I will be glad to help but first try it (seriously) yourself and read up on all documentation.

Hi!

If you can't understand what is the problem, please do not write me similar stupid things, thanks.

fcpup (fplazup) is an application, which can make own programing environment. I asdked a workable fixes version, with crosscompile (x86/x64). After I tired it, it didn't work. It's simple. If you don't understand this very simple situation, please learn it. Otherwise my mother is dead long time ago. Please do not write me similar stupid things anymore, thank you.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #201 on: October 26, 2016, 03:47:29 pm »
Perfecta!
Win32/64 bit crosscompiling now without problems.  I noticed the minigw path was 2nd in the drop-down list, so selected that.  Graçias @DonAlfredo :)

Any ideas on the linux 32/64 cross-compiling?  It's not as important as the Win 64-bit thing, but it would be really convenient if my NewPascal environment would do it.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #202 on: October 26, 2016, 03:51:28 pm »
Hi!

If you can't understand what is the problem, please do not write me similar stupid things, thanks.

fcpup (fplazup) is an application, which can make own programing environment. I asdked a workable fixes version, with crosscompile (x86/x64). After I tired it, it didn't work. It's simple. If you don't understand this very simple situation, please learn it. Otherwise my mother is dead long time ago. Please do not write me similar stupid things anymore, thank you.
Hi totya - it looks as if you had the same problem I had.  DonAlfredo posted the answer above, and it works for me!
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

totya

  • Hero Member
  • *****
  • Posts: 720
Re: fpcup 3.1.1 Update
« Reply #203 on: October 26, 2016, 03:54:10 pm »
Thanks, but I need a little break...

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #204 on: October 26, 2016, 04:01:26 pm »
To be honest, I do not yet know what is the problem with your install.
So, in order to help you, I need some more info.

Your fpc.cfg should contain something like:
Code: Pascal  [Select][+][-]
  1. # begin fpcup do not remove x86_64-linux
  2. #cross compile settings dependent on both target OS and target CPU
  3. #IFDEF FPC_CROSSCOMPILING
  4. #IFDEF CPUX86_64
  5. #IFDEF LINUX
  6. # Inserted by fpcup 22-10-2016 13:44:41
  7.  
  8. -FDC:\NewPascal\cross\bin\x86_64-linux\
  9. -XPx86_64-linux-
  10. -Tlinux
  11. -FlC:\NewPascal\cross\lib\x86_64-linux\
  12. -Xr/usr/lib
  13. #ENDIF
  14. #ENDIF
  15. #ENDIF
  16. # end fpcup do not remove
  17.  
So, when you choose Linux 64 bit, these settings point FPC towards the right binutils and libraries.
binutils: C:\NewPascal\cross\bin\x86_64-linux
libs: C:\NewPascal\cross\lib\x86_64-linux

Also, you should have a directory C:\NewPascal\fpc\units\x86_64-linux, filled with all kinds of packages.

Correct ?

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #205 on: October 26, 2016, 04:49:39 pm »
To be honest, I do not yet know what is the problem with your install.
So, in order to help you, I need some more info.

Your fpc.cfg should contain something like:
Code: Pascal  [Select][+][-]
  1. # begin fpcup do not remove x86_64-linux
  2. #cross compile settings dependent on both target OS and target CPU
  3. #IFDEF FPC_CROSSCOMPILING
  4. #IFDEF CPUX86_64
  5. #IFDEF LINUX
  6. # Inserted by fpcup 22-10-2016 13:44:41
  7.  
  8. -FDC:\NewPascal\cross\bin\x86_64-linux\
  9. -XPx86_64-linux-
  10. -Tlinux
  11. -FlC:\NewPascal\cross\lib\x86_64-linux\
  12. -Xr/usr/lib
  13. #ENDIF
  14. #ENDIF
  15. #ENDIF
  16. # end fpcup do not remove
  17.  
So, when you choose Linux 64 bit, these settings point FPC towards the right binutils and libraries.
binutils: C:\NewPascal\cross\bin\x86_64-linux
libs: C:\NewPascal\cross\lib\x86_64-linux

Also, you should have a directory C:\NewPascal\fpc\units\x86_64-linux, filled with all kinds of packages.

Correct ?
OK @DonAlfredo - I think I know what the problem was, and it was (as expected) my fault.

Here's how I messed up - it may be useful to you to solve other folk's problems.

1. I installed NewPascal with cross-compilers for Linux 32/64 as per instructions
2. I opened an existing project which had been created with my previous fpc/laz distribution and found it wouldn't cross-compile. (mistake #1)
(this was my error - I should have tested with a new clean empty Application in NewPascal)
3. In order to 'fix' things, I ran fpcup in update mode to the NewPascal folder.  I now know this was a stupid thing to do because it must have messed up the NewPascal environment by deleting the linux fpc/units and God knows what else. (mistake #2)
4. I then (belatedly) tested using Create New Application in NewPascal for Win64, Linux32 and Linux64.  It didn't work of course and I blamed the distribution. (mistake #3)

Now I see that I made 2 fatal assumptions:
1. Ignoring an existing projects environment (lpi file?) when testing a new environment
2. Trying to 'fix it myself' using fpcup, and then compounding the error by not telling you I'd done it when asking for help.

BTW in order to cross-compile to linux 32/64, every lpr file needs the lines you posted.  It doesn't work otherwise. Perhaps you could put that on the web page.
Code: Pascal  [Select][+][-]
  1. $IFDEF LINUX}
  2.   {$IFDEF FPC_CROSSCOMPILING}
  3.     {$linklib libc_nonshared.a}
  4.     {$IFDEF CPUARM}
  5.       // if we have a GUI, uncomment
  6.       // {$linklib GLESv2}
  7.     {$ENDIF}
  8.   {$ENDIF}
  9. {$ENDIF}      
  10.  
All works well now, and the 'NewPascal initiative' is a credit to your ingenuity and hard work.

Perhaps the only good thing to come from this is perhaps to warn NewPascal users NOT to:
1. Test cross-compiling using an existing project (or delete the lpi file before trying it)
2. Attempt to update using fpcup unless you know what you're doing (I didn't!)

Thanks for your patience, and I am now loving the 'NewPascal environment' :)
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #206 on: October 26, 2016, 05:13:23 pm »
Mmmm ... yes, you definitely messed up the install ...  ;)

But anyhow, this is very usefull feedback.
Especially the fact that the included fpclazup destroys the install. We will take measures.

The fact that {$linklib libc_nonshared.a} is needed, is still not a general fact.
It is however for NewPascal, due to the link-libs that come (mostly) from Arch Linux.
It has also been reported on the bugtracker, in a slightly different setting:
http://bugs.freepascal.org/view.php?id=30112

So, enjoy the install. And perhaps also enjoy the mORMot (in ccr) that will elevate your database experience ... and the new features that are coming soon ...

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: fpcup 3.1.1 Update
« Reply #207 on: October 26, 2016, 06:05:44 pm »
Here's the test project that cleared it up for me.
It has an lpi file containing the correct paths for c:\NewPascal, and the header in the program unit.
It should compile (run/compile many modes) without error if the NewPascal environment is correct for Win32, Win64, Linux32 and Linux64.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: fpcup 3.1.1 Update
« Reply #208 on: October 26, 2016, 06:28:37 pm »
And now do yourself some more joy ... :D

1)
Download the Android archive, install LAMW and have FPC fun on your phone and/or tablet.
Even the mORMot runs flawless on mobile !

2)
Buy yourself an Odroid-C2 and enjoy FPC/Lazarus on a cheap 64 bit superboard with eMMC that only consumes 2-3 Watt !

3)
Get yourself a free (for a year) Amazon Web Service t2 server, run a mORMot database server (REST,json) under Linux 64bit and connect with all !

 :)

manhu

  • New Member
  • *
  • Posts: 27
Re: fpcup 3.1.1 Update
« Reply #209 on: October 29, 2016, 02:36:25 pm »
Hi, I followed just reading for a while.
Just one question, is it possible to generate a Mac OS executable file from Windows?
Shalom Manfred

 

TinyPortal © 2005-2018