Recent

Author Topic: FPC 3.2.x series branched, trunk update to 3.3.1  (Read 14677 times)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6617
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #15 on: November 09, 2018, 11:09:52 pm »
@marco
I don't know anything about multithreading and IsMultiThread variable in fpc.
I wanted only inform the developers and users of fpc.
In example from above and in ibx-examples with fpc 3.0.2 IsMultiThread is in OnFormCreate true but with fpc 3.2.0. it is false.

Yes. And that means according to the documentation that threading is now initialized later, probably a result of preparation for packages.

Which is entirely legal as long as you don't use the variable for anything else than it is meant for.

ASerge

  • Hero Member
  • *****
  • Posts: 998
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #16 on: November 10, 2018, 02:24:59 am »
It seems that something with the IsMultiThread variable changed.
Yes, there was a bug in the previous version that fixed.

Soner

  • Full Member
  • ***
  • Posts: 105
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #17 on: November 10, 2018, 02:22:12 pm »
Thank you all for the explanition.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #18 on: December 02, 2018, 03:09:23 am »
I compile fpc 3.2.0.r59470 with fpc 3.2.0.r39795 from 2018/9/23
I am on Windows 7 Pro 64bit using Lazarus 2.0 RC1 32bit SVN Revision 59712M and FPC 3.2.0 beta 32bit '2018-09-18 rev 39766' trying to reach SVN Revision 40301.

Should "C:\lazarus\tools\install\win\build-fpc.bat" be an easy way to recompile FPC 3.2.0 beta updated via SVN fixes_3_2?
I am trying to rebuild FPC 3.2.0 beta, but it's not working.

-----------------------------------------------------------------------
Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\valdir>cd \lazarus\tools\install\win

C:\lazarus\tools\install\win>build-fpc.bat

C:\lazarus\tools\install\win>SET OLDCURDIR=C:\lazarus\tools\install\win

C:\lazarus\tools\install\win>SET OLDCURDRIVE=C:

C:\lazarus\tools\install\win>SET FPCSRC_DIR=\fpcsrc

C:\lazarus\tools\install\win>SET SOURCE_DIR=\fpc-source

C:\lazarus\tools\install\win>export -q \fpcsrc \fpc-source
'export' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

C:\lazarus\tools\install\win>\f
'\f' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

C:\lazarus\tools\install\win>cd \fpc-source
O sistema não pode encontrar o caminho especificado.

C:\lazarus\tools\install\win>if [] == [] GOTO NO_PATCH

C:\lazarus\tools\install\win>gmkdir -p \fpc\source
'gmkdir' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.
A sintaxe do comando está incorreta.

C:\lazarus\tools\install\win>cp -pr \fpc-source\rtl \fpc\source\rtl >>

C:\lazarus\tools\install\win>
-----------------------------------------------------------------------



Could FPC have SVN Revision Number similar to Lazarus About Form?
Or could Lazarus About Form also shows FPC SVN Revision Number?

Revision number in IDE main window caption
http://forum.lazarus.freepascal.org/index.php/topic,42342.0.html
-----------------------------------------------------------------------
C:\Users\valdir>C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe -iV
3.2.0


C:\Users\valdir>C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe -iW
3.2.0-beta


C:\lazarus\fpc\3.2.0\bin\i386-win32>fpc.exe
Free Pascal Compiler version 3.2.0-beta [2018/10/21] for i386
Copyright (c) 1993-2018 by Florian Klaempfl and others
C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe [options] <inputfile> [options]
 Only options valid for the default or selected platform are listed.


C:\type C:\lazarus\fpc\3.2.0\utils\fpcm\revision.inc
'2018-09-18 rev 39766'
-----------------------------------------------------------------------

Cyrax

  • Hero Member
  • *****
  • Posts: 624
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #19 on: December 02, 2018, 03:14:16 am »
I compile fpc 3.2.0.r59470 with fpc 3.2.0.r39795 from 2018/9/23
I am on Windows 7 Pro 64bit using Lazarus 2.0 RC1 32bit SVN Revision 59712M and FPC 3.2.0 beta 32bit '2018-09-18 rev 39766' trying to reach SVN Revision 40301.

Should "C:\lazarus\tools\install\win\build-fpc.bat" be an easy way to recompile FPC 3.2.0 beta updated via SVN fixes_3_2?
I am trying to rebuild FPC 3.2.0 beta, but it's not working.

-----------------------------------------------------------------------
Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\valdir>cd \lazarus\tools\install\win

C:\lazarus\tools\install\win>build-fpc.bat

C:\lazarus\tools\install\win>SET OLDCURDIR=C:\lazarus\tools\install\win

C:\lazarus\tools\install\win>SET OLDCURDRIVE=C:

C:\lazarus\tools\install\win>SET FPCSRC_DIR=\fpcsrc

C:\lazarus\tools\install\win>SET SOURCE_DIR=\fpc-source

C:\lazarus\tools\install\win>export -q \fpcsrc \fpc-source
'export' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

C:\lazarus\tools\install\win>\f
'\f' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

C:\lazarus\tools\install\win>cd \fpc-source
O sistema não pode encontrar o caminho especificado.

C:\lazarus\tools\install\win>if [] == [] GOTO NO_PATCH

C:\lazarus\tools\install\win>gmkdir -p \fpc\source
'gmkdir' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.
A sintaxe do comando está incorreta.

C:\lazarus\tools\install\win>cp -pr \fpc-source\rtl \fpc\source\rtl >>

C:\lazarus\tools\install\win>
-----------------------------------------------------------------------



Could FPC have SVN Revision Number similar to Lazarus About Form?
Or could Lazarus About Form also shows FPC SVN Revision Number?

Revision number in IDE main window caption
http://forum.lazarus.freepascal.org/index.php/topic,42342.0.html
-----------------------------------------------------------------------
C:\Users\valdir>C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe -iV
3.2.0


C:\Users\valdir>C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe -iW
3.2.0-beta


C:\lazarus\fpc\3.2.0\bin\i386-win32>fpc.exe
Free Pascal Compiler version 3.2.0-beta [2018/10/21] for i386
Copyright (c) 1993-2018 by Florian Klaempfl and others
C:\lazarus\fpc\3.2.0\bin\i386-win32\fpc.exe [options] <inputfile> [options]
 Only options valid for the default or selected platform are listed.


C:\type C:\lazarus\fpc\3.2.0\utils\fpcm\revision.inc
'2018-09-18 rev 39766'
-----------------------------------------------------------------------

You probably need to install subversion client tools into your computer.

I recommend TortoiseSVN : https://tortoisesvn.net/
Get the 64-bit version and remember to select 32-bit version and the command line tools at the setup screen.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #20 on: December 02, 2018, 06:29:35 pm »
I am on Windows 7 Pro 64bit using Lazarus 2.0 RC1 32bit SVN Revision 59712M and FPC 3.2.0 beta 32bit '2018-09-18 rev 39766' trying to reach SVN Revision 40301.

Should "C:\lazarus\tools\install\win\build-fpc.bat" be an easy way to recompile FPC 3.2.0 beta updated via SVN fixes_3_2?
I am trying to rebuild FPC 3.2.0 beta, but it's not working.


Could FPC have SVN Revision Number similar to Lazarus About Form?
Or could Lazarus About Form also shows FPC SVN Revision Number?

Revision number in IDE main window caption
http://forum.lazarus.freepascal.org/index.php/topic,42342.0.html
You probably need to install subversion client tools into your computer.

I recommend TortoiseSVN : https://tortoisesvn.net/
Get the 64-bit version and remember to select 32-bit version and the command line tools at the setup screen.
I apologise for not expressing myself entirely clearly.
I have already done all that you suggest, but my problem still lies on how to build/compile FPC 3.2.0 beta after SVN fixes_3_2 updates for testing it with Lazarus 2.0 RC (also updated via SVN fixes_2_0)?
Can you help me on that?

Besides Lazarus 2.0 RC having "menu Tools > Build Lazarus" to build itself, it would be of great help another option for building FPC from inside Lazarus.   

Cyrax

  • Hero Member
  • *****
  • Posts: 624
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #21 on: December 02, 2018, 09:14:09 pm »
I am on Windows 7 Pro 64bit using Lazarus 2.0 RC1 32bit SVN Revision 59712M and FPC 3.2.0 beta 32bit '2018-09-18 rev 39766' trying to reach SVN Revision 40301.

Should "C:\lazarus\tools\install\win\build-fpc.bat" be an easy way to recompile FPC 3.2.0 beta updated via SVN fixes_3_2?
I am trying to rebuild FPC 3.2.0 beta, but it's not working.


Could FPC have SVN Revision Number similar to Lazarus About Form?
Or could Lazarus About Form also shows FPC SVN Revision Number?

