[fpc-pascal] Using other fpc installation
For debugging reasons I have installed fpc 2.6.4 on Debian so I can compile some old SVN revisions, number 32959 for example. I want to use the fp editor to run the test, but it seems as the "systemic" 2.6.4 is being used for compiling instead of the SVN version. The bug doesn't show up in 2.6.4, only in some 2.7.1 revisions and later. How can I make sure the SVN version is used and not the systems 2.6.4? The following paths was added to fp editor in Options->Units: /home/roger/fpc/fpc_svn/lib/fpc/2.7.1/unitsx86_64-linux /home/roger/fpc/fpc_svn/lib/fpc/2.7.1/unitsx86_64-linux/* /home/roger/fpc/fpc_svn/lib/fpc/2.7.1/unitsx86_64-linux/rtl Also, both the directories of fpc and ppcx64 was added to the path from commandline: PATH=home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin export PATH=home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin Despite the path, if I run "which fpc" from commandline I get "usr/bin/fpc" anyway. How is that possible when that fpc is not in the path? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using other fpc installation
I meant to say that system fpc is put AFTER the SVN fpc in the path. On 08/16/2017 09:09 PM, kapibara wrote: PATH=home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin export PATH=home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin Despite the path, if I run "which fpc" from commandline I get "usr/bin/fpc" anyway. How is that possible when that fpc is not in the path? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using other fpc installation
Ah, so FP has no versions other than the official releases then? (2.6.0, 2.6.2, 2.6.4 and so on) Why doesn't FP use the same compiler revision as the SVN sources it comes with? Because the fp executable is compiled at the same time as fpc? Alright then, I'll try instead: fpc test.pas Btw, why have fpc and also ppcx64? Does fpc call ppcx64? On 08/16/2017 09:45 PM, Marco van de Voort wrote: In our previous episode, kapibara via fpc-pascal said: I want to use the fp editor to run the test, but it seems as the "systemic" 2.6.4 is being used for compiling instead of the SVN version. Then you use a 2.6.4 FP. FP does not call the compiler, it has an own version of it internally. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using other fpc installation
You're right, now I fixed that and "which fpc" reports the SVN version! On 08/16/2017 10:15 PM, Tomas Hajny wrote: On Wed, August 16, 2017 21:15, kapibara via fpc-pascal wrote: I meant to say that system fpc is put AFTER the SVN fpc in the path. Due to the missing slash at the beginning of the PATH value? ;-) Obviously, that only answers the reason of the 'which fpc' command, whereas the compiler version used when compiling from the IDE has already been answered by Marco Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using other fpc installation
The old SVN version is now in play, so far so good! But then "Can't find unit system" happened: roger@bikupan:~/fpc/fptest_working$ fpc fptest.pas Free Pascal Compiler version 3.1.1 [2017/08/16] for x86_64 Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling fptest.pas Fatal: Can't find unit system used by fptest Fatal: Compilation aborted Error: /home/roger/fpc/fpc_svn/compiler/ppcx64 returned an error exitcode Before that I had changed the path: roger@bikupan:~/fpc/fptest_working$ PATH=/home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin roger@bikupan:~/fpc/fptest_working$ export PATH=/home/roger/fpc/fpc_svn/bin:/home/roger/fpc/fpc_svn/compiler:/usr/local/bin:/usr/bin:/bin roger@bikupan:~/fpc/fptest_working$ which fpc /home/roger/fpc/fpc_svn/bin/fpc On 08/16/2017 10:27 PM, Tomas Hajny wrote: On Wed, August 16, 2017 22:16, kapibara via fpc-pascal wrote: Ah, so FP has no versions other than the official releases then? (2.6.0, 2.6.2, 2.6.4 and so on) Why doesn't FP use the same compiler revision as the SVN sources it comes with? Because the fp executable is compiled at the same time as fpc? It uses the sources from which it has been compiled (the same way fpc does too). Fp is a separate make target. It may be part of a snapshot, and it may be compiled from SVN sources by you as well (it has some additional prerequisites if you want to have the debugger integrated, and it requires some additional FPC packages compiled first, but nothing special apart from that). Alright then, I'll try instead: fpc test.pas Btw, why have fpc and also ppcx64? Does fpc call ppcx64? Yes - or another compiler binary if (cross-)compiling for a different CPU/platform (e.g. ppc386, ppcarm, ppcjvm, etc.). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Using other fpc installation
To be sure fpc.cfg is found I started the compilation from fpc's bin directory where the fpc.cfg is located. roger@bikupan:~/fpc/fpc_svn/ bin$ ./fpc /home/roger/fpc/fptest_working/fptest.pas Free Pascal Compiler version 3.1.1 [2017/08/16] for x86_64 Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling /home/roger/fpc/fptest_working/fptest.pas Fatal: Can't find unit system used by fptest Fatal: Compilation aborted Error: /home/roger/fpc/fpc_svn/compiler/ppcx64 returned an error exitcode Here is the fpc.cfg # # Config file generated by fpcmkcfg on 16-8-17 - 21:46:51 # Example fpc.cfg for Free Pascal Compiler # # -- # Defines (preprocessor) # -- # # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed # # -d is the same as #DEFINE # -u is the same as #UNDEF # # # Some examples (for switches see below, and the -? helppages) # # Try compiling with the -dRELEASE or -dDEBUG on the commandline # # For a release compile with optimizes and strip debuginfo #IFDEF RELEASE -O2 -Xs #WRITE Compiling Release Version #ENDIF # For a debug version compile with debuginfo and all codegeneration checks on #IFDEF DEBUG -gl -Crtoi #WRITE Compiling Debug Version #ENDIF # assembling #ifdef darwin # use pipes instead of temporary files for assembling -ap # path to Xcode 4.3+ utilities (no problem if it doesn't exist) -FD/Applications/Xcode.app/ Contents/Developer/usr/bin #endif # # Parsing switches # # Pascal language mode # -Mfpc free pascal dialect (default) # -Mobjfpc switch some Delphi 2 extensions on # -Mdelphi tries to be Delphi compatible # -Mtp tries to be TP/BP 7.0 compatible # -Mgpc tries to be gpc compatible # -Mmacpas tries to be compatible to the macintosh pascal dialects # # Turn on Object Pascal extensions by default #-Mobjfpc # Assembler reader mode # -Rdefault use default assembler # -Ratt read AT&T style assembler # -Rintelread Intel style assembler # # All assembler blocks are AT&T styled by default #-Ratt # Semantic checking # -S2same as -Mobjfpc # -Scsupports operators like C (*=,+=,/= and -=) # -Sainclude assertion code. # -Sdsame as -Mdelphi # -Se error options. is a combination of the following: # : compiler stops after errors (default is 1) # w : compiler stops also after warnings # n : compiler stops also after notes # h : compiler stops also after hints # -Sgallow LABEL and GOTO # -ShUse ansistrings # -Sisupport C++ styled INLINE # -Skload fpcylix unit # -SI set interface style to # -SIcomCOM compatible interface (default) # -SIcorba CORBA compatible interface # -Smsupport macros like C (global) # -Sosame as -Mtp # -Spsame as -Mgpc # -Ssconstructor name must be init (destructor must be done) # -Sxenable exception keywords (default in Delphi/ObjFPC modes) # # Allow goto, inline, C-operators, C-vars -Sgic # --- # Code generation # --- # Uncomment the next line if you always want static/dynamic units by default # (can be overruled with -CD, -CS at the commandline) #-CS #-CD # Set the default heapsize to 8Mb #-Ch800 # Set default codegeneration checks (iocheck, overflow, range, stack) #-Ci #-Co #-Cr #-Ct # Optimizer switches # -Osgenerate smaller code # -Oa=N set alignment to N # -O1level 1 optimizations (quick optimizations, debuggable) # -O2level 2 optimizations (-O1 + optimizations which make debugging more difficult) # -O3level 3 optimizations (-O2 + optimizations which also may make the program slower rather than faster) # -Oo switch on optimalization x. See fpc -i for possible values # -OoNO switch off optimalization x. See fpc -i for possible values # -Op set target cpu for optimizing, see fpc -i for possible values #ifdef darwin #ifdef cpui386 -Cppentiumm -Oppentiumm #endif #endif # --- # Set Filenames and Paths # --- # Both slashes and backslashes are allowed in paths # path to the messagefile, not necessary anymore but can be used to override # the default language #-Fr/home/roger/fpc/fpc_svn/msg/errore.msg #-Fr/home/roger/fpc/fpc_svn/msg/errorn.msg #-Fr/home/roger/fpc/fpc_svn/msg/errores.msg #-Fr/home/roger/fpc/fpc_svn/msg/errord.msg #-Fr/home/roger/fpc/fpc_svn/msg/errorr.msg # searchpath for units and other system dependent things -Fu/home/roger/fpc/fpc_svn/units/$fpctarget -Fu/home/roger/fpc/fpc_svn/units/$fpctarget/* -Fu/home/roger/fpc/fpc_svn/units/$fpctarget/rtl -Fu/home/roger/fpc/pascalscript/Source #IFDEF FPCAPACHE_1_3 -Fu/home/roger/fpc/fpc_svn/units/$fpctarget/httpd13/ #ELSE #IFDEF FPCAPAC
Re: [fpc-pascal] Using other fpc installation
Alright, its compiling! It was wrong path in fpc.cfg. The DEB installation creates a directory structure under the fpc directory that matches this: /lib/fpc/3.1.1/units/$fpctarget Thanks again! On 08/16/2017 11:22 PM, Tomas Hajny wrote: On Wed, August 16, 2017 23:08, kapibara via fpc-pascal wrote: The old SVN version is now in play, so far so good! But then "Can't find unit system" happened: You need RTL (and other required units, e.g. from packages) compiled with that compiler version and provide path to it either using fpc.cfg, or -Fu command line parameter(s). Parameter -vt shows the path used by the compiler when trying to find the appropriate version of a compiled unit. Tomas The working fpc.cfg # Config file generated by fpcmkcfg on 16-8-17 - 23:52:00 # Example fpc.cfg for Free Pascal Compiler # # -- # Defines (preprocessor) # -- # # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed # # -d is the same as #DEFINE # -u is the same as #UNDEF # # # Some examples (for switches see below, and the -? helppages) # # Try compiling with the -dRELEASE or -dDEBUG on the commandline # # For a release compile with optimizes and strip debuginfo #IFDEF RELEASE -O2 -Xs #WRITE Compiling Release Version #ENDIF # For a debug version compile with debuginfo and all codegeneration checks on #IFDEF DEBUG -gl -Crtoi #WRITE Compiling Debug Version #ENDIF # assembling #ifdef darwin # use pipes instead of temporary files for assembling -ap # path to Xcode 4.3+ utilities (no problem if it doesn't exist) -FD/Applications/Xcode.app/ Contents/Developer/usr/bin #endif # # Parsing switches # # Pascal language mode # -Mfpc free pascal dialect (default) # -Mobjfpc switch some Delphi 2 extensions on # -Mdelphi tries to be Delphi compatible # -Mtp tries to be TP/BP 7.0 compatible # -Mgpc tries to be gpc compatible # -Mmacpas tries to be compatible to the macintosh pascal dialects # # Turn on Object Pascal extensions by default #-Mobjfpc # Assembler reader mode # -Rdefault use default assembler # -Ratt read AT&T style assembler # -Rintelread Intel style assembler # # All assembler blocks are AT&T styled by default #-Ratt # Semantic checking # -S2same as -Mobjfpc # -Scsupports operators like C (*=,+=,/= and -=) # -Sainclude assertion code. # -Sdsame as -Mdelphi # -Se error options. is a combination of the following: # : compiler stops after errors (default is 1) # w : compiler stops also after warnings # n : compiler stops also after notes # h : compiler stops also after hints # -Sgallow LABEL and GOTO # -ShUse ansistrings # -Sisupport C++ styled INLINE # -Skload fpcylix unit # -SI set interface style to # -SIcomCOM compatible interface (default) # -SIcorba CORBA compatible interface # -Smsupport macros like C (global) # -Sosame as -Mtp # -Spsame as -Mgpc # -Ssconstructor name must be init (destructor must be done) # -Sxenable exception keywords (default in Delphi/ObjFPC modes) # # Allow goto, inline, C-operators, C-vars -Sgic # --- # Code generation # --- # Uncomment the next line if you always want static/dynamic units by default # (can be overruled with -CD, -CS at the commandline) #-CS #-CD # Set the default heapsize to 8Mb #-Ch800 # Set default codegeneration checks (iocheck, overflow, range, stack) #-Ci #-Co #-Cr #-Ct # Optimizer switches # -Osgenerate smaller code # -Oa=N set alignment to N # -O1level 1 optimizations (quick optimizations, debuggable) # -O2level 2 optimizations (-O1 + optimizations which make debugging more difficult) # -O3level 3 optimizations (-O2 + optimizations which also may make the program slower rather than faster) # -Oo switch on optimalization x. See fpc -i for possible values # -OoNO switch off optimalization x. See fpc -i for possible values # -Op set target cpu for optimizing, see fpc -i for possible values #ifdef darwin #ifdef cpui386 -Cppentiumm -Oppentiumm #endif #endif # --- # Set Filenames and Paths # --- # Both slashes and backslashes are allowed in paths # path to the messagefile, not necessary anymore but can be used to override # the default language #-Fr/home/roger/fpc/fpc_svn/lib/fpc/3.1.1/msg/errore.msg #-Fr/home/roger/fpc/fpc_svn/lib/fpc/3.1.1/msg/errorn.msg #-Fr/home/roger/fpc/fpc_svn/lib/fpc/3.1.1/msg/errores.msg #-Fr/home/roger/fpc/fpc_svn/lib/fpc/3.1.1/msg/errord.msg #-Fr/home/roger/fpc/fpc_svn/lib/fpc/3.1.1/msg/errorr.msg # searchpath for units and other system dependent things -F
Re: [fpc-pascal] Pascal support in the Kattis educational site
The results may be sorted also by language name and so all C++ results comes in before Pascal even if runtime is the same. Your program was as fast as No1 but anyway not visible among top ten. This outrageous! ;-) On 08/17/2017 10:21 AM, Ingemar Ragnemalm wrote: A bit of news which I think has some interest here: "Kattis" (open.kattis.com) is a site where students can make programming exercises. This is quite important IMHO; companies look at Kattis results when recruiting. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal