Recent

Author Topic: Unable to install packages  (Read 10597 times)

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #15 on: October 23, 2023, 02:42:05 pm »
On the subject of OSX install, I just tried to install the win64 cross-compiler, and it works, but only if I change Tools / Options / Environment / Files  Compiler executable to /usr/local/bin/ppcrossx64. Then I have to change it back to  /usr/local/bin/fpc to compile for osx.

that's not what's intended, right?

I followed the instructions here:
https://wiki.freepascal.org/Cross_compiling#From_macOS_to_Win64

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #16 on: October 23, 2023, 02:52:34 pm »
..., I just tried to install the win64 cross-compiler, and it works, but only if I change Tools / Options / Environment / Files  Compiler executable to /usr/local/bin/ppcrossx64. Then I have to change it back to  /usr/local/bin/fpc to compile for osx.

that's not what's intended, right?
Assuming that /usr/local/bin/fpc is the front-end fpc executable (and not a script or link) and your fpc.cfg file is configured correctly (*) then no.

In that case you can can change the target by setting the (lazarus) project options: https://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Config_and_Target and from commandline you can use: fpc -P<target_cpu> -T<target_os> <your_pascal.source.pas>

(*) terminal commandline: fpc -P<target_cpu> -T<target_os> -B -vt <your_pascal.source.pas> and search the output to locate why fpc is unable to locate your /usr/local/bin/ppcrossx64 executable
Today is tomorrow's yesterday.

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #17 on: October 25, 2023, 11:38:29 am »
So I am compiling using FPC trunk on OSX M1 (Darwin/aarch64). I needed to make these changes to get code that compiled under FPC 3.2.2 compiling using FPC trunk:

https://github.com/HealthIntersections/fhirserver/commit/5a82d2339c90d01a401aec6b61c963a54a082fa7

The changes are mostly related to class helper functions not working properly (on class function results), but there's also some problems with overloads not being processed correctly. Are these known problems? Should I report them somewhere? 
« Last Edit: October 25, 2023, 11:52:11 am by Grahame Grieve »

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #18 on: October 25, 2023, 04:04:18 pm »
@Grahame:
I take it you got the installation issues solved then ? (consider that it might be worth creating a new topic for other (unrelated to the rest of the thread/topic) issues).

The changes are mostly related to class helper functions not working properly (on class function results), but there's also some problems with overloads not being processed correctly. Are these known problems? Should I report them somewhere?
I have not looked (only a quick glance) at your changes but for any intended changes in the compiler you can consult User Changes Wiki page which have these listed as intended changes since last/previous release version (which is 3.2.2 at time of writing) for/of the compiler.

Another page to note might be New Features (since last release)
« Last Edit: October 25, 2023, 04:09:27 pm by TRon »
Today is tomorrow's yesterday.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #19 on: October 27, 2023, 04:32:03 pm »
@Grahame:
A test snippet of your TFslDecimal record and TFslDecimalHelper recordhelper compiled just fine without any issues (target Linux x86_64 bit) with just pulled FPC from trunk.

Code: Pascal  [Select][+][-]
  1. var
  2.   e: TfslDecimal;
  3.   a: TFslDecimal;
  4.  
  5. begin
  6.   e := TFslDecimal.Create(2);
  7.   a := TFslDecimal.Create('100').Power(e);
  8. end.
  9.  
Code: [Select]
Free Pascal Compiler version 3.3.1 [2023/10/27] for x86_64
Copyright (c) 1993-2023 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
test.pas(132,13) Note: Call to subroutine "function TFslDecimalHelper.ValueOf(value:AnsiString):TFslDecimal; Static;" marked as inline is not inlined
test.pas(137,13) Note: Call to subroutine "function TFslDecimalHelper.ValueOf(value:Double):TFslDecimal; Static;" marked as inline is not inlined
test.pas(142,13) Note: Call to subroutine "function TFslDecimalHelper.ValueOf(value:LongInt):TFslDecimal; Static;" marked as inline is not inlined
test.pas(406,3) Note: Local variable "m" is assigned but never used
test.pas(421,3) Note: Local variable "t" is assigned but never used
test.pas(425,8) Note: Call to subroutine "function TFslDecimalHelper.ValueOf(value:Int64):TFslDecimal; Static;" marked as inline is not inlined
test.pas(428,8) Note: Call to subroutine "function TFslDecimalHelper.ValueOf(value:Int64):TFslDecimal; Static;" marked as inline is not inlined
test.pas(624,35) Warning: Function result variable of a managed type does not seem to be initialized
Linking test
634 lines compiled, 0.1 sec, 476592 bytes code, 184184 bytes data
1 warning(s) issued
7 note(s) issued
As you can see I had to butcher some of the code to keep things sane.
« Last Edit: October 27, 2023, 04:35:36 pm by TRon »
Today is tomorrow's yesterday.

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #20 on: November 09, 2023, 10:37:51 pm »
Right. I think this is a problem for darwin/Aarch64 only.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6315
  • Compiler Developer
Re: Unable to install packages
« Reply #21 on: November 10, 2023, 10:35:54 pm »
So I am compiling using FPC trunk on OSX M1 (Darwin/aarch64). I needed to make these changes to get code that compiled under FPC 3.2.2 compiling using FPC trunk:

https://github.com/HealthIntersections/fhirserver/commit/5a82d2339c90d01a401aec6b61c963a54a082fa7

The changes are mostly related to class helper functions not working properly (on class function results), but there's also some problems with overloads not being processed correctly. Are these known problems? Should I report them somewhere?

Please provide small, self contained examples that show the problems.

 

TinyPortal © 2005-2018