Recent

Author Topic: Change Architecture/Instruction?  (Read 5298 times)

skom

  • New member
  • *
  • Posts: 9
Change Architecture/Instruction?
« on: June 19, 2018, 01:06:20 pm »
Is it possible to change the Architecture/Instruction project eg from x86 to ARNv7a already during its creation? If so, how?

Trenatos

  • Hero Member
  • *****
  • Posts: 533
    • MarcusFernstrom.com
Re: Change Architecture/Instruction?
« Reply #1 on: June 19, 2018, 03:46:29 pm »
I'm not entirely sure what you're asking..

But you can compile the same source code to many different target platforms, if you have cross compilers set up (use fpcupdeluxe to set up.)

I usually code on a Mac and compile to Linux and Windows.

skom

  • New member
  • *
  • Posts: 9
Re: Change Architecture/Instruction?
« Reply #2 on: June 19, 2018, 04:03:20 pm »
For example, I would like to set up a project on x86, then change it to, for example, ARMv7 ... I do not know where it sets in an existing project

Trenatos

  • Hero Member
  • *****
  • Posts: 533
    • MarcusFernstrom.com
Re: Change Architecture/Instruction?
« Reply #3 on: June 19, 2018, 04:22:05 pm »
You can create a project in x64, then import that project on an Arm setup, should be no problem other than changing the target for compilation.

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: Change Architecture/Instruction?
« Reply #4 on: June 19, 2018, 04:41:09 pm »
you open the menu project options and go for the config and target tab in the compiler options see attached screen shot.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Change Architecture/Instruction?
« Reply #5 on: June 19, 2018, 04:44:44 pm »
@skom

To change the target of the project:
Lazarus main menu > Project Options > Compiler Options > Config and Target > Target platform

If it is an Android project (Laz4Android or LAMW), you will also need to configure some more extra things.

And for your information, you're not able to compile to the 'some' targets you haven't set your compiler (FPC) to cross compile to.

Trenatos

  • Hero Member
  • *****
  • Posts: 533
    • MarcusFernstrom.com
Re: Change Architecture/Instruction?
« Reply #6 on: June 19, 2018, 04:47:57 pm »
@Handoko, that's one of my biggest gripes with Lazarus, it LOOKS like it comes with all sorts of stuff built-in, but in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  :P

For just moving between systems, it's really easy if you have Laz set up on both systems.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: Change Architecture/Instruction?
« Reply #7 on: June 19, 2018, 04:56:14 pm »
Yes, cross compiling is painfully hard. It took about a year for me to learn how to cross compile from Linux to Android. Once I managed to do a cross compiling, I wrote it down immediately.

I haven't tried but I knew Fpcupdelux is a tool that can help you cross compile easily. I ever tried CodeTyphon, it's awesome. Unfortunately it is become less and less compatible with Lazarus.

Here is a list of 'extra' information if anyone interested to know more about cross compiling:

Fpcupdelux - cross compiling easily:
http://wiki.freepascal.org/fpcupdeluxe#Crosscompiling

CodeTyphon - Pascal Visual Programming Studio (Lazarus/FPC clone?):
http://www.pilotlogic.com

Cross Compile from Linux to Windows:
https://forum.lazarus.freepascal.org/index.php/topic,36878

Cross Compile from Linux-x64 to Linux-i386:
https://forum.lazarus.freepascal.org/index.php/topic,39081.msg267032.html#msg267032

Cross Compile to Android ARM and Intel (LAMW 0.7 only):
https://forum.lazarus.freepascal.org/index.php/topic,38777

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: Change Architecture/Instruction?
« Reply #8 on: June 19, 2018, 06:37:30 pm »
Hi skom!

If you are using LAMW... go to your project folder and look for  "....jni/build-modes/readme.txt"
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Thaddy

  • Hero Member
  • *****
  • Posts: 14166
  • Probably until I exterminate Putin.
Re: Change Architecture/Instruction?
« Reply #9 on: June 19, 2018, 08:47:12 pm »
but in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  :P
That's required by all real compilers for a platform that's not native!!! And all database flavors....That makes your remarks extremely silly. It shows you are not a pro. And amateurs usually don't need it.
Just make sure your capabilities are OK. That means study. As simple as that...
« Last Edit: June 19, 2018, 08:53:55 pm by Thaddy »
Specialize a type, not a var.

skom

  • New member
  • *
  • Posts: 9
Re: Change Architecture/Instruction?
« Reply #10 on: June 19, 2018, 09:01:35 pm »
Thanks for help :)

Trenatos

  • Hero Member
  • *****
  • Posts: 533
    • MarcusFernstrom.com
Re: Change Architecture/Instruction?
« Reply #11 on: June 19, 2018, 10:36:50 pm »
My issue isn't so much that you have to do things to make it work, but that it looks like you don't.

It's right there in the settings, options for selecting target platform, yes the logical assumption is that by selecting that it should just work, there's no greyed out options, no warnings, no links to documentation, etc, nothing to tell you it won't work without extra setup.

Just look at fpcupdeluxe, wonderful piece of software, but what it does should be done by the installer on the website, either completely automatically or by checking boxes, which solves the issue of even knowing you're supposed to do something to make it work.

Database drivers, same thing, there are a variety of connection options, some which require external drivers and some that don't, but the GUI doesn't tell you that, or where to get drivers.

Compare to Java, skipping the cross platform bit because of the whole bytecode thing, using Maven you can just specify what driver you want and it's downloaded for you.

With FPC/Laz, I have to go hunt them down online, and no I can't just go download them off of the official website because they don't all carry older versions, which are common in Enterprise shops.

I went to write a small REST API that talks to a MySQL database for doing fairly simple work, very common work in Enterprise development, after spending most of a day just looking for drivers I had to give up and went with my usual stack, which comes with MySQL drivers from the start, so I could just start solving the problem.

As for actually cross developing.. After installing on a mac, the first thing anyone will notice is that the debugger doesn't work, gotta go turn that off, again not something someone new to the tools would expect.

GUI has no info, links or otherwise for info about useful things like $(ProjOutDir), $(TargetOS), and whatnot.

At least the Compilation and Linking has explanations and details for the options.

If you use threads in your application, you have to add -dUseCThreads to your Custom options, not that the GUI does it for you or even tells you, no you have to start randomly searching the forums to learn that's what you have to do.

My point is that the barrier to entry is very high for writing real applications in real dev shops.

When looking for a new toolset or language, FPC/Laz comes out at the bottom when comparing against Java, Python, PHP, CFML, etc. due to all the issues I explained above.

The website installer should link to the fpcupdeluxe, which should have simple/advanced mode.

There's a ton of things you don't know that you don't know when trying to start using Lazarus.

Lovely little things like it's hard to even find an example of a select * example on the wiki, most examples are for inserts and updates, not how to actually read the data (Other than how to hook it up to a table) but just about nothing for how to loop and access rows.

but in reality requires you to do other setups to actually make it work, like cross compiling, like talking to database, etc., but that's a rant for another day  :P
That's required by all real compilers for a platform that's not native!!! And all database flavors....That makes your remarks extremely silly. It shows you are not a pro. And amateurs usually don't need it.
Just make sure your capabilities are OK. That means study. As simple as that...

 

TinyPortal © 2005-2018