Revision number in IDE main window caption
http://forum.lazarus.freepascal.org/index.php/topic,42342.0.html
You probably need to install subversion client tools into your computer.

I recommend TortoiseSVN : https://tortoisesvn.net/
Get the 64-bit version and remember to select 32-bit version and the command line tools at the setup screen.
I apologise for not expressing myself entirely clearly.
I have already done all that you suggest, but my problem still lies on how to build/compile FPC 3.2.0 beta after SVN fixes_3_2 updates for testing it with Lazarus 2.0 RC (also updated via SVN fixes_2_0)?
Can you help me on that?

Besides Lazarus 2.0 RC having "menu Tools > Build Lazarus" to build itself, it would be of great help another option for building FPC from inside Lazarus.

Do you have previous release version of FPC (3.0.4) installed and in your path environment variable when executing your commands?

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #22 on: December 03, 2018, 05:24:23 am »
Do you have previous release version of FPC (3.0.4) installed and in your path environment variable when executing your commands?
Not exactly.

I have installed to "c:\Lazarus":
lazarus-2.0.0RC1-59029-fpc-3.2.0-beta-20181021-win32.exe
lazarus-2.0.0RC1-59029-fpc-3.2.0-beta-20181021-cross-x86_64-win64-win32.exe

Then, I have installed "fpc-3.0.4.i386-win32.exe" to "C:\lazarus\fpc\3.0.4".

What should I do next?

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #23 on: December 12, 2018, 12:31:25 am »
Do you have previous release version of FPC (3.0.4) installed and in your path environment variable when executing your commands?
Not exactly.

I have installed to "c:\Lazarus":
lazarus-2.0.0RC1-59029-fpc-3.2.0-beta-20181021-win32.exe
lazarus-2.0.0RC1-59029-fpc-3.2.0-beta-20181021-cross-x86_64-win64-win32.exe

Then, I have installed "fpc-3.0.4.i386-win32.exe" to "C:\lazarus\fpc\3.0.4".

What should I do next?
After deleting all *.ppu and *.o, I am trying to compile FPC 3.2.0 beta with fixes_3_2 using FPC 3.0.4 and I got stuck at:
--------------------------
The installer encountered the following error:
External command "C:/lazarus/fpc/3.2.0/compiler/ppc386.exe -Twin32 -FEbin\i386-w
in32 -FUunits\i386-win32\ -FuC:\lazarus\fpc\3.2.0\rtl\units\i386-win32\ -FuC:\la
zarus\fpc\3.2.0\units\i386-win32\fcl-base\ -FuC:\lazarus\fpc\3.2.0\units\i386-wi
n32\fcl-res\ -FuC:\lazarus\fpc\3.2.0\units\i386-win32\rtl-objpas\ -FuC:\lazarus\
fpc\3.2.0\units\i386-win32\paszlib\ -FuC:\lazarus\fpc\3.2.0\units\i386-win32\has
h\ -FuC:\lazarus\fpc\3.2.0\units\i386-win32\fcl-json\ -FuC:\lazarus\fpc\3.2.0\un
its\i386-win32\rtl-extra\ -Ur -Xs -O2 -n -di386 -dRELEASE -viq ptop.pp" failed w
ith exit code 1. Console output:
Target OS: Win32 for i386
Compiling ptop.pp
Fatal: Can't find unit singleinstance used by CustApp
Fatal: Compilation aborted

make[2]: *** [all] Error 1
make[2]: Leaving directory `C:/lazarus/fpc/3.2.0/utils'
make[1]: *** [utils_all] Error 2
make[1]: Leaving directory `C:/lazarus/fpc/3.2.0'
make: *** [build-stamp.i386-win32] Error 2
--------------------------

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4949
    • wiki
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #24 on: December 12, 2018, 08:55:24 pm »
1) Do you need to rebuild:
- the compiler
- the rtl
- package(s)
?

packages can often be copied to a new location and recompiled. But only if you do not use other packages that depend on the one you rebuild.

the compiler...
the official answer is buildfaq.pdf

Here is how I do it (hope I make no copy and paste error)

checkout (fully recursive)
https://svn.freepascal.org/svn/fpc/trunk
https://svn.freepascal.org/svn/fpcbuild/trunk

Have ready an install (eg lazarus) of the latest released fpc.

Include in your PATH
- the installed released fpc directory
- build_trunk\install\binw32 or binw64 (and if needed crosstools)
  build_trunk is svn/fpcbuild/trunk

Make sure you do not have Delphi's make in the path.

  cd path/in/svndir/fpc/trunk
  make clean distclean
  make.exe all   OPT="-gw" 

you may want to add (at your option)
  make.exe all   OPT="-gw"  COPYTREE=echo UPXPROG=echo

then
  make.exe install  INSTALL_PREFIX=yourinstdir  COPYTREE=echo UPXPROG=echo

generate your fpc.cfg
   fpcmkcfg.exe  -d "basepath=__yourinstdir__" -o "__yourinstdir__\bin\%FPCFULLTARGET%\fpc.cfg"

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6617
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #25 on: December 12, 2018, 09:31:44 pm »
I did some work on my snapshot script, it is online here:

It is a windows .cmd file with a small, optional FPC compiled utility that is a substitute for the *nix "time" command.

The script allows building for win32 and win64, and has several
parameterizable options, configurable  by editing batch variables in the
script, and warns if a step (build or install) went wrong.

I use two copies of this, one for win32 and one for win64. (one line
difference). Please read over the first half to check variables.

It assumes a FPC directory (with tools like make etc) in the %PATH%, but
allows to use the starting compiler to be specified explicitely.  This
is so that it works when I have a development snapshot in the path, but
still want to start the build using the release compiler.

On current multicore machines, using a script can significantly decrease FPC snapshot building times.

Times for install+ build on machines with SSD:

i7-3770:  2mins 8s
i5-6500T (?) laptop about the same.

Ryzen 2600:  1min 35s

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #26 on: December 12, 2018, 10:56:21 pm »
1) Do you need to rebuild:
- the compiler
- the rtl
- package(s)
?
I would like to compile the whole thing.
I was trying something as simple as:
-----------------------------------
C:\Users\xxx>cd \lazarus\fpc\3.2.0\

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe distclean

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe clean

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe all

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe documentation

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe examples

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe tests

C:\lazarus\fpc\3.2.0>c:\lazarus\fpc\3.0.4\bin\i386-win32\make.exe install
-----------------------------------
« Last Edit: December 12, 2018, 11:35:16 pm by valdir.marcos »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #27 on: December 12, 2018, 11:38:40 pm »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #28 on: December 12, 2018, 11:41:18 pm »
Here is how I do it (hope I make no copy and paste error)

checkout (fully recursive)
https://svn.freepascal.org/svn/fpc/trunk
https://svn.freepascal.org/svn/fpcbuild/trunk

Have ready an install (eg lazarus) of the latest released fpc.

Include in your PATH
- the installed released fpc directory
- build_trunk\install\binw32 or binw64 (and if needed crosstools)
  build_trunk is svn/fpcbuild/trunk

Make sure you do not have Delphi's make in the path.

  cd path/in/svndir/fpc/trunk
  make clean distclean
  make.exe all   OPT="-gw" 

you may want to add (at your option)
  make.exe all   OPT="-gw"  COPYTREE=echo UPXPROG=echo

then
  make.exe install  INSTALL_PREFIX=yourinstdir  COPYTREE=echo UPXPROG=echo

generate your fpc.cfg
   fpcmkcfg.exe  -d "basepath=__yourinstdir__" -o "__yourinstdir__\bin\%FPCFULLTARGET%\fpc.cfg"
I'll try it.
Thanks.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 544
Re: FPC 3.2.x series branched, trunk update to 3.3.1
« Reply #29 on: December 12, 2018, 11:43:51 pm »
I did some work on my snapshot script, it is online here:

It is a windows .cmd file with a small, optional FPC compiled utility that is a substitute for the *nix "time" command.

The script allows building for win32 and win64, and has several parameterizable options, configurable  by editing batch variables in the script, and warns if a step (build or install) went wrong.

I use two copies of this, one for win32 and one for win64. (one line difference). Please read over the first half to check variables.

It assumes a FPC directory (with tools like make etc) in the %PATH%, but allows to use the starting compiler to be specified explicitely.  This is so that it works when I have a development snapshot in the path, but still want to start the build using the release compiler.

On current multicore machines, using a script can significantly decrease FPC snapshot building times.

Times for install+ build on machines with SSD:

i7-3770:  2mins 8s
i5-6500T (?) laptop about the same.

Ryzen 2600:  1min 35s
I'll try it.
Thanks.